From ca58207df09caa6f2e40bad09d919f63b7406cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Tue, 7 Jul 2015 12:37:58 +0200 Subject: [PATCH] openssl: fix static build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Peter Korsgaard --- package/openssl/openssl.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/openssl/openssl.mk b/package/openssl/openssl.mk index 4068cf1b51..37c640dc86 100644 --- a/package/openssl/openssl.mk +++ b/package/openssl/openssl.mk @@ -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