diff mbox series

[1/1] package/libopenssl: fix configure option for libatomic

Message ID 20230725185004.3276758-1-bernd@kuhls.net
State Accepted
Headers show
Series [1/1] package/libopenssl: fix configure option for libatomic | expand

Commit Message

Bernd Kuhls July 25, 2023, 6:50 p.m. UTC
Without this patch openssl adds -latomic twice to Libs.private in
libcrypto.pc:

cat output/per-package/opensc/host/arceb-buildroot-linux-uclibc/sysroot/usr/lib/pkgconfig/libcrypto.pc | grep atomic
Libs.private: -ldl -pthread -latomic -latomic

Instead of passing -latomic to Configure we use the target arch
"linux-latomic" which is provided by upstream since version 3.0.0
especially for libatomic handling:
https://github.com/openssl/openssl/commit/535130c39d33df41b6a7d14302a93ffaa10ebc46
https://github.com/openssl/openssl/commit/cdf2986a70d92668d882eb29737225f1aaafd0f1

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
Build-tested using this defconfig

BR2_PACKAGE_OPENSSL=y
BR2_PACKAGE_LIBOPENSSL_BIN=y

                             arm-aarch64 [ 1/45]: OK
                   bootlin-aarch64-glibc [ 2/45]: OK
               bootlin-arcle-hs38-uclibc [ 3/45]: OK
                    bootlin-armv5-uclibc [ 4/45]: OK
                     bootlin-armv7-glibc [ 5/45]: OK
                   bootlin-armv7m-uclibc [ 6/45]: FAILED
                      bootlin-armv7-musl [ 7/45]: OK
                bootlin-m68k-5208-uclibc [ 8/45]: FAILED
               bootlin-m68k-68040-uclibc [ 9/45]: OK
             bootlin-microblazeel-uclibc [10/45]: OK
                bootlin-mipsel32r6-glibc [11/45]: OK
                   bootlin-mipsel-uclibc [12/45]: OK
                     bootlin-nios2-glibc [13/45]: OK
                 bootlin-openrisc-uclibc [14/45]: OK
        bootlin-powerpc64le-power8-glibc [15/45]: OK
           bootlin-powerpc-e500mc-uclibc [16/45]: OK
                   bootlin-riscv32-glibc [17/45]: OK
                   bootlin-riscv64-glibc [18/45]: OK
                    bootlin-riscv64-musl [19/45]: OK
                 bootlin-s390x-z13-glibc [20/45]: OK
                      bootlin-sh4-uclibc [21/45]: OK
                   bootlin-sparc64-glibc [22/45]: OK
                    bootlin-sparc-uclibc [23/45]: OK
                    bootlin-x86-64-glibc [24/45]: OK
                     bootlin-x86-64-musl [25/45]: OK
                   bootlin-x86-64-uclibc [26/45]: OK
                   bootlin-xtensa-uclibc [27/45]: OK
                            br-arm-basic [28/45]: OK
                    br-arm-full-nothread [29/45]: OK
                      br-arm-full-static [30/45]: OK
                   br-i386-pentium4-full [31/45]: OK
                br-i386-pentium-mmx-musl [32/45]: OK
                      br-mips64-n64-full [33/45]: OK
                 br-mips64r6-el-hf-glibc [34/45]: OK
               br-powerpc-603e-basic-cpp [35/45]: OK
               br-powerpc64-power7-glibc [36/45]: OK
                       linaro-aarch64-be [37/45]: OK
                          linaro-aarch64 [38/45]: OK
                              linaro-arm [39/45]: OK
                     sourcery-arm-armv4t [40/45]: OK
                            sourcery-arm [41/45]: OK
                     sourcery-arm-thumb2 [42/45]: OK
                         sourcery-mips64 [43/45]: OK
                           sourcery-mips [44/45]: OK
                          sourcery-nios2 [45/45]: OK
45 builds, 0 skipped, 2 build failed, 0 legal-info failed, 0 show-info failed

Reported the two unrelated build errors:
https://bugs.busybox.net/show_bug.cgi?id=15709

 package/libopenssl/Config.in     | 1 +
 package/libopenssl/libopenssl.mk | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

Comments

Yann E. MORIN July 25, 2023, 7:42 p.m. UTC | #1
Bernd, All,

On 2023-07-25 20:50 +0200, Bernd Kuhls spake thusly:
> Without this patch openssl adds -latomic twice to Libs.private in
> libcrypto.pc:
> 
> cat output/per-package/opensc/host/arceb-buildroot-linux-uclibc/sysroot/usr/lib/pkgconfig/libcrypto.pc | grep atomic
> Libs.private: -ldl -pthread -latomic -latomic

This is not fixing an actual build failure, but is really just a cleanup
fix, right?

> Instead of passing -latomic to Configure we use the target arch
> "linux-latomic" which is provided by upstream since version 3.0.0
> especially for libatomic handling:
> https://github.com/openssl/openssl/commit/535130c39d33df41b6a7d14302a93ffaa10ebc46
> https://github.com/openssl/openssl/commit/cdf2986a70d92668d882eb29737225f1aaafd0f1
> 
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
> ---
> Build-tested using this defconfig
> BR2_PACKAGE_OPENSSL=y
> BR2_PACKAGE_LIBOPENSSL_BIN=y
>                    bootlin-armv7m-uclibc [ 6/45]: FAILED
>                 bootlin-m68k-5208-uclibc [ 8/45]: FAILED
> Reported the two unrelated build errors:
> https://bugs.busybox.net/show_bug.cgi?id=15709

Those two are not a regression, they already failed to build before this
patch, but the phrasing was a bit ambiguoug, so I had to check...

If you can confirm that this is just a cleanup fix, then no need to
respin, I'll amend the comit log when applying.

Regards,
Yann E. MORIN.

> 
>  package/libopenssl/Config.in     | 1 +
>  package/libopenssl/libopenssl.mk | 1 -
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/libopenssl/Config.in b/package/libopenssl/Config.in
> index 26c8f4c085..fdfa135f52 100644
> --- a/package/libopenssl/Config.in
> +++ b/package/libopenssl/Config.in
> @@ -26,6 +26,7 @@ config BR2_PACKAGE_LIBOPENSSL_TARGET_ARCH
>  	# linux-generic{32,64}, see
>  	# https://github.com/openssl/openssl/issues/9839
>  	default "linux-generic64 no-asm"	if BR2_ARCH_IS_64 && !BR2_MIPS_NABI32
> +	default "linux-latomic no-asm"		if BR2_TOOLCHAIN_HAS_LIBATOMIC
>  	default "linux-generic32 no-asm"
>  
>  config BR2_PACKAGE_LIBOPENSSL_BIN
> diff --git a/package/libopenssl/libopenssl.mk b/package/libopenssl/libopenssl.mk
> index 06eac8f3d9..41626d20e1 100644
> --- a/package/libopenssl/libopenssl.mk
> +++ b/package/libopenssl/libopenssl.mk
> @@ -73,7 +73,6 @@ define LIBOPENSSL_CONFIGURE_CMDS
>  			$(LIBOPENSSL_TARGET_ARCH) \
>  			--prefix=/usr \
>  			--openssldir=/etc/ssl \
> -			$(if $(BR2_TOOLCHAIN_HAS_LIBATOMIC),-latomic) \
>  			$(if $(BR2_TOOLCHAIN_HAS_THREADS),threads,no-threads) \
>  			$(if $(BR2_STATIC_LIBS),no-shared,shared) \
>  			$(if $(BR2_PACKAGE_CRYPTODEV_LINUX),enable-devcryptoeng) \
> -- 
> 2.39.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
Bernd Kuhls July 25, 2023, 8:15 p.m. UTC | #2
Hi Yann,

> This is not fixing an actual build failure, but is really just a cleanup
> fix, right?

yes, its only a cleanup, it does not fix any bug/build error.

Regards, Bernd
Yann E. MORIN July 25, 2023, 8:48 p.m. UTC | #3
Bernd, All,

On 2023-07-25 20:50 +0200, Bernd Kuhls spake thusly:
> Without this patch openssl adds -latomic twice to Libs.private in
> libcrypto.pc:
> 
> cat output/per-package/opensc/host/arceb-buildroot-linux-uclibc/sysroot/usr/lib/pkgconfig/libcrypto.pc | grep atomic
> Libs.private: -ldl -pthread -latomic -latomic
> 
> Instead of passing -latomic to Configure we use the target arch
> "linux-latomic" which is provided by upstream since version 3.0.0
> especially for libatomic handling:
> https://github.com/openssl/openssl/commit/535130c39d33df41b6a7d14302a93ffaa10ebc46
> https://github.com/openssl/openssl/commit/cdf2986a70d92668d882eb29737225f1aaafd0f1
> 
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
> Build-tested using this defconfig
> 
> BR2_PACKAGE_OPENSSL=y
> BR2_PACKAGE_LIBOPENSSL_BIN=y
> 
>                              arm-aarch64 [ 1/45]: OK
>                    bootlin-aarch64-glibc [ 2/45]: OK
>                bootlin-arcle-hs38-uclibc [ 3/45]: OK
>                     bootlin-armv5-uclibc [ 4/45]: OK
>                      bootlin-armv7-glibc [ 5/45]: OK
>                    bootlin-armv7m-uclibc [ 6/45]: FAILED
>                       bootlin-armv7-musl [ 7/45]: OK
>                 bootlin-m68k-5208-uclibc [ 8/45]: FAILED
>                bootlin-m68k-68040-uclibc [ 9/45]: OK
>              bootlin-microblazeel-uclibc [10/45]: OK
>                 bootlin-mipsel32r6-glibc [11/45]: OK
>                    bootlin-mipsel-uclibc [12/45]: OK
>                      bootlin-nios2-glibc [13/45]: OK
>                  bootlin-openrisc-uclibc [14/45]: OK
>         bootlin-powerpc64le-power8-glibc [15/45]: OK
>            bootlin-powerpc-e500mc-uclibc [16/45]: OK
>                    bootlin-riscv32-glibc [17/45]: OK
>                    bootlin-riscv64-glibc [18/45]: OK
>                     bootlin-riscv64-musl [19/45]: OK
>                  bootlin-s390x-z13-glibc [20/45]: OK
>                       bootlin-sh4-uclibc [21/45]: OK
>                    bootlin-sparc64-glibc [22/45]: OK
>                     bootlin-sparc-uclibc [23/45]: OK
>                     bootlin-x86-64-glibc [24/45]: OK
>                      bootlin-x86-64-musl [25/45]: OK
>                    bootlin-x86-64-uclibc [26/45]: OK
>                    bootlin-xtensa-uclibc [27/45]: OK
>                             br-arm-basic [28/45]: OK
>                     br-arm-full-nothread [29/45]: OK
>                       br-arm-full-static [30/45]: OK
>                    br-i386-pentium4-full [31/45]: OK
>                 br-i386-pentium-mmx-musl [32/45]: OK
>                       br-mips64-n64-full [33/45]: OK
>                  br-mips64r6-el-hf-glibc [34/45]: OK
>                br-powerpc-603e-basic-cpp [35/45]: OK
>                br-powerpc64-power7-glibc [36/45]: OK
>                        linaro-aarch64-be [37/45]: OK
>                           linaro-aarch64 [38/45]: OK
>                               linaro-arm [39/45]: OK
>                      sourcery-arm-armv4t [40/45]: OK
>                             sourcery-arm [41/45]: OK
>                      sourcery-arm-thumb2 [42/45]: OK
>                          sourcery-mips64 [43/45]: OK
>                            sourcery-mips [44/45]: OK
>                           sourcery-nios2 [45/45]: OK
> 45 builds, 0 skipped, 2 build failed, 0 legal-info failed, 0 show-info failed
> 
> Reported the two unrelated build errors:
> https://bugs.busybox.net/show_bug.cgi?id=15709
> 
>  package/libopenssl/Config.in     | 1 +
>  package/libopenssl/libopenssl.mk | 1 -
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/libopenssl/Config.in b/package/libopenssl/Config.in
> index 26c8f4c085..fdfa135f52 100644
> --- a/package/libopenssl/Config.in
> +++ b/package/libopenssl/Config.in
> @@ -26,6 +26,7 @@ config BR2_PACKAGE_LIBOPENSSL_TARGET_ARCH
>  	# linux-generic{32,64}, see
>  	# https://github.com/openssl/openssl/issues/9839
>  	default "linux-generic64 no-asm"	if BR2_ARCH_IS_64 && !BR2_MIPS_NABI32
> +	default "linux-latomic no-asm"		if BR2_TOOLCHAIN_HAS_LIBATOMIC
>  	default "linux-generic32 no-asm"
>  
>  config BR2_PACKAGE_LIBOPENSSL_BIN
> diff --git a/package/libopenssl/libopenssl.mk b/package/libopenssl/libopenssl.mk
> index 06eac8f3d9..41626d20e1 100644
> --- a/package/libopenssl/libopenssl.mk
> +++ b/package/libopenssl/libopenssl.mk
> @@ -73,7 +73,6 @@ define LIBOPENSSL_CONFIGURE_CMDS
>  			$(LIBOPENSSL_TARGET_ARCH) \
>  			--prefix=/usr \
>  			--openssldir=/etc/ssl \
> -			$(if $(BR2_TOOLCHAIN_HAS_LIBATOMIC),-latomic) \
>  			$(if $(BR2_TOOLCHAIN_HAS_THREADS),threads,no-threads) \
>  			$(if $(BR2_STATIC_LIBS),no-shared,shared) \
>  			$(if $(BR2_PACKAGE_CRYPTODEV_LINUX),enable-devcryptoeng) \
> -- 
> 2.39.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
diff mbox series

Patch

diff --git a/package/libopenssl/Config.in b/package/libopenssl/Config.in
index 26c8f4c085..fdfa135f52 100644
--- a/package/libopenssl/Config.in
+++ b/package/libopenssl/Config.in
@@ -26,6 +26,7 @@  config BR2_PACKAGE_LIBOPENSSL_TARGET_ARCH
 	# linux-generic{32,64}, see
 	# https://github.com/openssl/openssl/issues/9839
 	default "linux-generic64 no-asm"	if BR2_ARCH_IS_64 && !BR2_MIPS_NABI32
+	default "linux-latomic no-asm"		if BR2_TOOLCHAIN_HAS_LIBATOMIC
 	default "linux-generic32 no-asm"
 
 config BR2_PACKAGE_LIBOPENSSL_BIN
diff --git a/package/libopenssl/libopenssl.mk b/package/libopenssl/libopenssl.mk
index 06eac8f3d9..41626d20e1 100644
--- a/package/libopenssl/libopenssl.mk
+++ b/package/libopenssl/libopenssl.mk
@@ -73,7 +73,6 @@  define LIBOPENSSL_CONFIGURE_CMDS
 			$(LIBOPENSSL_TARGET_ARCH) \
 			--prefix=/usr \
 			--openssldir=/etc/ssl \
-			$(if $(BR2_TOOLCHAIN_HAS_LIBATOMIC),-latomic) \
 			$(if $(BR2_TOOLCHAIN_HAS_THREADS),threads,no-threads) \
 			$(if $(BR2_STATIC_LIBS),no-shared,shared) \
 			$(if $(BR2_PACKAGE_CRYPTODEV_LINUX),enable-devcryptoeng) \