Skip to contentSkip to conversation

openssl: fix static build

PATCH New Benoît Thébaudeau 2 participants 2 messages Jul 7, 2015 – Jul 9, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openssl: fix static build

If configured with no-dso, the openssl binary still gets linked with -ldl, while libdl is not available for static-only builds. The OpenSSL framework does not support automatically dropping -ldl with no-dso, so -ldl has to be removed from Makefile after calling ./Configure.

Fixes http://autobuild.buildroot.org/results/cbb35f2582f1cfeb3d11cb4952a80784ff660baf

---
 package/openssl/openssl.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/openssl/openssl.mk +8 -0
index 4068cf1..37c640d 100644
@@ -90,6 +90,14 @@ define OPENSSL_CONFIGURE_CMDS
 	$(SED) "s: build_tests::" $(@D)/Makefile
 endef
 
+# libdl is not available in a static build, and this is not implied by no-dso
+ifeq ($(BR2_STATIC_LIBS),y)
+define OPENSSL_FIXUP_STATIC_MAKEFILE
+	$(SED) 's/-ldl//g' $(@D)/Makefile
+endef
+OPENSSL_POST_CONFIGURE_HOOKS += OPENSSL_FIXUP_STATIC_MAKEFILE
+endif
+
 define HOST_OPENSSL_BUILD_CMDS
 	$(MAKE1) -C $(@D)
 endef
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 openssl: fix static build

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Beno?t" == Beno?t Th?baudeau <[email protected]> writes:

If configured with no-dso, the openssl binary still gets linked with -ldl, while libdl is not available for static-only builds. The OpenSSL framework does not support automatically dropping -ldl with no-dso, so -ldl has to be removed from Makefile after calling ./Configure.

Fixes http://autobuild.buildroot.org/results/cbb35f2582f1cfeb3d11cb4952a80784ff660baf

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard