> -----Original Message-----
> From: [email protected] [mailto:ptxdist-
> [email protected]] On Behalf Of Michael Olbrich
> Sent: Friday, February 27, 2015 10:07 AM
> To: [email protected]
> Subject: Re: [ptxdist] (no subject)
> 
> On Fri, Feb 27, 2015 at 08:48:42AM +0000, Rüdiger, Christoph wrote:
> > Am 26.02.15 um 13:23 schrieb Michael Olbrich:> On Tue, Feb 24, 2015 at
> 09:28:29PM +0000, Rüdiger, Christoph wrote:
> > >> Am 23.02.15 um 12:24 schrieb Michael Olbrich:> On Mon, Feb 23, 2015 at
> 09:13:56AM +0000, Rüdiger, 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
> > >>>> (homebrew, 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 available 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
> > >>> should 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 
> > >> wrong.
> > >> According to the GNU ld man page [1], --as-needed affects the
> > >> DT_NEEDED flag only of dynamic libraries given _after_ --as-needed.
> > >> As ptxdist sets it 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 OSELAS
> 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
> > > -isystem [...]/platform-arm-hf/sysroot-target/include -isystem
> > > [...]/platform-arm-hf/sysroot-target/usr/include  -O3
> > > -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o minigzip minigzip.o -L.
> > > libz.a -L[...]/platform-arm-hf/sysroot-target/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
> > >>> linker are logged. Look for lines starting with 'wrapper:' in the 
> > >>> logfile.
> > >>
> > >>
> > >> wrapper:  gcc  -isystem
> > >> /Volumes/BlueBox/src/OSELAS.Toolchain-2013.12.2/platform-arm-
> cortex
> > >> a8-linux-gnueabihf-gcc-4.8.3-glibc-2.18-binutils-2.24-kernel-3.12-s
> > >> anitized/sysroot-host/include -O3 -DNO_FSEEKO -DNO_STRERROR
> > >> -DNO_vsnprintf -o minigzip minigzip.o -L. libz.a
> > >> -L/Volumes/BlueBox/src/OSELAS.Toolchain-2013.12.2/platform-arm-
> cort
> > >> exa8-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-
> co
> > >> rtexa8-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/relocateable/with/chrpa
> > >> th/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 from ptxdist or OSELAS toolchain project. But I tend to
> > blame ptxdist ;-)
> >
> > Remember: The compilation of host-zlib within the OSELAS toolchain
> project fails.
> >
> > $ grep -r -- '-Wl,--as-needed' *
> [...]
> > src/OSELAS.Toolchain-
> 2013.12.2/rules/pre/toolchain.make:PTXDIST_HOST_LDFLAGS
>               += -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'.

The LLVM linker is also called 'ld'. We need to check for the version string, 
which contains either "LLVM" or "GNU". If somebody can point me to a few places 
where to add this check, I can write something in the beginning of next week.

Btw.: Does somebody know a good autoconf howto? In the past years I've tried to 
avoid using it as best as I can, but this seems to require some autoconf 
knowledge ;-)

Best regards,
Christoph

--
ThyssenKrupp Elevator Innovation GmbH
PDC Neuhausen
TKEI Elevator Control
Bernhaeuser Straße 45
73765 Neuhausen, Germany

Phone +49 7158 12-2615
[email protected]

Company domicile: Essen      Commercial register: Essen HRB 20 839
Postal address: ThyssenKrupp Allee 1, 45143 Essen, Germany
Executive Board: Gerhard Thumm, Katrin Huenger, Philippe Choleau
-- 
ptxdist mailing list
[email protected]

Reply via email to