[prev in list] [next in list] [prev in thread] [next in thread] 

List:       binutils
Subject:    Re: [PATCH] Add plugin interface to LD [2/4] Claim files and add symbols.
From:       Ralf Wildenhues <Ralf.Wildenhues () gmx ! de>
Date:       2010-09-30 20:21:52
Message-ID: 20100930202152.GG3037 () gmx ! de
[Download RAW message or body]

Hi Dave,

* Dave Korn wrote on Thu, Sep 30, 2010 at 03:43:03PM CEST:
> On 23/09/2010 07:13, Ralf Wildenhues wrote:
> > Ordering.  You can't rely on libtool expanding -Wl, link flags after the
> > objects, meaning that libiberty may not be picked up at all.  (With
> > static linking, objects and libraries are evaluated in a strict command
> > line order, so all needed libraries must come after objects that need
> > them.)
> 
>   Seems I'm not the only one who has this problem.  The makefile for GCC's
> lto-plugin links libiberty like so:
> 
> > liblto_plugin_la_LIBADD = $(LIBELFLIBS) ../libiberty/pic/libiberty.a
> 
> which produces this warning on Linux:
[...]
>   When I try using LIBADD to link a static archive into a shared library on
> Cygwin, such as like so:
> 
> > libldtestplug_la_LIBADD = $(LIBIBERTY)
> 
> ... that warning becomes an error:

Ouch.

>   So if -Wl won't work, what can I do?  Do I have to build a libtool
> convenience library out of the libiberty object files?

Then use -Wc, please, so at least it is passed through to the compiler
driver without -Wl,.  A convenience archive would be cleaner from a
libtool POV, yes; I think I suggested that at one time but wasn't
received too well.

Cheers,
Ralf

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic