package/libtomcrypt: add pkgconfig support
PATCH 1/3 package/libtomcrypt: add pkgconfig support
--- package/libtomcrypt/libtomcrypt.mk | 3 +++ package/libtomcrypt/libtomcrypt.pc.in | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 package/libtomcrypt/libtomcrypt.pc.in
package/libtomcrypt/libtomcrypt.mk +3 -0
@@ -27,6 +27,9 @@ define LIBTOMCRYPT_INSTALL_STAGING_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR="$(STAGING_DIR)" \ PREFIX=/usr NODOCS=1 INSTALL_USER=$(shell id -u) \ INSTALL_GROUP=$(shell id -g) install + $(INSTALL) -D -m 0644 package/libtomcrypt/libtomcrypt.pc.in \ + $(STAGING_DIR)/usr/lib/pkgconfig/libtomcrypt.pc + $(SED) "s/@PACKAGE_VERSION@/${LIBTOMCRYPT_VERSION}/" $(STAGING_DIR)/usr/lib/pkgconfig/libtomcrypt.pc endef $(eval $(generic-package))
package/libtomcrypt/libtomcrypt.pc.in new file +10 -0
@@ -0,0 +1,10 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: LibTomCrypt +Description: public domain open source cryptographic toolkit +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -ltomcrypt +Cflags: -I${includedir}
Signature · 1 line
2.31.1
PATCH 2/3 package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables
Fixes:
.../x86_64-buildroot-linux-gnu/bin/ld: .../host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libtomcrypt.a(md5.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
--- package/libtomcrypt/libtomcrypt.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/libtomcrypt/libtomcrypt.mk +1 -1
@@ -17,7 +17,7 @@ LIBTOMCRYPT_DEPENDENCIES = libtommath # 0001-fix-CVE-2019-17362.patch LIBTOMCRYPT_IGNORE_CVES += CVE-2019-17362 -LIBTOMCRYPT_CFLAGS = -I./src/headers $(TARGET_CFLAGS) -DLTC_SOURCE -DLTM_DESC +LIBTOMCRYPT_CFLAGS = -I./src/headers $(TARGET_CFLAGS) -fPIC -DLTC_SOURCE -DLTM_DESC define LIBTOMCRYPT_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(LIBTOMCRYPT_CFLAGS)"
Signature · 1 line
2.31.1
PATCH 2/3 package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables
Quoted 5 lines · On Mon, 12 Apr 2021 21:55:26 +0200 Peter Seiderer <[email protected]> wrote:
Fixes:
.../x86_64-buildroot-linux-gnu/bin/ld: .../host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libtomcrypt.a(md5.o): relocation
R_X86_64_32against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPICSigned-off-by Peter Seiderer <[email protected]>
In which situations? Are there some autobuilder failures? If not, what configuration fails?
Thomas
Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 2/3 package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables
Hello Thomas,
Quoted 11 lines · Thomas Petazzoni
Quoted 5 lines · On Mon, 12 Apr 2021 21:55:26 +0200 Peter Seiderer <[email protected]> wrote:
Fixes:
.../x86_64-buildroot-linux-gnu/bin/ld: .../host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libtomcrypt.a(md5.o): relocation
R_X86_64_32against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPICSigned-off-by Peter Seiderer <[email protected]>In which situations? Are there some autobuilder failures? If not, what configuration fails?
Failure with an custom project which links libtomcrpyt to/into a dynamic library (x86_64)...., sorry no autobuilder failure (there is only one libtomcrypt cosumer in buildroot until now, dopbear)...
Regards,
Peter
Quoted 2 lines
Thomas
PATCH 2/3 package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables
In reply to Peter SeidererQuoted 14 lines · Peter Seiderer
Fixes:
.../x86_64-buildroot-linux-gnu/bin/ld: .../host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libtomcrypt.a(md5.o): relocation
R_X86_64_32against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPICSigned-off-by Peter Seiderer <[email protected]>--- package/libtomcrypt/libtomcrypt.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/libtomcrypt/libtomcrypt.mk +0
-0
package/libtomcrypt/libtomcrypt.mk LIBTOMCRYPT_DEPENDENCIES = libtommath · line 20
Quoted 5 lines
package/libtomcrypt/libtomcrypt.mk +1
-1@@ -17,7 +17,7 @@ LIBTOMCRYPT_DEPENDENCIES = libtommath # 0001-fix-CVE-2019-17362.patch LIBTOMCRYPT_IGNORE_CVES += CVE-2019-17362 -LIBTOMCRYPT_CFLAGS = -I./src/headers $(TARGET_CFLAGS) -DLTC_SOURCE -DLTM_DESC +LIBTOMCRYPT_CFLAGS = -I./src/headers $(TARGET_CFLAGS) -fPIC -DLTC_SOURCE -DLTM_DESC
On some architectures, -fPIC is incompatible with static builds. So this should
probably only be done in non-static builds.
Marked as Changes Requested.
Regards,
Arnout
Quoted 4 lines
package/libtomcrypt/libtomcrypt.mk +0
-0define LIBTOMCRYPT_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(LIBTOMCRYPT_CFLAGS)"
PATCH 2/3 package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables
Hello Arnout,
Quoted 18 lines · Arnout Vandecappelle
Quoted 17 lines · Peter Seiderer
Fixes:
.../x86_64-buildroot-linux-gnu/bin/ld: .../host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libtomcrypt.a(md5.o): relocation
R_X86_64_32against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPICSigned-off-by Peter Seiderer <[email protected]>--- package/libtomcrypt/libtomcrypt.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/libtomcrypt/libtomcrypt.mk +0
-0@@ -17,7 +17,7 @@ LIBTOMCRYPT_DEPENDENCIES = libtommath # 0001-fix-CVE-2019-17362.patch LIBTOMCRYPT_IGNORE_CVES += CVE-2019-17362
Quoted 5 lines
package/libtomcrypt/libtomcrypt.mk LIBTOMCRYPT_DEPENDENCIES = libtommath · line 20
Quoted 2 lines
package/libtomcrypt/libtomcrypt.mk +1
-1-LIBTOMCRYPT_CFLAGS = -I./src/headers $(TARGET_CFLAGS) -DLTC_SOURCE -DLTM_DESC +LIBTOMCRYPT_CFLAGS = -I./src/headers $(TARGET_CFLAGS) -fPIC -DLTC_SOURCE -DLTM_DESCOn some architectures, -fPIC is incompatible with static builds. So this should
probably only be done in non-static builds.
O.k., will fix it...., thanks for review!
Regards,
Peter
Quoted 10 lines
Marked as Changes Requested.
Regards,
ArnoutQuoted 4 lines
package/libtomcrypt/libtomcrypt.mk +0
-0define LIBTOMCRYPT_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(LIBTOMCRYPT_CFLAGS)"
PATCH 3/3 package/libtomcrypt: update home page URL to https
In reply to Peter Seiderer- update home page URL to https
--- package/libtomcrypt/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/libtomcrypt/Config.in +1 -1
@@ -8,4 +8,4 @@ config BR2_PACKAGE_LIBTOMCRYPT functions, chaining modes, pseudo-random number generators, public key cryptography and a plethora of other routines. - http://www.libtom.net + https://www.libtom.net
Signature · 1 line
2.31.1
Arnout Vandecappelle
AppliedPATCH 3/3 package/libtomcrypt: update home page URL to https
Quoted 3 lines · Peter Seiderer
- update home page URL to https
Signed-off-by Peter Seiderer <[email protected]>
Applied to master, thanks.
Regards,
Arnout
Quoted 15 lines
--- package/libtomcrypt/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/libtomcrypt/Config.in +1
-1@@ -8,4 +8,4 @@ config BR2_PACKAGE_LIBTOMCRYPT functions, chaining modes, pseudo-random number generators, public key cryptography and a plethora of other routines. - http://www.libtom.net + https://www.libtom.net
PATCH 3/3 package/libtomcrypt: update home page URL to https
In reply to Peter SeidererQuoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Peter" == Peter Seiderer <[email protected]> writes:
- update home page URL to https
Signed-off-by Peter Seiderer <[email protected]>
Committed to 2021.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/3 package/libtomcrypt: add pkgconfig support
In reply to Peter SeidererQuoted 1 line · On Mon, 12 Apr 2021 21:55:25 +0200 Peter Seiderer <[email protected]> wrote:
Signed-off-by Peter Seiderer <[email protected]>
Is there any specific motivation? Does this had a chance of going upstream ?
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/3 package/libtomcrypt: add pkgconfig support
Hello Thomas,
Quoted 7 lines · Thomas Petazzoni
Quoted 1 line · On Mon, 12 Apr 2021 21:55:25 +0200 Peter Seiderer <[email protected]> wrote:
Signed-off-by Peter Seiderer <[email protected]>Is there any specific motivation? Does this had a chance of going upstream ?
For an custom project, previously developed on with cmake on ubuntu (which provides the pkgconfig file)....
Can try to suggest upstream...
Regards,
Peter
Quoted 4 lines
Thanks!
Thomas
PATCH 1/3 package/libtomcrypt: add pkgconfig support
Quoted 9 lines · Peter Seiderer
Hello Thomas,
Quoted 5 lines · Thomas Petazzoni
Quoted 1 line · On Mon, 12 Apr 2021 21:55:25 +0200 Peter Seiderer <[email protected]> wrote:
Signed-off-by Peter Seiderer <[email protected]>
Quoted 7 lines
Quoted 2 lines
Is there any specific motivation? Does this had a chance of going upstream ?
For an custom project, previously developed on with cmake on ubuntu (which provides the pkgconfig file)....
Can try to suggest upstream...
Adding a .pc file in Buildroot usually doesn't make much sense, because no
package that depends on it is going to use it. So yes, please organise this upstream.
Therefore, I've marked this patch as Rejected.
Regards,
Arnout
PATCH 1/3 package/libtomcrypt: add pkgconfig support
Hello Arnout,
Quoted 13 lines · Arnout Vandecappelle
Quoted 12 lines · Peter Seiderer
Hello Thomas,
Quoted 7 lines · Thomas Petazzoni
Quoted 1 line · On Mon, 12 Apr 2021 21:55:25 +0200 Peter Seiderer <[email protected]> wrote:
Signed-off-by Peter Seiderer <[email protected]>Is there any specific motivation? Does this had a chance of going upstream ?
Quoted 8 lines
Quoted 4 lines
For an custom project, previously developed on with cmake on ubuntu (which provides the pkgconfig file)....
Can try to suggest upstream...
Adding a .pc file in Buildroot usually doesn't make much sense, because no
package that depends on it is going to use it. So yes, please organise this upstream.
But a buildroot provided library should be usable for buildroot packages AND out-of-tree/custom packages?
Nevertheless, did take a second look at the libtomcrypt sources, already providing a libtomcrypt.pc.in template (but only used/installed in case of 'makefile.shared'/'makefile.unix' and the buildroot compile uses the default 'makefile' one)...
Regards,
Peter
Quoted 5 lines
Therefore, I've marked this patch as Rejected.
Regards,
Arnout
PATCH 1/3 package/libtomcrypt: add pkgconfig support
Quoted 20 lines · Peter Seiderer
Hello Arnout,
Quoted 16 lines · Arnout Vandecappelle
Quoted 15 lines · Peter Seiderer
Hello Thomas,
Quoted 7 lines · Thomas Petazzoni
Quoted 1 line · On Mon, 12 Apr 2021 21:55:25 +0200 Peter Seiderer <[email protected]> wrote:
Signed-off-by Peter Seiderer <[email protected]>Is there any specific motivation? Does this had a chance of going upstream ?
For an custom project, previously developed on with cmake on ubuntu (which provides the pkgconfig file)....
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Can try to suggest upstream...
Adding a .pc file in Buildroot usually doesn't make much sense, because no
package that depends on it is going to use it. So yes, please organise this upstream.But a buildroot provided library should be usable for buildroot packages AND out-of-tree/custom packages?
What I mean is the following. A .pc file is useless unless a package that uses
libtomcrypt actually uses pkg-config to configure it. If the .pc file is not provided by libtomcrypt itself, but only by buildroot, then no package that depends on libtomcrypt is going to use pkg-config, because they "think" there is no .pc file for libtomcrypt. So we would have to patch each and every user of libtomcrypt to use pkg-config instead of whatever discovery mechanism they have. And none of these patches are upstreamable, because there is no .pc file outside of buildroot.
Quoted 4 lines
Nevertheless, did take a second look at the libtomcrypt sources, already providing a libtomcrypt.pc.in template (but only used/installed in case of 'makefile.shared'/'makefile.unix' and the buildroot compile uses the default 'makefile' one)...
That of course changes the story completely.
Do you know if there is a reason for us not to use makefile.unix, so we don't
need to sed the .pc file ourselves?
Regards,
Arnout
Quoted 10 lines
Regards,
PeterQuoted 5 lines
Therefore, I've marked this patch as Rejected.
Regards,
Arnout
PATCH 1/3 package/libtomcrypt: add pkgconfig support
Hello Arnout,
Quoted 45 lines · Arnout Vandecappelle
Quoted 20 lines · Peter Seiderer
Hello Arnout,
Quoted 16 lines · Arnout Vandecappelle
Quoted 15 lines · Peter Seiderer
Hello Thomas,
Quoted 7 lines · Thomas Petazzoni
Quoted 1 line · On Mon, 12 Apr 2021 21:55:25 +0200 Peter Seiderer <[email protected]> wrote:
Signed-off-by Peter Seiderer <[email protected]>Is there any specific motivation? Does this had a chance of going upstream ?
For an custom project, previously developed on with cmake on ubuntu (which provides the pkgconfig file)....
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Can try to suggest upstream...
Adding a .pc file in Buildroot usually doesn't make much sense, because no
package that depends on it is going to use it. So yes, please organise this upstream.But a buildroot provided library should be usable for buildroot packages AND out-of-tree/custom packages?
What I mean is the following. A .pc file is useless unless a package that uses
libtomcrypt actually uses pkg-config to configure it. If the .pc file is not provided by libtomcrypt itself, but only by buildroot, then no package that depends on libtomcrypt is going to use pkg-config, because they "think" there is no .pc file for libtomcrypt. So we would have to patch each and every user of libtomcrypt to use pkg-config instead of whatever discovery mechanism they have. And none of these patches are upstreamable, because there is no .pc file outside of buildroot.Quoted 4 lines
Nevertheless, did take a second look at the libtomcrypt sources, already providing a libtomcrypt.pc.in template (but only used/installed in case of 'makefile.shared'/'makefile.unix' and the buildroot compile uses the default 'makefile' one)...
Quoted 4 lines
That of course changes the story completely.
Do you know if there is a reason for us not to use makefile.unix, so we don't
need to sed the .pc file ourselves?
No..., it is used since the introduction of libtomcrypt (2016), maybe because it is the default or because it uses less/no predefined compile vars which needs to be patched/overwritten...
By the way, libtomcrypt depends on libtommath which used -fPIC unconditionally...
Regards,
Peter
Quoted 18 lines
Regards,
ArnoutQuoted 10 lines
Regards,
PeterQuoted 5 lines
Therefore, I've marked this patch as Rejected.
Regards,
Arnout_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
PATCH 1/3 package/libtomcrypt: add pkgconfig support
Quoted 1 line · Peter Seiderer
By the way, libtomcrypt depends on libtommath which used -fPIC unconditionally...
So, apparently I'm just full of s**t when I say -fPIC sometimes fails in static
builds... Weird, I really *do* remember that...
Ah, here I have it: [1] It doesn't lead to build failures, it's just less
performant and useless in static builds. It turns out, however, that we unconditionally pass -fPIC in dozens of packages. So one more doesn't really hurt I guess.
Regards,
Arnout
[1]
https://patchwork.ozlabs.org/project/buildroot/patch/20210209104726.20132-1-kremneva at synopsys.com/
PATCH 1/3 package/libtomcrypt: add pkgconfig support
Hello Arnout,
Quoted 10 lines · Arnout Vandecappelle
Quoted 1 line · Peter Seiderer
By the way, libtomcrypt depends on libtommath which used -fPIC unconditionally...
So, apparently I'm just full of s**t when I say -fPIC sometimes fails in static
builds... Weird, I really *do* remember that...Ah, here I have it: [1] It doesn't lead to build failures, it's just less
performant and useless in static builds. It turns out, however, that we unconditionally pass -fPIC in dozens of packages. So one more doesn't really hurt I guess.
Thanks for insight, can send (at least) a patch for libtommath to change the -fPIC usage only for the non static case...
Regards,
Peter
Quoted 12 lines
Regards,
Arnout[1]
https://patchwork.ozlabs.org/project/buildroot/patch/20210209104726.20132-1-kremneva at synopsys.com/_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot