Skip to contentSkip to conversation

package/openssl: statically-linked openssl does not provide threads

PATCH In review Bernd Kuhls 2 participants 3 messages Jul 20, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/openssl: statically-linked openssl does not provide threads

Add blind option to mark availability of threads, needed for tor.

---
 package/openssl/Config.in | 6 ++++++
 1 file changed, 6 insertions(+)
package/openssl/Config.in +6 -0
index c7641ecefa..f81ed1a00b 100644
@@ -1,6 +1,9 @@
 config BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL
 	bool
 
+config BR2_PACKAGE_OPENSSL_HAS_THREADS
+	bool
+
 config BR2_PACKAGE_OPENSSL
 	bool "openssl support"
 	select BR2_PACKAGE_HAS_OPENSSL
@@ -17,6 +20,8 @@ choice
 config BR2_PACKAGE_LIBOPENSSL
 	bool "openssl"
 	select BR2_PACKAGE_ZLIB
+	# https://github.com/openssl/openssl/issues/14574#issuecomment-1584122617
+	select BR2_PACKAGE_OPENSSL_HAS_THREADS if !BR2_STATIC_LIBS
 	help
 	  A collaborative effort to develop a robust, commercial-grade,
 	  fully featured, and Open Source toolkit implementing the
@@ -36,6 +41,7 @@ config BR2_PACKAGE_LIBRESSL
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	# uClibc doesn't provide __register_atfork() without NPTL
 	depends on !BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	select BR2_PACKAGE_OPENSSL_HAS_THREADS
 	help
 	  LibreSSL is a version of the TLS/crypto stack forked from
 	  OpenSSL in 2014, with goals of modernizing the codebase,
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 package/tor: needs openssl with threads

Fixes:
http://autobuild.buildroot.net/results/b8e/b8efae5bf6ac3b51e8443951ef1dd88824af3f2b/

---
 package/tor/Config.in | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
package/tor/Config.in +5 -1
index 52009267e2..de35c34492 100644
@@ -2,8 +2,8 @@ config BR2_PACKAGE_TOR
 	bool "tor"
 	depends on BR2_USE_MMU # fork()
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	depends on BR2_PACKAGE_OPENSSL_HAS_THREADS
 	select BR2_PACKAGE_LIBEVENT
-	select BR2_PACKAGE_OPENSSL
 	select BR2_PACKAGE_ZLIB
 	help
 	  Tor is free software and an open network that helps you
@@ -17,3 +17,7 @@ config BR2_PACKAGE_TOR
 comment "tor needs a toolchain w/ NPTL"
 	depends on BR2_USE_MMU
 	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL
+
+comment "tor needs a thread-enabled openssl library (libressl or dynamically-linked openssl)"
+	depends on BR2_USE_MMU
+	depends on !BR2_PACKAGE_OPENSSL_HAS_THREADS
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Bernd Kuhls
Quoted 6 lines · On Thu, 20 Jul 2023 19:53:18 +0200 Bernd Kuhls <[email protected]> wrote:

Add blind option to mark availability of threads, needed for tor.

---
 package/openssl/Config.in | 6 ++++++
 1 file changed, 6 insertions(+)

Meh, I don't like this very much :-/ But I admit I don't (at this time) have a much better proposal. Reverting the problematic change from OpenSSL? But wait, according to the issue you're pointing
(https://github.com/openssl/openssl/issues/14574), it's an OpenSSL 1.1.x issue that won't be fixed because OpenSSL 1.1.x is in maintenance mode only. But now we're using OpenSSL 3.x so surely this issue needs to be fixed? If that's the case, a revert of the change seems in order for now?

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot