From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0] ident=Debian-exim) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1YRGsZ-0007Es-Rb for ptxdist@pengutronix.de; Fri, 27 Feb 2015 10:06:39 +0100 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1YRGsZ-0001Gl-Ps for ptxdist@pengutronix.de; Fri, 27 Feb 2015 10:06:39 +0100 Date: Fri, 27 Feb 2015 10:06:39 +0100 From: Michael Olbrich Message-ID: <20150227090639.GB14430@pengutronix.de> References: <1E9AED858BEB204B9DE4F807C7ED0EF617CDD326@EMSRVWIN2934.apps.edc.thyssenkrupp.com> <20150222093847.GC1532@pengutronix.de> <54EA2B60.6040506@rwth-aachen.de> <5B134AD7-726E-41EB-BA1A-C323E2AB9D52@iki.fi> <20150223083307.GD1532@pengutronix.de> <1E9AED858BEB204B9DE4F807C7ED0EF617CDD4BB@EMSRVWIN2934.apps.edc.thyssenkrupp.com> <20150223112407.GE1532@pengutronix.de> <1E9AED858BEB204B9DE4F807C7ED0EF617CDDB37@EMSRVWIN2934.apps.edc.thyssenkrupp.com> <20150226122349.GA14430@pengutronix.de> <1E9AED858BEB204B9DE4F807C7ED0EF617CE151F@EMSRVWIN2934.apps.edc.thyssenkrupp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1E9AED858BEB204B9DE4F807C7ED0EF617CE151F@EMSRVWIN2934.apps.edc.thyssenkrupp.com> Subject: Re: [ptxdist] (no subject) Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Fri, Feb 27, 2015 at 08:48:42AM +0000, R=FCdiger, Christoph wrote: > Am 26.02.15 um 13:23 schrieb Michael Olbrich:> On Tue, Feb 24, 2015 at 09= :28:29PM +0000, R=FCdiger, Christoph wrote: > >> Am 23.02.15 um 12:24 schrieb Michael Olbrich:> On Mon, Feb 23, 2015 at= 09:13:56AM +0000, R=FCdiger, Christoph wrote: > >>>>> On Mon, Feb 23, 2015 at 01:38:40AM +0200, Anders Montonen wrote: > >>>> You need to install a lot of GNU tools from exteranl sources (homebr= ew, > >>>> MacPorts, Fink), so I do not see any problem in including bash into = this > >>>> list. My bigger problem is now, that there is no GNU linker availabl= e on OS > >>>> X, so you need to use the LLVM linker which does not understand the > >>>> -Wl,--as-needed flag. I need to dig deeper to understand since when = GNU gcc > >>>> set this flag by default and what the drawback is, if we remove this= flag > >>>> from the PTXDIST_HOST_LDFLAGS. > >>> > >>> Hmm, "-Wl,--as-needed" should not be added implicitly and ptxdist sho= uld > >>> only add it for target packages if PTXCONF_TARGET_LINKER_AS_NEEDED is= set. > >> > >> You are right. I just cross-read an article and got the information wr= ong. > >> According to the GNU ld man page [1], --as-needed affects the DT_NEEDE= D flag > >> only of dynamic libraries given _after_ --as-needed. As ptxdist sets i= t as > >> the very last flag (see below), it is a useless flag. > > = > > Which ptxdist version are you using? > = > For this project, I need to stick with ptxdist-2013.12.0 for building OSE= LAS toolchain 2013.12.2. > = > > At least for target packages we set it > > in the right place. For me it looks like this: > > [...] > > wrapper: /usr/bin/icecc arm-v7a-linux-gnueabihf-gcc -Wl,--as-needed -i= system [...]/platform-arm-hf/sysroot-target/include -isystem [...]/platform= -arm-hf/sysroot-target/usr/include -O3 -D_LARGEFILE64_SOURCE=3D1 -DHAVE_HI= DDEN -o minigzip minigzip.o -L. libz.a -L[...]/platform-arm-hf/sysroot-targ= et/lib -L[...]/platform-arm-hf/sysroot-target/usr/lib -Wl,-rpath-link -Wl,[= ...]/platform-arm-hf/sysroot-target/lib -Wl,-rpath-link -Wl,[...]/platform-= arm-hf/sysroot-target/usr/lib > > [...] > > = > > The wrapper script adds it before the other options. > > = > >>> If you start ptxdist with '-v' then all calls to the compiler and lin= ker > >>> are logged. Look for lines starting with 'wrapper:' in the logfile. > >> > >> > >> wrapper: gcc -isystem /Volumes/BlueBox/src/OSELAS.Toolchain-2013.12.= 2/platform-arm-cortexa8-linux-gnueabihf-gcc-4.8.3-glibc-2.18-binutils-2.24-= kernel-3.12-sanitized/sysroot-host/include -O3 -DNO_FSEEKO -DNO_STRERROR -D= NO_vsnprintf -o minigzip minigzip.o -L. libz.a -L/Volumes/BlueBox/src/OSELA= S.Toolchain-2013.12.2/platform-arm-cortexa8-linux-gnueabihf-gcc-4.8.3-glibc= -2.18-binutils-2.24-kernel-3.12-sanitized/sysroot-host/lib -Wl,-rpath -Wl,/= Volumes/BlueBox/src/OSELAS.Toolchain-2013.12.2/platform-arm-cortexa8-linux-= gnueabihf-gcc-4.8.3-glibc-2.18-binutils-2.24-kernel-3.12-sanitized/sysroot-= host/lib -Wl,-rpath -Wl,/this/is/a/long/path/to/make/host/tools/relocateabl= e/with/chrpath/when/using/dev/packages -Wl,--as-needed > > = > > I'm not sure where the "-Wl,--as-needed" is comming from. The only thing > > that is added at the end of the command-line is PTXDIST_HOST_LDFLAGS and > > that's just the -L / -Wl,-rpath stuff. > = > I've performed a simple grep and stripped out the wrapper and exec lines = from the logfiles. This grep searched in the installed ptxdist, the ptxdist= sources and the OSELAS sources, as I'm not quite sure, if it is coming fro= m ptxdist or OSELAS toolchain project. But I tend to blame ptxdist ;-) > = > Remember: The compilation of host-zlib within the OSELAS toolchain projec= t fails. > = > $ grep -r -- '-Wl,--as-needed' * [...] > src/OSELAS.Toolchain-2013.12.2/rules/pre/toolchain.make:PTXDIST_HOST_LDFL= AGS +=3D -Wl,--as-needed [...] Here is the source of your problem. I originally added this because it some really unnecessary dependencies for something in the toolchain. Maybe we can only add it for the GNU ld? I'm not quite sure how to test for this, because we need to check the linker called by the host compiler which may not be 'ld'. Michael -- = Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- = ptxdist mailing list ptxdist@pengutronix.de