[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fwd: libtool munges '-(' linker options.]

From: Albert Chin
Subject: Re: [Fwd: libtool munges '-(' linker options.]
Date: Sun, 15 Dec 2002 11:09:13 -0600
User-agent: Mutt/1.4i

On Sun, Dec 15, 2002 at 04:42:42PM +0000, Scott James Remnant wrote:
> ----8<--------8<--------8<--------8<--------8<--------8<--------8<----
> Subject: libtool munges '-(' linker options.
> From: "C. Scott Ananian" <address@hidden>
> To: "Debian Bug Tracking System" <address@hidden>
> Date: Thu, 05 Sep 2002 14:04:07 -0400
> Package: libtool
> Version: 1.4.2-7
> Severity: important
> Certain applications require the linker flags --start-group
> and --end-group (abbreviated "-(" and "-)" ) in order to
> resolve circular references between libraries.  However,
> libtool "sorts" these flags and places them at the beginning
> of the command-line, destroying their utility.  At the end
> of this report is a uuencoded archive containing three
> source files and a Makefile demonstrating the problem.
> We end up with an archive A.a which uses symbols defined in B.a
> and an archive B.a which uses symbols defined in A.a --- a
> circular dependency.  The command:
>   gcc -o foo c.o -Wl,"-(" A.a B.a -Wl,"-)"
> correctly builds these archives into an executable by telling
> ld that it should iterate over A.a and B.a to resolve all
> circular references, instead of ld's usual search-once strategy.
> However:
>   libtool gcc -o foo c.o -Wl,"-(" A.a B.a -Wl,"-)"
> yields:
>   $ libtool gcc -o foo c.o -Wl,"-(" A.a B.a -Wl,"-)"
>   gcc -o foo c.o -Wl,"-(" -Wl,"-)"  A.a B.a
>   B.a(b.o): In function `b':
>   b.o(.text+0x1b): undefined reference to `a'
>   collect2: ld returned 1 exit status
> As you can see, libtool re-orders the -( and -) flags, destroying
> their function.  This is a bug in libtool (and it's making my
> life quite difficult at the moment).

Why not invoke libtool as:
  $ libtool gcc -o foo c.o -Wl,"-(",A.a,B.a,"-)"

albert chin (address@hidden)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]