linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] scripts: use pkg-config to locate libcrypto
@ 2019-06-06  8:55 Rolf Eike Beer
  2019-07-03  9:57 ` Rolf Eike Beer
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Rolf Eike Beer @ 2019-06-06  8:55 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Linux Kernel Developers List, David Howells, keyrings

From 71e19be4247fbaa2540dfb321e2b148234680a13 Mon Sep 17 00:00:00 2001
From: Rolf Eike Beer <eb@emlix.com>
Date: Thu, 22 Nov 2018 16:40:49 +0100
Subject: [PATCH] scripts: use pkg-config to locate libcrypto

Otherwise build fails if the headers are not in the default location. While at
it also ask pkg-config for the libs, with fallback to the existing value.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Cc: stable@vger.kernel.org # 4.19.x
---
 scripts/Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

v2: add CRYPTO_LIBS and CRYPTO_CFLAGS
v3: fix fallback -lcrypto

diff --git a/scripts/Makefile b/scripts/Makefile
index 9d442ee050bd..9489c3b550df 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -8,7 +8,11 @@
 # conmakehash:   Create chartable
 # conmakehash:	 Create arrays for initializing the kernel console tables
 
+PKG_CONFIG?= pkg-config
+
 HOST_EXTRACFLAGS += -I$(srctree)/tools/include
+CRYPTO_LIBS = $(shell $(PKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto)
+CRYPTO_CFLAGS = $(shell $(PKG_CONFIG) --cflags libcrypto 2> /dev/null)
 
 hostprogs-$(CONFIG_BUILD_BIN2C)  += bin2c
 hostprogs-$(CONFIG_KALLSYMS)     += kallsyms
@@ -23,8 +27,9 @@ hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
 
 HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include
 HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
-HOSTLDLIBS_sign-file = -lcrypto
-HOSTLDLIBS_extract-cert = -lcrypto
+HOSTLDLIBS_sign-file = $(CRYPTO_LIBS)
+HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
+HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)
 
 always		:= $(hostprogs-y) $(hostprogs-m)
 
-- 
2.21.0


-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] scripts: use pkg-config to locate libcrypto
  2019-06-06  8:55 [PATCH v3] scripts: use pkg-config to locate libcrypto Rolf Eike Beer
@ 2019-07-03  9:57 ` Rolf Eike Beer
  2019-07-03 11:20   ` Enrico Weigelt, metux IT consult
  2019-09-10  6:41 ` [PATCH v3][RESEND] " Rolf Eike Beer
  2020-04-27  8:11 ` [PATCH v4] " Rolf Eike Beer
  2 siblings, 1 reply; 19+ messages in thread
From: Rolf Eike Beer @ 2019-07-03  9:57 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Linux Kernel Developers List, David Howells, keyrings

[-- Attachment #1: Type: text/plain, Size: 720 bytes --]

> From 71e19be4247fbaa2540dfb321e2b148234680a13 Mon Sep 17 00:00:00 2001
> From: Rolf Eike Beer <eb@emlix.com>
> Date: Thu, 22 Nov 2018 16:40:49 +0100
> Subject: [PATCH] scripts: use pkg-config to locate libcrypto
> 
> Otherwise build fails if the headers are not in the default location. While
> at it also ask pkg-config for the libs, with fallback to the existing
> value.

Ping?
-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 313 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] scripts: use pkg-config to locate libcrypto
  2019-07-03  9:57 ` Rolf Eike Beer
@ 2019-07-03 11:20   ` Enrico Weigelt, metux IT consult
  0 siblings, 0 replies; 19+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-07-03 11:20 UTC (permalink / raw)
  To: Rolf Eike Beer, David Woodhouse
  Cc: Linux Kernel Developers List, David Howells, keyrings

On 03.07.19 11:57, Rolf Eike Beer wrote:
>> From 71e19be4247fbaa2540dfb321e2b148234680a13 Mon Sep 17 00:00:00 2001
>> From: Rolf Eike Beer <eb@emlix.com>
>> Date: Thu, 22 Nov 2018 16:40:49 +0100
>> Subject: [PATCH] scripts: use pkg-config to locate libcrypto
>>
>> Otherwise build fails if the headers are not in the default location. While
>> at it also ask pkg-config for the libs, with fallback to the existing
>> value.
> 
> Ping?

Maybe repost ?

In general i think it's a good idea to use pkg-config.

Actually, I'd prefer exclusively using pkg-config instead of hardcoded
pathes - it's a wonderful central knob for doing those kind of site-
specific customizations.


--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v3][RESEND] scripts: use pkg-config to locate libcrypto
  2019-06-06  8:55 [PATCH v3] scripts: use pkg-config to locate libcrypto Rolf Eike Beer
  2019-07-03  9:57 ` Rolf Eike Beer
@ 2019-09-10  6:41 ` Rolf Eike Beer
       [not found]   ` <20190910104830.C1B0E2067B@mail.kernel.org>
  2019-11-29  7:56   ` [PATCH v3][RESEND #2] " Rolf Eike Beer
  2020-04-27  8:11 ` [PATCH v4] " Rolf Eike Beer
  2 siblings, 2 replies; 19+ messages in thread
From: Rolf Eike Beer @ 2019-09-10  6:41 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Linux Kernel Developers List, David Howells, keyrings

Otherwise build fails if the headers are not in the default location. While at
it also ask pkg-config for the libs, with fallback to the existing value.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Cc: stable@vger.kernel.org
---
 scripts/Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile b/scripts/Makefile
index 16bcb8087899..1715adcd8f81 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -8,7 +8,11 @@
 # conmakehash:   Create chartable
 # conmakehash:	 Create arrays for initializing the kernel console tables
 
+PKG_CONFIG?= pkg-config
+
 HOST_EXTRACFLAGS += -I$(srctree)/tools/include
+CRYPTO_LIBS = $(shell $(PKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto)
+CRYPTO_CFLAGS = $(shell $(PKG_CONFIG) --cflags libcrypto 2> /dev/null)
 
 hostprogs-$(CONFIG_BUILD_BIN2C)  += bin2c
 hostprogs-$(CONFIG_KALLSYMS)     += kallsyms
@@ -23,8 +27,9 @@ hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
 
 HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include
 HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
-HOSTLDLIBS_sign-file = -lcrypto
-HOSTLDLIBS_extract-cert = -lcrypto
+HOSTLDLIBS_sign-file = $(CRYPTO_LIBS)
+HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
+HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)
 
 always		:= $(hostprogs-y) $(hostprogs-m)
 
-- 
2.23.0





^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v3][RESEND] scripts: use pkg-config to locate libcrypto
       [not found]   ` <20190910104830.C1B0E2067B@mail.kernel.org>
@ 2019-09-11 13:43     ` Rolf Eike Beer
  0 siblings, 0 replies; 19+ messages in thread
From: Rolf Eike Beer @ 2019-09-11 13:43 UTC (permalink / raw)
  To: Sasha Levin; +Cc: Linux Kernel Developers List

[-- Attachment #1: Type: text/plain, Size: 1140 bytes --]

Am Dienstag, 10. September 2019, 12:48:30 CEST schrieb Sasha Levin:
> Hi,
> 
> [This is an automated email]
> 
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: all
> 
> The bot has tested the following trees: v5.2.13, v4.19.71, v4.14.142,
> v4.9.191, v4.4.191.
> 
> v5.2.13: Build OK!
> v4.19.71: Build OK!
> v4.14.142: Failed to apply! Possible dependencies:
>     8377bd2b9ee1 ("kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS")

This one causes the collision, the simple fix would probably be to manually 
use the old variable names when cherry-picking.

> How should we proceed with this patch?

I can send a backport or you manually fix it up when applying, as you wish.

Greetings,

Eike
-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 313 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v3][RESEND #2] scripts: use pkg-config to locate libcrypto
  2019-09-10  6:41 ` [PATCH v3][RESEND] " Rolf Eike Beer
       [not found]   ` <20190910104830.C1B0E2067B@mail.kernel.org>
@ 2019-11-29  7:56   ` Rolf Eike Beer
  1 sibling, 0 replies; 19+ messages in thread
From: Rolf Eike Beer @ 2019-11-29  7:56 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Linux Kernel Developers List, David Howells, keyrings

Otherwise build fails if the headers are not in the default location. While at
it also ask pkg-config for the libs, with fallback to the existing value.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Cc: stable@vger.kernel.org
---
 scripts/Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile b/scripts/Makefile
index 3e86b300f5a1..034789783317 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -8,7 +8,11 @@
 # conmakehash:   Create chartable
 # conmakehash:	 Create arrays for initializing the kernel console tables
 
+PKG_CONFIG?= pkg-config
+
 HOST_EXTRACFLAGS += -I$(srctree)/tools/include
+CRYPTO_LIBS = $(shell $(PKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto)
+CRYPTO_CFLAGS = $(shell $(PKG_CONFIG) --cflags libcrypto 2> /dev/null)
 
 hostprogs-$(CONFIG_BUILD_BIN2C)  += bin2c
 hostprogs-$(CONFIG_KALLSYMS)     += kallsyms
@@ -23,8 +27,9 @@ hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
 
 HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include
 HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
-HOSTLDLIBS_sign-file = -lcrypto
-HOSTLDLIBS_extract-cert = -lcrypto
+HOSTLDLIBS_sign-file = $(CRYPTO_LIBS)
+HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
+HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)
 
 always		:= $(hostprogs-y) $(hostprogs-m)
 
-- 
2.24.0


-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v4] scripts: use pkg-config to locate libcrypto
  2019-06-06  8:55 [PATCH v3] scripts: use pkg-config to locate libcrypto Rolf Eike Beer
  2019-07-03  9:57 ` Rolf Eike Beer
  2019-09-10  6:41 ` [PATCH v3][RESEND] " Rolf Eike Beer
@ 2020-04-27  8:11 ` Rolf Eike Beer
  2020-07-30 12:49   ` Rolf Eike Beer
  2021-01-13 12:49   ` [PATCH v5] " Rolf Eike Beer
  2 siblings, 2 replies; 19+ messages in thread
From: Rolf Eike Beer @ 2020-04-27  8:11 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Linux Kernel Developers List, David Howells, keyrings

From 082ba542ca4c710dcf592a6f9233603b9275d05d Mon Sep 17 00:00:00 2001
From: Rolf Eike Beer <eb@emlix.com>
Date: Thu, 22 Nov 2018 16:40:49 +0100
Subject: [PATCH 1/2] scripts: use pkg-config to locate libcrypto

Otherwise build fails if the headers are not in the default location. While at
it also ask pkg-config for the libs, with fallback to the existing value.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Cc: stable@vger.kernel.org # 5.6.x
---
 scripts/Makefile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile b/scripts/Makefile
index 95ecf970c74c..35ed997e074b 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -3,6 +3,11 @@
 # scripts contains sources for various helper programs used throughout
 # the kernel for the build process.
 
+PKG_CONFIG?= pkg-config
+
+CRYPTO_LIBS = $(shell $(PKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto)
+CRYPTO_CFLAGS = $(shell $(PKG_CONFIG) --cflags libcrypto 2> /dev/null)
+
 always-$(CONFIG_BUILD_BIN2C)			+= bin2c
 always-$(CONFIG_KALLSYMS)			+= kallsyms
 always-$(BUILD_C_RECORDMCOUNT)			+= recordmcount
@@ -14,8 +19,9 @@ always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE)	+= insert-sys-cert
 
 HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
 HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
-HOSTLDLIBS_sign-file = -lcrypto
-HOSTLDLIBS_extract-cert = -lcrypto
+HOSTLDLIBS_sign-file = $(CRYPTO_LIBS)
+HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
+HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)
 
 ifdef CONFIG_UNWINDER_ORC
 ifeq ($(ARCH),x86_64)
-- 
2.26.1





^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v4] scripts: use pkg-config to locate libcrypto
  2020-04-27  8:11 ` [PATCH v4] " Rolf Eike Beer
@ 2020-07-30 12:49   ` Rolf Eike Beer
  2021-01-13 12:49   ` [PATCH v5] " Rolf Eike Beer
  1 sibling, 0 replies; 19+ messages in thread
From: Rolf Eike Beer @ 2020-07-30 12:49 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Linux Kernel Developers List, David Howells, keyrings

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

Am Montag, 27. April 2020, 10:11:28 CEST schrieb Rolf Eike Beer:
> From 082ba542ca4c710dcf592a6f9233603b9275d05d Mon Sep 17 00:00:00 2001
> From: Rolf Eike Beer <eb@emlix.com>
> Date: Thu, 22 Nov 2018 16:40:49 +0100
> Subject: [PATCH 1/2] scripts: use pkg-config to locate libcrypto
> 
> Otherwise build fails if the headers are not in the default location. While
> at it also ask pkg-config for the libs, with fallback to the existing
> value.

Close to 2 years since the original patch… can this please be applied? It 
get's annoying to patch every new kernel version the same way again.

Thx

Eike
-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 313 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v5] scripts: use pkg-config to locate libcrypto
  2020-04-27  8:11 ` [PATCH v4] " Rolf Eike Beer
  2020-07-30 12:49   ` Rolf Eike Beer
@ 2021-01-13 12:49   ` Rolf Eike Beer
  2021-01-13 15:57     ` Ben Boeckel
                       ` (4 more replies)
  1 sibling, 5 replies; 19+ messages in thread
From: Rolf Eike Beer @ 2021-01-13 12:49 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Linux Kernel Developers List, David Howells, keyrings, linux-kbuild

Otherwise build fails if the headers are not in the default location. While at
it also ask pkg-config for the libs, with fallback to the existing value.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Cc: stable@vger.kernel.org # 5.6.x
---
 scripts/Makefile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

This has been sent multiple times since more than 2 year, please pick it up 
through whatever tree. I need to patch every new stable kernel version to 
make them build in our chrooted environment.


diff --git a/scripts/Makefile b/scripts/Makefile
index b5418ec587fb..7553692d241f 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -3,6 +3,11 @@
 # scripts contains sources for various helper programs used throughout
 # the kernel for the build process.
 
+PKG_CONFIG ?= pkg-config
+
+CRYPTO_LIBS = $(shell $(PKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto)
+CRYPTO_CFLAGS = $(shell $(PKG_CONFIG) --cflags libcrypto 2> /dev/null)
+
 hostprogs-always-$(CONFIG_BUILD_BIN2C)			+= bin2c
 hostprogs-always-$(CONFIG_KALLSYMS)			+= kallsyms
 hostprogs-always-$(BUILD_C_RECORDMCOUNT)		+= recordmcount
@@ -14,8 +19,9 @@ hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE)	+= insert-sys-cert
 
 HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
 HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
-HOSTLDLIBS_sign-file = -lcrypto
-HOSTLDLIBS_extract-cert = -lcrypto
+HOSTLDLIBS_sign-file = $(CRYPTO_LIBS)
+HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
+HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)
 
 ifdef CONFIG_UNWINDER_ORC
 ifeq ($(ARCH),x86_64)
-- 
2.29.2
-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source




^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v5] scripts: use pkg-config to locate libcrypto
  2021-01-13 12:49   ` [PATCH v5] " Rolf Eike Beer
@ 2021-01-13 15:57     ` Ben Boeckel
  2021-01-13 16:00       ` Ben Boeckel
  2021-01-14  3:50     ` Jarkko Sakkinen
                       ` (3 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: Ben Boeckel @ 2021-01-13 15:57 UTC (permalink / raw)
  To: Rolf Eike Beer
  Cc: David Woodhouse, Linux Kernel Developers List, David Howells,
	keyrings, linux-kbuild

On Wed, Jan 13, 2021 at 13:49:12 +0100, Rolf Eike Beer wrote:
> Otherwise build fails if the headers are not in the default location. While at
> it also ask pkg-config for the libs, with fallback to the existing value.
> 
> Signed-off-by: Rolf Eike Beer <eb@emlix.com>

Reviewed-by: Ben Boeckel <mathstuf@gmail.com>

> Cc: stable@vger.kernel.org # 5.6.x

Note that keyutils is not in the kernel, so I don't know how useful this
is.

--Ben

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v5] scripts: use pkg-config to locate libcrypto
  2021-01-13 15:57     ` Ben Boeckel
@ 2021-01-13 16:00       ` Ben Boeckel
  0 siblings, 0 replies; 19+ messages in thread
From: Ben Boeckel @ 2021-01-13 16:00 UTC (permalink / raw)
  To: Rolf Eike Beer
  Cc: David Woodhouse, Linux Kernel Developers List, David Howells,
	keyrings, linux-kbuild

On Wed, Jan 13, 2021 at 10:57:58 -0500, Ben Boeckel wrote:
> > Cc: stable@vger.kernel.org # 5.6.x
> 
> Note that keyutils is not in the kernel, so I don't know how useful this
> is.

Scratch that; I remember a similar patch for keyutils; this is for the
kernel.

--Ben

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v5] scripts: use pkg-config to locate libcrypto
  2021-01-13 12:49   ` [PATCH v5] " Rolf Eike Beer
  2021-01-13 15:57     ` Ben Boeckel
@ 2021-01-14  3:50     ` Jarkko Sakkinen
  2021-01-15  0:48     ` Jarkko Sakkinen
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 19+ messages in thread
From: Jarkko Sakkinen @ 2021-01-14  3:50 UTC (permalink / raw)
  To: Rolf Eike Beer
  Cc: David Woodhouse, Linux Kernel Developers List, David Howells,
	keyrings, linux-kbuild

On Wed, Jan 13, 2021 at 01:49:12PM +0100, Rolf Eike Beer wrote:
> Otherwise build fails if the headers are not in the default location. While at
> it also ask pkg-config for the libs, with fallback to the existing value.
> 
> Signed-off-by: Rolf Eike Beer <eb@emlix.com>
> Cc: stable@vger.kernel.org # 5.6.x

Acked-by: Jarkko Sakkinen <jarkko@kernel.org>

/Jarkko

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v5] scripts: use pkg-config to locate libcrypto
  2021-01-13 12:49   ` [PATCH v5] " Rolf Eike Beer
  2021-01-13 15:57     ` Ben Boeckel
  2021-01-14  3:50     ` Jarkko Sakkinen
@ 2021-01-15  0:48     ` Jarkko Sakkinen
  2021-01-25 11:56     ` Rolf Eike Beer
  2021-01-27  7:50     ` [PATCH v6] " Rolf Eike Beer
  4 siblings, 0 replies; 19+ messages in thread
From: Jarkko Sakkinen @ 2021-01-15  0:48 UTC (permalink / raw)
  To: Rolf Eike Beer
  Cc: David Woodhouse, Linux Kernel Developers List, David Howells,
	keyrings, linux-kbuild

On Wed, Jan 13, 2021 at 01:49:12PM +0100, Rolf Eike Beer wrote:
> Otherwise build fails if the headers are not in the default location. While at
> it also ask pkg-config for the libs, with fallback to the existing value.
> 
> Signed-off-by: Rolf Eike Beer <eb@emlix.com>
> Cc: stable@vger.kernel.org # 5.6.x

Acked-by: Jarkko Sakkinen <jarkko@kernel.org>

/Jarkko

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v5] scripts: use pkg-config to locate libcrypto
  2021-01-13 12:49   ` [PATCH v5] " Rolf Eike Beer
                       ` (2 preceding siblings ...)
  2021-01-15  0:48     ` Jarkko Sakkinen
@ 2021-01-25 11:56     ` Rolf Eike Beer
  2021-01-26  6:30       ` Masahiro Yamada
  2021-01-27  7:50     ` [PATCH v6] " Rolf Eike Beer
  4 siblings, 1 reply; 19+ messages in thread
From: Rolf Eike Beer @ 2021-01-25 11:56 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Linux Kernel Developers List, David Howells, keyrings, linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 693 bytes --]

Am Mittwoch, 13. Januar 2021, 13:49:12 CET schrieb Rolf Eike Beer:
> Otherwise build fails if the headers are not in the default location. While
> at it also ask pkg-config for the libs, with fallback to the existing
> value.

Can someone please take this through the kbuild-tree? Noone seems to be 
interested in picking this up so far.

Thanks,

Eike
-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 313 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v5] scripts: use pkg-config to locate libcrypto
  2021-01-25 11:56     ` Rolf Eike Beer
@ 2021-01-26  6:30       ` Masahiro Yamada
  2021-01-26  8:01         ` Rolf Eike Beer
  0 siblings, 1 reply; 19+ messages in thread
From: Masahiro Yamada @ 2021-01-26  6:30 UTC (permalink / raw)
  To: Rolf Eike Beer
  Cc: David Woodhouse, Linux Kernel Developers List, David Howells,
	keyrings, Linux Kbuild mailing list

On Tue, Jan 26, 2021 at 2:42 PM Rolf Eike Beer <eb@emlix.com> wrote:
>
> Am Mittwoch, 13. Januar 2021, 13:49:12 CET schrieb Rolf Eike Beer:
> > Otherwise build fails if the headers are not in the default location. While
> > at it also ask pkg-config for the libs, with fallback to the existing
> > value.
>
> Can someone please take this through the kbuild-tree? Noone seems to be
> interested in picking this up so far.
>
> Thanks,
>
> Eike
> --
> Rolf Eike Beer, emlix GmbH, http://www.emlix.com
> Fon +49 551 30664-0, Fax +49 551 30664-11
> Gothaer Platz 3, 37083 Göttingen, Germany
> Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
> Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055
>
> emlix - smart embedded open source



Is 'PKG_CONFIG' necessary?

I see many Makefiles hard-coding 'pkg-config'.



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v5] scripts: use pkg-config to locate libcrypto
  2021-01-26  6:30       ` Masahiro Yamada
@ 2021-01-26  8:01         ` Rolf Eike Beer
  2021-01-26 16:02           ` Masahiro Yamada
  0 siblings, 1 reply; 19+ messages in thread
From: Rolf Eike Beer @ 2021-01-26  8:01 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: David Woodhouse, Linux Kernel Developers List, David Howells,
	keyrings, Linux Kbuild mailing list

[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]

Am Dienstag, 26. Januar 2021, 07:30:03 CET schrieb Masahiro Yamada:
> On Tue, Jan 26, 2021 at 2:42 PM Rolf Eike Beer <eb@emlix.com> wrote:
> > Am Mittwoch, 13. Januar 2021, 13:49:12 CET schrieb Rolf Eike Beer:
> > > Otherwise build fails if the headers are not in the default location.
> > > While
> > > at it also ask pkg-config for the libs, with fallback to the existing
> > > value.
> > 
> > Can someone please take this through the kbuild-tree? Noone seems to be
> > interested in picking this up so far.

> Is 'PKG_CONFIG' necessary?
> 
> I see many Makefiles hard-coding 'pkg-config'.

Well, it depends ;)

When people use pkgconf then this usually installs a pkg-config alias, too, so 
that would be no problem. The problem comes when other places in the kernel 
start copying that code over, and then hardcode pkg-config for stuff that 
needs a prefixed pkg-config because it is about target code.

Given that I would prefer it this way, but YMMV. If it is that variable that 
blocks integrating I'll change it.

Eike
-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 313 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v5] scripts: use pkg-config to locate libcrypto
  2021-01-26  8:01         ` Rolf Eike Beer
@ 2021-01-26 16:02           ` Masahiro Yamada
  0 siblings, 0 replies; 19+ messages in thread
From: Masahiro Yamada @ 2021-01-26 16:02 UTC (permalink / raw)
  To: Rolf Eike Beer
  Cc: David Woodhouse, Linux Kernel Developers List, David Howells,
	keyrings, Linux Kbuild mailing list

On Tue, Jan 26, 2021 at 5:01 PM Rolf Eike Beer <eb@emlix.com> wrote:
>
> Am Dienstag, 26. Januar 2021, 07:30:03 CET schrieb Masahiro Yamada:
> > On Tue, Jan 26, 2021 at 2:42 PM Rolf Eike Beer <eb@emlix.com> wrote:
> > > Am Mittwoch, 13. Januar 2021, 13:49:12 CET schrieb Rolf Eike Beer:
> > > > Otherwise build fails if the headers are not in the default location.
> > > > While
> > > > at it also ask pkg-config for the libs, with fallback to the existing
> > > > value.
> > >
> > > Can someone please take this through the kbuild-tree? Noone seems to be
> > > interested in picking this up so far.
>
> > Is 'PKG_CONFIG' necessary?
> >
> > I see many Makefiles hard-coding 'pkg-config'.
>
> Well, it depends ;)
>
> When people use pkgconf then this usually installs a pkg-config alias, too, so
> that would be no problem. The problem comes when other places in the kernel
> start copying that code over, and then hardcode pkg-config for stuff that
> needs a prefixed pkg-config because it is about target code.
>
> Given that I would prefer it this way, but YMMV. If it is that variable that
> blocks integrating I'll change it.
>
> Eike
> --
> Rolf Eike Beer, emlix GmbH, http://www.emlix.com
> Fon +49 551 30664-0, Fax +49 551 30664-11
> Gothaer Platz 3, 37083 Göttingen, Germany
> Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
> Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055
>
> emlix - smart embedded open source


What I understood from commit a8a5cd8b472c is
the cross-compile prefix is needed
only for the target CC.


$(CC)      ->  $(CROSS_COMPILE)pkg-config  (i.e. $(PKG_CONFIG))
$(HOSTCC)  ->  pkg-config


For cross-compiling, the prefixing makes sense
because $(CC) != $(HOSTCC)


In this case, scripts/extract-cert is a host tool
compiled by $(HOSTCC), so I do not see
a good reason to use $(PKG_CONFIG).


If somebody copy-pastes the code without understanding it,
that is their problem.

Let's do proper engineering. :-)



--
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v6] scripts: use pkg-config to locate libcrypto
  2021-01-13 12:49   ` [PATCH v5] " Rolf Eike Beer
                       ` (3 preceding siblings ...)
  2021-01-25 11:56     ` Rolf Eike Beer
@ 2021-01-27  7:50     ` Rolf Eike Beer
  2021-01-28  6:37       ` Masahiro Yamada
  4 siblings, 1 reply; 19+ messages in thread
From: Rolf Eike Beer @ 2021-01-27  7:50 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Linux Kernel Developers List, David Howells, keyrings, linux-kbuild

From f467f251e44cd406c9556ea7d68d131f56e0d832 Mon Sep 17 00:00:00 2001
From: Rolf Eike Beer <eb@emlix.com>
Date: Thu, 22 Nov 2018 16:40:49 +0100
Subject: [PATCH] scripts: use pkg-config to locate libcrypto

Otherwise build fails if the headers are not in the default location. While at
it also ask pkg-config for the libs, with fallback to the existing value.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Cc: stable@vger.kernel.org # 5.6.x
---
 scripts/Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Changes in v6:
 - hardcode pkg-config

diff --git a/scripts/Makefile b/scripts/Makefile
index b5418ec587fb..9de3c03b94aa 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -3,6 +3,9 @@
 # scripts contains sources for various helper programs used throughout
 # the kernel for the build process.
 
+CRYPTO_LIBS = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto)
+CRYPTO_CFLAGS = $(shell pkg-config --cflags libcrypto 2> /dev/null)
+
 hostprogs-always-$(CONFIG_BUILD_BIN2C)			+= bin2c
 hostprogs-always-$(CONFIG_KALLSYMS)			+= kallsyms
 hostprogs-always-$(BUILD_C_RECORDMCOUNT)		+= recordmcount
@@ -14,8 +17,9 @@ hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE)	+= insert-sys-cert
 
 HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
 HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
-HOSTLDLIBS_sign-file = -lcrypto
-HOSTLDLIBS_extract-cert = -lcrypto
+HOSTLDLIBS_sign-file = $(CRYPTO_LIBS)
+HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
+HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)
 
 ifdef CONFIG_UNWINDER_ORC
 ifeq ($(ARCH),x86_64)
-- 
2.30.0

-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source




^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v6] scripts: use pkg-config to locate libcrypto
  2021-01-27  7:50     ` [PATCH v6] " Rolf Eike Beer
@ 2021-01-28  6:37       ` Masahiro Yamada
  0 siblings, 0 replies; 19+ messages in thread
From: Masahiro Yamada @ 2021-01-28  6:37 UTC (permalink / raw)
  To: Rolf Eike Beer
  Cc: David Woodhouse, Linux Kernel Developers List, David Howells,
	keyrings, Linux Kbuild mailing list

On Wed, Jan 27, 2021 at 5:06 PM Rolf Eike Beer <eb@emlix.com> wrote:
>
> From f467f251e44cd406c9556ea7d68d131f56e0d832 Mon Sep 17 00:00:00 2001
> From: Rolf Eike Beer <eb@emlix.com>
> Date: Thu, 22 Nov 2018 16:40:49 +0100
> Subject: [PATCH] scripts: use pkg-config to locate libcrypto
>
> Otherwise build fails if the headers are not in the default location. While at
> it also ask pkg-config for the libs, with fallback to the existing value.
>
> Signed-off-by: Rolf Eike Beer <eb@emlix.com>
> Cc: stable@vger.kernel.org # 5.6.x
> ---
>  scripts/Makefile | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> Changes in v6:
>  - hardcode pkg-config
>
> diff --git a/scripts/Makefile b/scripts/Makefile
> index b5418ec587fb..9de3c03b94aa 100644
> --- a/scripts/Makefile
> +++ b/scripts/Makefile
> @@ -3,6 +3,9 @@
>  # scripts contains sources for various helper programs used throughout
>  # the kernel for the build process.
>
> +CRYPTO_LIBS = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto)
> +CRYPTO_CFLAGS = $(shell pkg-config --cflags libcrypto 2> /dev/null)
> +
>  hostprogs-always-$(CONFIG_BUILD_BIN2C)                 += bin2c
>  hostprogs-always-$(CONFIG_KALLSYMS)                    += kallsyms
>  hostprogs-always-$(BUILD_C_RECORDMCOUNT)               += recordmcount
> @@ -14,8 +17,9 @@ hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE)   += insert-sys-cert
>
>  HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
>  HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
> -HOSTLDLIBS_sign-file = -lcrypto
> -HOSTLDLIBS_extract-cert = -lcrypto
> +HOSTLDLIBS_sign-file = $(CRYPTO_LIBS)
> +HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
> +HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)
>
>  ifdef CONFIG_UNWINDER_ORC
>  ifeq ($(ARCH),x86_64)
> --
> 2.30.0
>
> --
> Rolf Eike Beer, emlix GmbH, http://www.emlix.com
> Fon +49 551 30664-0, Fax +49 551 30664-11
> Gothaer Platz 3, 37083 Göttingen, Germany
> Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
> Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055
>
> emlix - smart embedded open source
>
>
>

Applied to linux-kbuild. Thanks.

-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-01-28  6:39 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06  8:55 [PATCH v3] scripts: use pkg-config to locate libcrypto Rolf Eike Beer
2019-07-03  9:57 ` Rolf Eike Beer
2019-07-03 11:20   ` Enrico Weigelt, metux IT consult
2019-09-10  6:41 ` [PATCH v3][RESEND] " Rolf Eike Beer
     [not found]   ` <20190910104830.C1B0E2067B@mail.kernel.org>
2019-09-11 13:43     ` Rolf Eike Beer
2019-11-29  7:56   ` [PATCH v3][RESEND #2] " Rolf Eike Beer
2020-04-27  8:11 ` [PATCH v4] " Rolf Eike Beer
2020-07-30 12:49   ` Rolf Eike Beer
2021-01-13 12:49   ` [PATCH v5] " Rolf Eike Beer
2021-01-13 15:57     ` Ben Boeckel
2021-01-13 16:00       ` Ben Boeckel
2021-01-14  3:50     ` Jarkko Sakkinen
2021-01-15  0:48     ` Jarkko Sakkinen
2021-01-25 11:56     ` Rolf Eike Beer
2021-01-26  6:30       ` Masahiro Yamada
2021-01-26  8:01         ` Rolf Eike Beer
2021-01-26 16:02           ` Masahiro Yamada
2021-01-27  7:50     ` [PATCH v6] " Rolf Eike Beer
2021-01-28  6:37       ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).