* [Buildroot] [PATCH 1/3] package/libopenssl: remove deprecated options
@ 2023-07-21 18:06 Bernd Kuhls
2023-07-21 18:06 ` [Buildroot] [PATCH 2/3] package/libopenssl: add -latomic to libcrypto.pc when needed Bernd Kuhls
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Bernd Kuhls @ 2023-07-21 18:06 UTC (permalink / raw)
To: buildroot
Fixes configure warning:
***** Deprecated options: no-crypto-mdebug-backtrace, no-ssl2
no-ssl2 option was re-added in 2016:
https://github.com/openssl/openssl/commit/e80381e1a3309f5d4a783bcaa508a90187a48882
"We warn that it's deprecated, and ignore it otherwise."
Quoting https://www.openssl.org/docs/man3.0/man3/SSLv23_method.html
"Support for SSLv2 [... was] removed in OpenSSL 1.1.0."
Therefore we do not need any legacy handling for
BR2_PACKAGE_LIBOPENSSL_ENABLE_SSL2.
no-crypto-mdebug-backtrace was removed in OpenSSL 3.0:
https://github.com/openssl/openssl/blob/master/NEWS.md?plain=1#L161
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
package/libopenssl/Config.in | 4 ----
package/libopenssl/libopenssl.mk | 3 +--
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/package/libopenssl/Config.in b/package/libopenssl/Config.in
index 7a3f56a512..26c8f4c085 100644
--- a/package/libopenssl/Config.in
+++ b/package/libopenssl/Config.in
@@ -97,10 +97,6 @@ config BR2_PACKAGE_LIBOPENSSL_ENABLE_SSL
bool "enable SSL"
default y
-config BR2_PACKAGE_LIBOPENSSL_ENABLE_SSL2
- bool "enable SSL2"
- default y
-
config BR2_PACKAGE_LIBOPENSSL_ENABLE_SSL3
bool "enable SSL3"
default y
diff --git a/package/libopenssl/libopenssl.mk b/package/libopenssl/libopenssl.mk
index 7a4e0dfca2..06eac8f3d9 100644
--- a/package/libopenssl/libopenssl.mk
+++ b/package/libopenssl/libopenssl.mk
@@ -97,12 +97,11 @@ define LIBOPENSSL_CONFIGURE_CMDS
$(if $(BR2_PACKAGE_LIBOPENSSL_ENABLE_WHIRLPOOL),,no-whirlpool) \
$(if $(BR2_PACKAGE_LIBOPENSSL_ENABLE_BLOWFISH),,no-bf) \
$(if $(BR2_PACKAGE_LIBOPENSSL_ENABLE_SSL),,no-ssl) \
- $(if $(BR2_PACKAGE_LIBOPENSSL_ENABLE_SSL2),,no-ssl2) \
$(if $(BR2_PACKAGE_LIBOPENSSL_ENABLE_SSL3),,no-ssl3) \
$(if $(BR2_PACKAGE_LIBOPENSSL_ENABLE_WEAK_SSL),,no-weak-ssl-ciphers) \
$(if $(BR2_PACKAGE_LIBOPENSSL_ENABLE_PSK),,no-psk) \
$(if $(BR2_PACKAGE_LIBOPENSSL_ENABLE_CAST),,no-cast) \
- $(if $(BR2_PACKAGE_LIBOPENSSL_UNSECURE),,no-unit-test no-crypto-mdebug-backtrace no-crypto-mdebug no-autoerrinit) \
+ $(if $(BR2_PACKAGE_LIBOPENSSL_UNSECURE),,no-unit-test no-crypto-mdebug no-autoerrinit) \
$(if $(BR2_PACKAGE_LIBOPENSSL_DYNAMIC_ENGINE),,no-dynamic-engine ) \
$(if $(BR2_PACKAGE_LIBOPENSSL_ENABLE_COMP),,no-comp) \
$(if $(BR2_STATIC_LIBS),zlib,zlib-dynamic) \
--
2.39.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 2/3] package/libopenssl: add -latomic to libcrypto.pc when needed
2023-07-21 18:06 [Buildroot] [PATCH 1/3] package/libopenssl: remove deprecated options Bernd Kuhls
@ 2023-07-21 18:06 ` Bernd Kuhls
2023-07-21 21:04 ` Thomas Petazzoni via buildroot
2023-07-21 18:06 ` [Buildroot] [PATCH 3/3] package/libopenssl: enable threads on static builds Bernd Kuhls
2023-07-21 21:02 ` [Buildroot] [PATCH 1/3] package/libopenssl: remove deprecated options Thomas Petazzoni via buildroot
2 siblings, 1 reply; 5+ messages in thread
From: Bernd Kuhls @ 2023-07-21 18:06 UTC (permalink / raw)
To: buildroot
Without this patch openssl adds -latomic only to Libs.private in
libcrypto.pc.
Instead of passing -latomic to Configure we use the target arch
"linux-latomic" which is provided by upstream especially for libatomic
handling and add $LIB_ATOMIC_LIBS to be used for creating libcrypto.pc.
Fixes:
http://autobuild.buildroot.net/results/fb4/fb4c6a97ac666a3a75345229a320769df6c0a909/
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
...-latomic-to-libcrypto.pc-when-needed.patch | 87 +++++++++++++++++++
package/libopenssl/Config.in | 1 +
package/libopenssl/libopenssl.mk | 1 -
3 files changed, 88 insertions(+), 1 deletion(-)
create mode 100644 package/libopenssl/0005-Add-latomic-to-libcrypto.pc-when-needed.patch
diff --git a/package/libopenssl/0005-Add-latomic-to-libcrypto.pc-when-needed.patch b/package/libopenssl/0005-Add-latomic-to-libcrypto.pc-when-needed.patch
new file mode 100644
index 0000000000..180755434a
--- /dev/null
+++ b/package/libopenssl/0005-Add-latomic-to-libcrypto.pc-when-needed.patch
@@ -0,0 +1,87 @@
+From f403579bb85c293d4b469b70dadb2865e17e5ebe Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <bernd@kuhls.net>
+Date: Fri, 21 Jul 2023 18:37:34 +0200
+Subject: [PATCH] Add -latomic to libcrypto.pc when needed
+
+Upstream: https://github.com/openssl/openssl/pull/21521
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ Configurations/10-main.conf | 3 +++
+ Configurations/unix-Makefile.tmpl | 5 ++++-
+ Configure | 1 +
+ 3 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
+index 8010087b46..c4102e6adb 100644
+--- a/Configurations/10-main.conf
++++ b/Configurations/10-main.conf
+@@ -701,6 +701,7 @@ my %targets = (
+ },
+ "linux-latomic" => {
+ inherit_from => [ "linux-generic32" ],
++ atomic_libs => threads("-latomic"),
+ ex_libs => add(threads("-latomic")),
+ },
+ "linux-generic64" => {
+@@ -864,6 +865,7 @@ my %targets = (
+ inherit_from => [ "linux-x86" ],
+ CC => "clang",
+ CXX => "clang++",
++ atomic_libs => threads("-latomic"),
+ ex_libs => add(threads("-latomic")),
+ },
+ "linux-x86_64" => {
+@@ -959,6 +961,7 @@ my %targets = (
+ cflags => add("-m64 -mcpu=ultrasparc"),
+ cxxflags => add("-m64 -mcpu=ultrasparc"),
+ lib_cppflags => add("-DB_ENDIAN"),
++ atomic_libs => threads("-latomic"),
+ ex_libs => add(threads("-latomic")),
+ bn_ops => "BN_LLONG RC4_CHAR",
+ asm_arch => 'sparcv9',
+diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
+index 17e194f1ef..b7783cd536 100644
+--- a/Configurations/unix-Makefile.tmpl
++++ b/Configurations/unix-Makefile.tmpl
+@@ -382,6 +382,8 @@ CNF_CXXFLAGS={- join(' ', $target{cxxflags} || (),
+ @{$config{cxxflags}}) -}
+ CNF_LDFLAGS={- join(' ', $target{lflags} || (),
+ @{$config{lflags}}) -}
++CNF_ATOMIC_LIBS={- join(' ', $target{atomic_libs} || (),
++ @{$config{atomic_libs}}) -}
+ CNF_EX_LIBS={- join(' ', $target{ex_libs} || (),
+ @{$config{ex_libs}}) -}
+
+@@ -425,6 +427,7 @@ LIB_CXXFLAGS={- join(' ', $target{lib_cxxflags} || (),
+ LIB_LDFLAGS={- join(' ', $target{shared_ldflag} || (),
+ $config{shared_ldflag} || (),
+ '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
++LIB_ATOMIC_LIBS=$(CNF_ATOMIC_LIBS) $(ATOMIC_LIBS)
+ LIB_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
+ DSO_CPPFLAGS={- join(' ', $target{dso_cppflags} || (),
+ $target{module_cppflags} || (),
+@@ -1406,7 +1409,7 @@ libcrypto.pc:
+ echo 'Name: OpenSSL-libcrypto'; \
+ echo 'Description: OpenSSL cryptography library'; \
+ echo 'Version: '$(VERSION); \
+- echo 'Libs: -L$${libdir} -lcrypto'; \
++ echo 'Libs: -L$${libdir} -lcrypto $(LIB_ATOMIC_LIBS)'; \
+ echo 'Libs.private: $(LIB_EX_LIBS)'; \
+ echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
+
+diff --git a/Configure b/Configure
+index dd06aa4898..5009495804 100755
+--- a/Configure
++++ b/Configure
+@@ -3307,6 +3307,7 @@ sub print_table_entry
+ "ld",
+ "lflags",
+ "loutflag",
++ "atomic_libs",
+ "ex_libs",
+ "bn_ops",
+ "enable",
+--
+2.39.2
+
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 3/3] package/libopenssl: enable threads on static builds
2023-07-21 18:06 [Buildroot] [PATCH 1/3] package/libopenssl: remove deprecated options Bernd Kuhls
2023-07-21 18:06 ` [Buildroot] [PATCH 2/3] package/libopenssl: add -latomic to libcrypto.pc when needed Bernd Kuhls
@ 2023-07-21 18:06 ` Bernd Kuhls
2023-07-21 21:02 ` [Buildroot] [PATCH 1/3] package/libopenssl: remove deprecated options Thomas Petazzoni via buildroot
2 siblings, 0 replies; 5+ messages in thread
From: Bernd Kuhls @ 2023-07-21 18:06 UTC (permalink / raw)
To: buildroot
Revert upstream commit as proposed on the upstream bugtracker.
Fixes:
http://autobuild.buildroot.net/results/b8e/b8efae5bf6ac3b51e8443951ef1dd88824af3f2b/
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
.../0006-Revert-Fix-static-builds.patch | 43 +++++++++++++++++++
1 file changed, 43 insertions(+)
create mode 100644 package/libopenssl/0006-Revert-Fix-static-builds.patch
diff --git a/package/libopenssl/0006-Revert-Fix-static-builds.patch b/package/libopenssl/0006-Revert-Fix-static-builds.patch
new file mode 100644
index 0000000000..2bc0b961eb
--- /dev/null
+++ b/package/libopenssl/0006-Revert-Fix-static-builds.patch
@@ -0,0 +1,43 @@
+From 847a7b744e31b9f57d2a3de495187db1dc0ee6d7 Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <bernd@kuhls.net>
+Date: Fri, 21 Jul 2023 19:30:40 +0200
+Subject: [PATCH] Revert "Fix -static builds"
+
+This reverts commit cfd7225fbb9507b2e443a494459bdaab5236d29d.
+
+Upstream: https://github.com/openssl/openssl/issues/14574#issuecomment-817209126
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ Configure | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Configure b/Configure
+index 2c17f4186b..94cab4c3c4 100755
+--- a/Configure
++++ b/Configure
+@@ -1438,10 +1438,6 @@ foreach (keys %useradd) {
+ # At this point, we can forget everything about %user and %useradd,
+ # because it's now all been merged into the corresponding $config entry
+
+-if (grep { $_ =~ /(?:^|\s)-static(?:\s|$)/ } @{$config{LDFLAGS}}) {
+- disable('static', 'pic', 'threads');
+-}
+-
+ # Allow overriding the build file name
+ $config{build_file} = env('BUILDFILE') || $target{build_file} || "Makefile";
+
+@@ -1728,6 +1724,10 @@ if ($strict_warnings)
+ }
+ }
+
++if (grep { $_ =~ /(?:^|\s)-static(?:\s|$)/ } @{$config{LDFLAGS}}) {
++ disable('static', 'pic', 'threads');
++}
++
+ $config{CFLAGS} = [ map { $_ eq '--ossl-strict-warnings'
+ ? @strict_warnings_collection
+ : ( $_ ) }
+--
+2.39.2
+
--
2.39.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Buildroot] [PATCH 1/3] package/libopenssl: remove deprecated options
2023-07-21 18:06 [Buildroot] [PATCH 1/3] package/libopenssl: remove deprecated options Bernd Kuhls
2023-07-21 18:06 ` [Buildroot] [PATCH 2/3] package/libopenssl: add -latomic to libcrypto.pc when needed Bernd Kuhls
2023-07-21 18:06 ` [Buildroot] [PATCH 3/3] package/libopenssl: enable threads on static builds Bernd Kuhls
@ 2023-07-21 21:02 ` Thomas Petazzoni via buildroot
2 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-07-21 21:02 UTC (permalink / raw)
To: Bernd Kuhls; +Cc: buildroot
On Fri, 21 Jul 2023 20:06:36 +0200
Bernd Kuhls <bernd@kuhls.net> wrote:
> Fixes configure warning:
> ***** Deprecated options: no-crypto-mdebug-backtrace, no-ssl2
>
> no-ssl2 option was re-added in 2016:
> https://github.com/openssl/openssl/commit/e80381e1a3309f5d4a783bcaa508a90187a48882
> "We warn that it's deprecated, and ignore it otherwise."
> Quoting https://www.openssl.org/docs/man3.0/man3/SSLv23_method.html
> "Support for SSLv2 [... was] removed in OpenSSL 1.1.0."
> Therefore we do not need any legacy handling for
> BR2_PACKAGE_LIBOPENSSL_ENABLE_SSL2.
>
> no-crypto-mdebug-backtrace was removed in OpenSSL 3.0:
> https://github.com/openssl/openssl/blob/master/NEWS.md?plain=1#L161
>
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
> ---
> package/libopenssl/Config.in | 4 ----
> package/libopenssl/libopenssl.mk | 3 +--
> 2 files changed, 1 insertion(+), 6 deletions(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Buildroot] [PATCH 2/3] package/libopenssl: add -latomic to libcrypto.pc when needed
2023-07-21 18:06 ` [Buildroot] [PATCH 2/3] package/libopenssl: add -latomic to libcrypto.pc when needed Bernd Kuhls
@ 2023-07-21 21:04 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-07-21 21:04 UTC (permalink / raw)
To: Bernd Kuhls; +Cc: buildroot
Hello Bernd,
On Fri, 21 Jul 2023 20:06:37 +0200
Bernd Kuhls <bernd@kuhls.net> wrote:
> Without this patch openssl adds -latomic only to Libs.private in
> libcrypto.pc.
But this is exactly what's needed. If you add -latomic to Libs: it
means that libraries linking against openssl will also be linked with
libatomic, which is not needed. Libs.private ensures this will only
happen if we're static linking, which is what we want.
Let me sum up:
- With dynamic linking, we want libcrypto.so to be linked against
libatomic.so. Anything linking against libcrypto.so has nothing to do.
- With static linking, anyone linking against libcrypto.a will need to
link against libatomic.a as well, which is why it's important for
libcrypto.pc to carry a Libs.private: -latomic.
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-07-21 21:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-21 18:06 [Buildroot] [PATCH 1/3] package/libopenssl: remove deprecated options Bernd Kuhls
2023-07-21 18:06 ` [Buildroot] [PATCH 2/3] package/libopenssl: add -latomic to libcrypto.pc when needed Bernd Kuhls
2023-07-21 21:04 ` Thomas Petazzoni via buildroot
2023-07-21 18:06 ` [Buildroot] [PATCH 3/3] package/libopenssl: enable threads on static builds Bernd Kuhls
2023-07-21 21:02 ` [Buildroot] [PATCH 1/3] package/libopenssl: remove deprecated options Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox