openssl: fix static build
authorBenoît Thébaudeau <benoit@wsystem.com>
Tue, 7 Jul 2015 10:37:58 +0000 (12:37 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Thu, 9 Jul 2015 06:54:00 +0000 (08:54 +0200)
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 as
explained in PROBLEMS.

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

[Peter: add reference to PROBLEMS file]
Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/openssl/openssl.mk

index 4068cf1b51d3557a07daacc59a29b9074f0b4d86..37c640dc868e83e4d81e764cfab693d8179655f7 100644 (file)
@@ -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