From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Petazzoni Date: Mon, 25 Aug 2014 23:03:56 +0200 Subject: [Buildroot] [PATCH 3/3] package/libarchive: fix linking issue with uClibc In-Reply-To: <1408899186-28542-3-git-send-email-romain.naour@openwide.fr> References: <1408899186-28542-1-git-send-email-romain.naour@openwide.fr> <1408899186-28542-3-git-send-email-romain.naour@openwide.fr> Message-ID: <20140825230356.7bebde3b@free-electrons.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Dear Romain Naour, On Sun, 24 Aug 2014 18:53:06 +0200, Romain Naour wrote: > With uClibc the dynamic linking loader functions needs > to be linked with -ldl > > Fixes: > http://autobuild.buildroot.net/results/6af/6af140618b274536238b062635d493709905c8f6/build-end.log > > Signed-off-by: Romain Naour > --- > package/libarchive/libarchive.mk | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/package/libarchive/libarchive.mk b/package/libarchive/libarchive.mk > index 8c6951d..ce3355c 100644 > --- a/package/libarchive/libarchive.mk > +++ b/package/libarchive/libarchive.mk > @@ -68,4 +68,8 @@ else > LIBARCHIVE_CONF_OPT += --without-zlib > endif > > +ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y) > +LIBARCHIVE_CONF_ENV += LIBS="-ldl" > +endif > + > $(eval $(autotools-package)) I don't think this is the right fix, for several reasons: *) The problem only occurs due to the fact that bsdcpio and bsdtar are by default linked statically. When BR2_PREFER_STATIC_LIB is disabled, we should pass --enable-bsdtar=shared and --enable-bsdcpio=shared to ensure they are dynamically linked. This fixes the problem in the dynamic linking case. *) The problem is caused by the dependency of OpenSSL on libdl. So there is no need to always link against libdl: it should only be done when BR2_PREFER_STATIC_LIB=y and OpenSSL is enabled. *) I don't see why the problem would be uClibc specific. Generally speaking, it's annoying to have to teach all packages using OpenSSL that they should link against -ldl when doing static linking. It would be so much better if everyone was using pkg-config... Best regards, Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com