Debian Bug report logs - #347650
libtool: Incorrect argument reordering

version graph

Package: libtool; Maintainer for libtool is Kurt Roeckx <kurt@roeckx.be>; Source for libtool is src:libtool.

Reported by: Josselin Mouette <joss@debian.org>

Date: Wed, 11 Jan 2006 21:18:07 UTC

Severity: important

Merged with 557388

Found in versions libtool/1.5.22-2, libtool/2.2.6a-4

Forwarded to http://lists.gnu.org/archive/html/bug-libtool/2009-12/msg00038.html

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Josselin Mouette <joss@debian.org>:
New Bug report received and forwarded. Copy sent to Kurt Roeckx <kurt@roeckx.be>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Josselin Mouette <joss@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libtool: Incorrect argument reordering
Date: Wed, 11 Jan 2006 21:59:57 +0100
Package: libtool
Version: 1.5.22-2
Severity: important

It looks like libtool likes, when building libraries, to reorder 
arguments:

When linking this module (this can be found in the control-center build logs):
/bin/sh ../../libtool --tag=CC --mode=link gcc  -g -O2 -Wall -Wextra  -Wl,-O1 -Wl,--as-needed -o libtheme-method.la -rpath /usr/local/lib/gnome-vfs-2.0/modules -module -avoid-version -export-symbols-regex 'vfs_module_.*' theme-method.lo -pthread  -lgnomevfs-2 -lbonobo-2 -lgconf-2 -lgobject-2.0 -lbonobo-activation -lORBit-2 -lm -lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0 ../../capplets/common/libcommon.la

libtool then runs:
gcc -shared  .libs/theme-method.o -Wl,--whole-archive ../../capplets/common/.libs/libcommon.a -Wl,--no-whole-archive  -Wl,--rpath -Wl,/home/joss/deb/pkg-gnome/desktop/unstable/tarballs/control-center-2.12.2/libwindow-settings/.libs -Wl,--rpath -Wl,/usr/local/lib /home/joss/deb/pkg-gnome/desktop/unstable/tarballs/control-center-2.12.2/libwindow-settings/.libs/libgnome-window-settings.so -L/usr/X11R6/lib /usr/lib/libglade-2.0.so -L/usr/lib /usr/lib/libgnome-menu.so /usr/lib/libfam.so -lrpcsvc /usr/lib/libmetacity-private.so /usr/lib/libgnome-desktop-2.so /usr/lib/libgnomeui-2.so /usr/lib/libjpeg.so /usr/lib/libstartup-notification-1.so /usr/lib/libbonoboui-2.so /usr/lib/libpangoxft-1.0.so /usr/lib/libpangox-1.0.so -lSM -lICE /usr/lib/libgnome-keyring.so /usr/lib/libgnomecanvas-2.so /usr/lib/libgnome-2.so -lrt /usr/lib/libesd.so /usr/lib/libaudiofile.so /usr/lib/libart_lgpl_2.so /usr/lib/libgtk-x11-2.0.so /usr/lib/libgdk-x11-2.0.so -lXrandr -lXi -lXinerama -lXext /usr/lib/libatk-1.0.so /usr/lib/libgdk_pixbuf-2.0.so /usr/lib/libpangocairo-1.0.so /usr/lib/libpangoft2-1.0.so /usr/lib/libXcursor.so /usr/lib/libpango-1.0.so /usr/lib/libcairo.so -lpng12 -lfontconfig /usr/lib/libfreetype.so /usr/lib/libXrender.so -lX11 /usr/lib/libgnomevfs-2.so /usr/lib/libxml2.so /usr/lib/libgnutls.so /usr/lib/libtasn1.so /usr/lib/libgcrypt.so -lnsl /usr/lib/libgpg-error.so -lz /usr/lib/libhowl.so /usr/lib/libavahi-client.so -ldbus-1 /usr/lib/libavahi-common.so -lresolv /usr/lib/libbonobo-2.so /usr/lib/libgconf-2.so /usr/lib/libbonobo-activation.so /usr/lib/libORBitCosNaming-2.so /usr/lib/libORBit-2.so /usr/lib/libpopt.so /usr/lib/libgobject-2.0.so -lm /usr/lib/libgmodule-2.0.so -ldl /usr/lib/libgthread-2.0.so -lpthread /usr/lib/libglib-2.0.so  -Wl,-O1 -Wl,--as-needed -pthread -Wl,-soname -Wl,libtheme-method.so -Wl,-version-script -Wl,.libs/libtheme-method.ver -o .libs/libtheme-method.so

I don't know for other options, but --as-needed doesn't work if 
specified after the libraries. This leads to the usual horror that 
Debian's libtool is supposed to avoid: dependencies on tons of libraries 
we don't want to link with. 

In this particular case it makes the package having a really wrong 
dependency on libgamin, making it incompatible with fam, but that's only 
a consequence of not using --as-needed.

All libraries seem to be affected, for example librsvg2-2, but binaries 
are not: when linking a binary, libtool doesn't do this reordering and 
the dependencies look fine.

The control-center package is using the following version:
VERSION="1.5.20 Debian 1.5.20-2"
TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)"

When relibtoolizing with the latest libtool in Debian, the result is the 
same.

The following version (which was used for GNOME 2.10) isn't affected:
VERSION=1.5.6
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"

Regards,
-- 
 .''`.           Josselin Mouette        /\./\
: :' :           josselin.mouette@ens-lyon.org
`. `'                        joss@debian.org
  `-  Debian GNU/Linux -- The power of freedom



Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. Full text and rfc822 format available.

Message #10 received at 347650@bugs.debian.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Josselin Mouette <joss@debian.org>, 347650@bugs.debian.org
Subject: Re: Bug#347650: libtool: Incorrect argument reordering
Date: Wed, 11 Jan 2006 22:38:06 +0100
Hi Josselin,

* Josselin Mouette wrote on Wed, Jan 11, 2006 at 09:59:57PM CET:
> 
> It looks like libtool likes, when building libraries, to reorder 
> arguments:

Well, yes.  It move all the options away from the libraries + library
flags.  GNU libtool plans to lift this restriction, but it unfortunately
costs quite some rework.  :-/

> When linking this module (this can be found in the control-center build logs):
> /bin/sh ../../libtool --tag=CC --mode=link gcc  -g -O2 -Wall -Wextra  -Wl,-O1 -Wl,--as-needed -o libtheme-method.la -rpath /usr/local/lib/gnome-vfs-2.0/modules -module -avoid-version -export-symbols-regex 'vfs_module_.*' theme-method.lo -pthread  -lgnomevfs-2 -lbonobo-2 -lgconf-2 -lgobject-2.0 -lbonobo-activation -lORBit-2 -lm -lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0 ../../capplets/common/libcommon.la
> 
> libtool then runs:

[ -Wl,--as-needed very late in the command line ]

> I don't know for other options, but --as-needed doesn't work if 
> specified after the libraries.

Ouch. I did not know that either.

Having this appear early should be doable (much easier than allowing
general option interspersed with libraries), but..

> The following version (which was used for GNOME 2.10) isn't affected:
> VERSION=1.5.6
> TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"

Now this strikes me as strange.  I don't remember all development from
1.5.6 on; it would make my life easier if you could run
  ../../libtool --debug  ...

for both versions and post the output (packed), together with
  .../libtool --config

Cheers,
Ralf



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Kurt Roeckx <kurt@roeckx.be>:
Extra info received and forwarded to list. Full text and rfc822 format available.

Message #15 received at 347650@bugs.debian.org (full text, mbox):

From: Kurt Roeckx <kurt@roeckx.be>
To: Josselin Mouette <joss@debian.org>, 347650@bugs.debian.org
Subject: Re: Bug#347650: libtool: Incorrect argument reordering
Date: Wed, 11 Jan 2006 23:47:51 +0100
On Wed, Jan 11, 2006 at 09:59:57PM +0100, Josselin Mouette wrote:
> It looks like libtool likes, when building libraries, to reorder 
> arguments:
> 
> When linking this module (this can be found in the control-center build logs):
> /bin/sh ../../libtool --tag=CC --mode=link gcc  -g -O2 -Wall -Wextra  -Wl,-O1 -Wl,--as-needed -o libtheme-method.la -rpath /usr/local/lib/gnome-vfs-2.0/modules -module -avoid-version -export-symbols-regex 'vfs_module_.*' theme-method.lo -pthread  -lgnomevfs-2 -lbonobo-2 -lgconf-2 -lgobject-2.0 -lbonobo-activation -lORBit-2 -lm -lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0 ../../capplets/common/libcommon.la

libcommon.la seems to be a conviences lib.  You're linking to it
staticly, and I think this is causing you the most problems.
Because it's a conviences lib it's also adding all the dependency
libraries.

> I don't know for other options, but --as-needed doesn't work if 
> specified after the libraries.

Yes, --as-needed is only for the libraries that follow it.

> In this particular case it makes the package having a really wrong 
> dependency on libgamin, making it incompatible with fam, but that's only 
> a consequence of not using --as-needed.

I think we should try avoiding having all those libs on the
command line that you don't need, instead of using --as-needed.

I suggest if you create a convience library, you don't link any
libraries to it at that time.  Instead, when you are linking in
the convience libraries to something, at that point you should
add those libraries.  This will avoid libtool from adding all the
depedency libraries on the command line.


Kurt




Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Josselin Mouette <joss@debian.org>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. Full text and rfc822 format available.

Message #20 received at 347650@bugs.debian.org (full text, mbox):

From: Josselin Mouette <joss@debian.org>
To: 347650@bugs.debian.org
Subject: Re: Bug#347650: libtool: Incorrect argument reordering
Date: Wed, 01 Feb 2006 12:21:04 +0100
Sorry for not answering earlier, my previous mail was eaten by a spam
filter, presumably because of the huge traces.

Le mercredi 11 janvier 2006 à 22:38 +0100, Ralf Wildenhues a écrit :
> > The following version (which was used for GNOME 2.10) isn't affected:
> > VERSION=1.5.6
> > TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"

BTW I have had the occasion to build a library that uses version 1.5.16,
which is affected as well.

> Now this strikes me as strange.  I don't remember all development from
> 1.5.6 on; it would make my life easier if you could run
>   ../../libtool --debug  ...
> 
> for both versions and post the output (packed), together with
>   .../libtool --config

You can find these outputs at:
http://malsain.org/~joss/libtool/

Regards,
-- 
 .''`.           Josselin Mouette        /\./\
: :' :           josselin.mouette@ens-lyon.org
`. `'                        joss@debian.org
   `-  Debian GNU/Linux -- The power of freedom




Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Loïc Minier <lool@dooz.org>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. Full text and rfc822 format available.

Message #25 received at 347650@bugs.debian.org (full text, mbox):

From: Loïc Minier <lool@dooz.org>
To: Kurt Roeckx <kurt@roeckx.be>
Cc: Josselin Mouette <joss@debian.org>, 347650@bugs.debian.org
Subject: Re: Bug#347650: libtool: Incorrect argument reordering
Date: Sat, 18 Feb 2006 21:07:19 +0100
On mer, jan 11, 2006, Kurt Roeckx wrote:
> I suggest if you create a convience library, you don't link any
> libraries to it at that time.  Instead, when you are linking in
> the convience libraries to something, at that point you should
> add those libraries.  This will avoid libtool from adding all the
> depedency libraries on the command line.

 Unfortunately, the convenience library depends on another libtool
 archive which is not a convenience lib, but a real library.  Beside,
 that convenience libcommon.la is used in some places, and it would be
 inconvenient to change that (ie. upstream probably wouldn't like it).

 I'm not sure why libtool has to link all dependency_libs of a
 convenience library.

-- 
Loïc Minier <lool@dooz.org>
Current Earth status:   NOT DESTROYED



Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Kurt Roeckx <kurt@roeckx.be>:
Extra info received and forwarded to list. Full text and rfc822 format available.

Message #30 received at 347650@bugs.debian.org (full text, mbox):

From: Kurt Roeckx <kurt@roeckx.be>
To: Loïc Minier <lool@dooz.org>
Cc: Josselin Mouette <joss@debian.org>, 347650@bugs.debian.org
Subject: Re: Bug#347650: libtool: Incorrect argument reordering
Date: Sat, 18 Feb 2006 21:52:34 +0100
On Sat, Feb 18, 2006 at 09:07:19PM +0100, Loïc Minier wrote:
> On mer, jan 11, 2006, Kurt Roeckx wrote:
> > I suggest if you create a convience library, you don't link any
> > libraries to it at that time.  Instead, when you are linking in
> > the convience libraries to something, at that point you should
> > add those libraries.  This will avoid libtool from adding all the
> > depedency libraries on the command line.
> 
>  Unfortunately, the convenience library depends on another libtool
>  archive which is not a convenience lib, but a real library.  Beside,
>  that convenience libcommon.la is used in some places, and it would be
>  inconvenient to change that (ie. upstream probably wouldn't like it).
> 
>  I'm not sure why libtool has to link all dependency_libs of a
>  convenience library.

When you create a convenience library, and at that time you tell
it to link to some libraries, it will add all the those
libraries you had on the command line, and all the ones that those
depend on, to dependency_libs, like it always does.

When you then link something to that convenience library, it will
add the libraries in the dependency_libs to the link line.  It's
doing this because you told that the library needs symbols from
the libraries you had on the command line, and it's also linking
in all the libraries required by those.

One solution to this would be to only store the libraries that
were on the command line in dependency_libs, and I've suggested
that to upstream, but they see problems with it, and we're
working on it.

A workaround is not telling it which libraries the convenience
library needs, so you end up with an empty dependency_libs.  And
then when linking to the convenience library you also link to
those that it requires.  This might require some changes, but
it's the only workaround I know that would solve your problems in
the short turn.


Kurt




Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. Full text and rfc822 format available.

Message #35 received at 347650@bugs.debian.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Loïc Minier <lool@dooz.org>, 347650@bugs.debian.org
Cc: Kurt Roeckx <kurt@roeckx.be>, Josselin Mouette <joss@debian.org>
Subject: Re: Bug#347650: libtool: Incorrect argument reordering
Date: Sun, 19 Feb 2006 10:18:48 +0100
* Loïc Minier wrote on Sat, Feb 18, 2006 at 09:07:19PM CET:
> On mer, jan 11, 2006, Kurt Roeckx wrote:
> > I suggest if you create a convience library, you don't link any
> > libraries to it at that time.  Instead, when you are linking in
> > the convience libraries to something, at that point you should
> > add those libraries.  This will avoid libtool from adding all the
> > depedency libraries on the command line.
> 
>  Unfortunately, the convenience library depends on another libtool
>  archive which is not a convenience lib, but a real library.

I don't quite know what you suggest what should happen here, but:
when you create a convenience lib, and add real libs as dependencies on
the command line, then _all_ libtool will do is add them to the
`dependency_libs' variable.  Nothing will differ wrt. the created file
libfoo.a.

That's usually *convenient*, because the whole purpose of that adding is
that, when you later put the convenience archive into a real library,
you don't forget to *also* link against those other libraries.

There simply is no indirection to be eliminated here.  None.  A
convenience archive will never exist as an installed entity, so you're
effectively just adding information that some link should also pull in
other links.  If you now don't want that information added, then simply
don't do it.

> Beside,
>  that convenience libcommon.la is used in some places, and it would be
>  inconvenient to change that (ie. upstream probably wouldn't like it).
> 
>  I'm not sure why libtool has to link all dependency_libs of a
>  convenience library.

Because there simply is no indirection to make use of.  The lib in which
the convenience lib will be merged into, will be a *direct* user of all
dependencies of this convenience lib.

Cheers,
Ralf



Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Josselin Mouette <joss@debian.org>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. Full text and rfc822 format available.

Message #40 received at 347650@bugs.debian.org (full text, mbox):

From: Josselin Mouette <joss@debian.org>
To: 347650@bugs.debian.org
Subject: Re: Bug#347650: libtool: Incorrect argument reordering
Date: Tue, 28 Mar 2006 12:37:52 +0200
Le mercredi 11 janvier 2006 à 22:38 +0100, Ralf Wildenhues a écrit :
> > It looks like libtool likes, when building libraries, to reorder 
> > arguments:
> 
> Well, yes.  It move all the options away from the libraries + library
> flags.  GNU libtool plans to lift this restriction, but it unfortunately
> costs quite some rework.  :-/

Are there any news regarding this bug? It is making all GNOME libraries
have tons of indirect dependencies, which is causing serious headaches
with the GNOME 2.14 move.

Regards,
-- 
 .''`.           Josselin Mouette        /\./\
: :' :           josselin.mouette@ens-lyon.org
`. `'                        joss@debian.org
   `-  Debian GNU/Linux -- The power of freedom




Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. Full text and rfc822 format available.

Message #45 received at 347650@bugs.debian.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Josselin Mouette <joss@debian.org>, 347650@bugs.debian.org
Subject: Re: Bug#347650: libtool: Incorrect argument reordering
Date: Tue, 28 Mar 2006 13:20:03 +0200
* Josselin Mouette wrote on Tue, Mar 28, 2006 at 12:37:52PM CEST:
> Le mercredi 11 janvier 2006 à 22:38 +0100, Ralf Wildenhues a écrit :
> > > It looks like libtool likes, when building libraries, to reorder 
> > > arguments:
> > 
> > Well, yes.  It move all the options away from the libraries + library
> > flags.  GNU libtool plans to lift this restriction, but it unfortunately
> > costs quite some rework.  :-/
> 
> Are there any news regarding this bug? It is making all GNOME libraries
> have tons of indirect dependencies, which is causing serious headaches
> with the GNOME 2.14 move.

Well, all I know is that if you are adding a convenience archive as a
dependency, then *it is by design* that all dependencies of that
convenience archive are added, too.  I've tried to explain this before
(may have been to a different bug report, though):  Convenience archives
are merely objects to be incorporated into a bigger whole.  It makes no
sense to speak of indirection here, because there is none, from the
point of a shared library.  So if you think there are too many libraries
added, then that means that the creation of the convenience archive
simply lists too many dependencies.

It may help to split up the convenience archive into smaller convenience
archives, where the smaller parts each list a strict subset of
dependencies themselves.  But to be honest, I haven't had the time nor
do I have the knowledge about GNOME libraries to see what should be done
in this particular case.

Hope that helps.

Cheers,
Ralf



Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. Full text and rfc822 format available.

Message #50 received at 347650@bugs.debian.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Josselin Mouette <joss@debian.org>, 347650@bugs.debian.org
Subject: Re: Bug#347650: libtool: Incorrect argument reordering
Date: Tue, 28 Mar 2006 13:25:42 +0200
* Josselin Mouette wrote on Tue, Mar 28, 2006 at 12:37:52PM CEST:
> Le mercredi 11 janvier 2006 à 22:38 +0100, Ralf Wildenhues a écrit :
> > > It looks like libtool likes, when building libraries, to reorder 
> > > arguments:
> > 
> > Well, yes.  It move all the options away from the libraries + library
> > flags.  GNU libtool plans to lift this restriction, but it unfortunately
> > costs quite some rework.  :-/
> 
> Are there any news regarding this bug? It is making all GNOME libraries
> have tons of indirect dependencies, which is causing serious headaches
> with the GNOME 2.14 move.

Forgot one part: wrt. not reordering -Wl,--as-needed:
I plan to lift this restriction eventually, but it don't think I can
manage to do this in the Libtool-1.5.x time frame.  Sorry.

If somebody independently wants to implement that in Debian's libtool:
it likely needs changes in ltmain that are very similarly to those that
are necessary for per-deplib static/shared flags:
http://lists.gnu.org/archive/html/libtool-patches/2006-01/msg00064.html

Please note that this patch was also delayes to post 2.0, unfortunately.

Cheers,
Ralf



Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Josselin Mouette <joss@debian.org>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. Full text and rfc822 format available.

Message #55 received at 347650@bugs.debian.org (full text, mbox):

From: Josselin Mouette <joss@debian.org>
To: 347650@bugs.debian.org
Subject: Re: Bug#347650: libtool: Incorrect argument reordering
Date: Tue, 28 Mar 2006 13:54:33 +0200
Le mardi 28 mars 2006 à 13:20 +0200, Ralf Wildenhues a écrit :
> > Are there any news regarding this bug? It is making all GNOME libraries
> > have tons of indirect dependencies, which is causing serious headaches
> > with the GNOME 2.14 move.
> 
> Well, all I know is that if you are adding a convenience archive as a
> dependency, then *it is by design* that all dependencies of that
> convenience archive are added, too.

I'm not talking about convenience archives. The initial bug report was
about that particular case, but the argument reordering happens for all
libraries, breaking --as-needed.

> Forgot one part: wrt. not reordering -Wl,--as-needed:
> I plan to lift this restriction eventually, but it don't think I can
> manage to do this in the Libtool-1.5.x time frame.  Sorry.
> 
> If somebody independently wants to implement that in Debian's libtool:
> it likely needs changes in ltmain that are very similarly to those that
> are necessary for per-deplib static/shared flags:
> http://lists.gnu.org/archive/html/libtool-patches/2006-01/msg00064.html

I'll see if I can hack something based on this one.

Regards,
-- 
 .''`.           Josselin Mouette        /\./\
: :' :           josselin.mouette@ens-lyon.org
`. `'                        joss@debian.org
   `-  Debian GNU/Linux -- The power of freedom




Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Josselin Mouette <joss@debian.org>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. Full text and rfc822 format available.

Message #60 received at 347650@bugs.debian.org (full text, mbox):

From: Josselin Mouette <joss@debian.org>
To: 347650@bugs.debian.org
Subject: hackish patch
Date: Wed, 17 May 2006 01:54:30 +0200
[Message part 1 (text/plain, inline)]
The attached patch is applied to libgnome, to avoid argument reordering
for -Wl,--as-needed.

It is only a hack, but it works. With it, libgnome has reduced
dependencies as expected.
-- 
 .''`.           Josselin Mouette        /\./\
: :' :           josselin.mouette@ens-lyon.org
`. `'                        joss@debian.org
  `-  Debian GNU/Linux -- The power of freedom
[00_as-needed.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. Full text and rfc822 format available.

Message #65 received at 347650@bugs.debian.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Josselin Mouette <joss@debian.org>, 347650@bugs.debian.org
Subject: Re: Bug#347650: hackish patch
Date: Wed, 17 May 2006 09:09:29 +0200
Hi Josselin,

* Josselin Mouette wrote on Wed, May 17, 2006 at 01:54:30AM CEST:
> The attached patch is applied to libgnome, to avoid argument reordering
> for -Wl,--as-needed.
> 
> It is only a hack, but it works. With it, libgnome has reduced
> dependencies as expected.

It's not bad, but it's missing a few minor things:

* "-Wl,--no-as-needed" should be treated in the same way.

* In order to support multiple sequences of
    -Wl,--as-needed ... -Wl,--no-as-needed
  it is necessary to turn off duplicate removal in this loop
  (around line 3019):

        for var in $vars dependency_libs; do
          # Add libraries to $var in reverse order
          eval tmp_libs=\"\$$var\"
          new_libs=
          for deplib in $tmp_libs; do
          ...
            case $deplib in
            -L*) new_libs="$deplib $new_libs" ;;
            -R*) ;;
            -Wl,*) new_libs="$deplib $new_libs" ;;
            *)
              # And here is the reason: when a library appears more
            ...
        done

* In order for this to also work on non-Debian systems, more precisely,
  on systems without link_all_deplibs=no, the loop around line 2906,
          if test "$link_all_deplibs" != no; then
            # Add the search paths of all dependency libraries
            for deplib in $dependency_libs; do
              case $deplib in
              -L*) path="$deplib" ;;
           ...
          fi

  needs to be treated similarly.


Hope this helps.  I haven't tested your patch in any way yet.

Cheers,
Ralf



Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to Sebastian Dröge <slomo@circular-chaos.org>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. Full text and rfc822 format available.

Message #70 received at 347650@bugs.debian.org (full text, mbox):

From: Sebastian Dröge <slomo@circular-chaos.org>
To: 347650@bugs.debian.org
Subject: Re: libtool: Incorrect argument reordering
Date: Wed, 12 Dec 2007 07:06:29 +0100
[Message part 1 (text/plain, inline)]
Hi,
are there any news on this bug? Joss' patch is now used by many
packages, would be nicer to have this fixed in libtool though.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. Full text and rfc822 format available.

Acknowledgement sent to "Hai Zaar" <haizaar@haizaar.com>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. Full text and rfc822 format available.

Message #75 received at 347650@bugs.debian.org (full text, mbox):

From: "Hai Zaar" <haizaar@haizaar.com>
To: 347650@bugs.debian.org
Subject: Any plans?
Date: Tue, 24 Jun 2008 01:34:22 +0300
Are there any plans to fix this bug? Currently I have to apply Joss's
patch to ltmain.sh each time I generate it for each of my projects.

-- 
Zaar




Merged 347650 557388. Request was from kurt@roeckx.be (Kurt Roeckx) to control@bugs.debian.org. (Sun, 22 Nov 2009 12:36:10 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. (Mon, 07 Dec 2009 13:42:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Resul Cetin <Resul-Cetin@gmx.net>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. (Mon, 07 Dec 2009 13:42:08 GMT) Full text and rfc822 format available.

Message #82 received at 347650@bugs.debian.org (full text, mbox):

From: Resul Cetin <Resul-Cetin@gmx.net>
To: 347650@bugs.debian.org
Subject: Any plans?
Date: Mon, 7 Dec 2009 14:36:41 +0100
Libtool is regenerated each time when running `autoreconf -fi` as you must do 
when you follow the stuff explained in
 /usr/share/doc/autotools-dev/README.Debian.gz - this makes the patch relative 
useless as It wouldn't work when a new version of libtool is introduced. So it 
must be added in some way to libtool and not as patch to each package.




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#347650; Package libtool. (Wed, 09 Dec 2009 20:12:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kurt Roeckx <kurt@roeckx.be>:
Extra info received and forwarded to list. (Wed, 09 Dec 2009 20:12:03 GMT) Full text and rfc822 format available.

Message #87 received at 347650@bugs.debian.org (full text, mbox):

From: Kurt Roeckx <kurt@roeckx.be>
To: Resul Cetin <Resul-Cetin@gmx.net>, 347650@bugs.debian.org
Subject: Re: Bug#347650: Any plans?
Date: Wed, 9 Dec 2009 21:11:06 +0100
On Mon, Dec 07, 2009 at 02:36:41PM +0100, Resul Cetin wrote:
> Libtool is regenerated each time when running `autoreconf -fi` as you must do 
> when you follow the stuff explained in
>  /usr/share/doc/autotools-dev/README.Debian.gz - this makes the patch relative 
> useless as It wouldn't work when a new version of libtool is introduced. So it 
> must be added in some way to libtool and not as patch to each package.
> 

If you want me to apply a patch I need something that works on
non-Debian systems too.  Please see:
http://bugs.debian.org/347650#65


Kurt





Set Bug forwarded-to-address to 'http://lists.gnu.org/archive/html/bug-libtool/2009-12/msg00038.html'. Request was from Resul Cetin <Resul-Cetin@gmx.net> to control@bugs.debian.org. (Fri, 25 Dec 2009 11:45:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. (Tue, 05 Oct 2010 19:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Josselin Mouette <joss@debian.org>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. (Tue, 05 Oct 2010 19:09:03 GMT) Full text and rfc822 format available.

Message #94 received at 347650@bugs.debian.org (full text, mbox):

From: Josselin Mouette <joss@debian.org>
To: 347650@bugs.debian.org
Subject: Incorrect argument reordering: any news?
Date: Tue, 05 Oct 2010 21:07:37 +0200
[Message part 1 (text/plain, inline)]
Hi,

this bug has been around for a long time, and it is still annoying us.
We have to patch ltmain.sh in a large number of packages so that
--as-needed works correctly.

Do you have an idea when it could be incorporated?

Cheers,
-- 
 .''`.      Josselin Mouette
: :' :
`. `'  “If you behave this way because you are blackmailed by someone,
  `-    […] I will see what I can do for you.”  -- Jörg Schilling
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. (Sun, 06 Mar 2011 10:03:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Metzler <ametzler@downhill.at.eu.org>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. (Sun, 06 Mar 2011 10:03:10 GMT) Full text and rfc822 format available.

Message #99 received at 347650@bugs.debian.org (full text, mbox):

From: Andreas Metzler <ametzler@downhill.at.eu.org>
To: 347650@bugs.debian.org
Subject: Re: Bug#347650: hackish patch
Date: Sun, 6 Mar 2011 11:01:10 +0100
[Message part 1 (text/plain, inline)]
FWIW, find attached an updated version of the hackish patch which
applies to 2.2.6b. (Source:
http://code.google.com/p/tesjeract/source/browse/trunk/native/unix/libtool-2.2.6-as-needed.patch?spec=svn67&r=67)

cu andreas
[10_workaround_libtool_link_as_needed_bug (text/plain, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. (Fri, 08 Apr 2011 15:27:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julian Andres Klode <jak@debian.org>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. (Fri, 08 Apr 2011 15:27:10 GMT) Full text and rfc822 format available.

Message #104 received at 347650@bugs.debian.org (full text, mbox):

From: Julian Andres Klode <jak@debian.org>
To: Kurt Roeckx <kurt@roeckx.be>, 347650@bugs.debian.org
Subject: Re: Bug#347650: Any plans?
Date: Fri, 8 Apr 2011 17:24:10 +0200
[Message part 1 (text/plain, inline)]
On Wed, Dec 09, 2009 at 09:11:06PM +0100, Kurt Roeckx wrote:
> On Mon, Dec 07, 2009 at 02:36:41PM +0100, Resul Cetin wrote:
> > Libtool is regenerated each time when running `autoreconf -fi` as you must do 
> > when you follow the stuff explained in
> >  /usr/share/doc/autotools-dev/README.Debian.gz - this makes the patch relative 
> > useless as It wouldn't work when a new version of libtool is introduced. So it 
> > must be added in some way to libtool and not as patch to each package.
> > 
> 
> If you want me to apply a patch I need something that works on
> non-Debian systems too.  Please see:
> http://bugs.debian.org/347650#65

Couldn't we make a compromise and build a libtool-debian package
that ships a patched version? This way, packages that have to
run autoreconf can just use dh-autoreconf without having too
care about libtool. That's especially useful for the GNOME
stack.

That should be a matter of building a normal version, then applying
the patch and building a version with --program-suffix=-debian (of
course, you might still need to rename the dir where ltmain.sh is
located).

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Kurt Roeckx <kurt@roeckx.be>:
Bug#347650; Package libtool. (Fri, 08 Apr 2011 16:39:22 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julian Andres Klode <jak@debian.org>:
Extra info received and forwarded to list. Copy sent to Kurt Roeckx <kurt@roeckx.be>. (Fri, 08 Apr 2011 16:39:23 GMT) Full text and rfc822 format available.

Message #109 received at 347650@bugs.debian.org (full text, mbox):

From: Julian Andres Klode <jak@debian.org>
To: Kurt Roeckx <kurt@roeckx.be>, 347650@bugs.debian.org
Subject: Re: Bug#347650: Any plans?
Date: Fri, 8 Apr 2011 18:37:51 +0200
[Message part 1 (text/plain, inline)]
On Fri, Apr 08, 2011 at 05:24:10PM +0200, Julian Andres Klode wrote:
> On Wed, Dec 09, 2009 at 09:11:06PM +0100, Kurt Roeckx wrote:
> > On Mon, Dec 07, 2009 at 02:36:41PM +0100, Resul Cetin wrote:
> > > Libtool is regenerated each time when running `autoreconf -fi` as you must do 
> > > when you follow the stuff explained in
> > >  /usr/share/doc/autotools-dev/README.Debian.gz - this makes the patch relative 
> > > useless as It wouldn't work when a new version of libtool is introduced. So it 
> > > must be added in some way to libtool and not as patch to each package.
> > > 
> > 
> > If you want me to apply a patch I need something that works on
> > non-Debian systems too.  Please see:
> > http://bugs.debian.org/347650#65
> 
> Couldn't we make a compromise and build a libtool-debian package
> that ships a patched version? This way, packages that have to
> run autoreconf can just use dh-autoreconf without having too
> care about libtool. That's especially useful for the GNOME
> stack.
> 
Even easier for you: Just drop a patch enabling -Wl,--as-needed
into the package as:
	/usr/share/libtool/debian/ltmain-as-needed.patch

And dh-autoreconf applies it automatically on all ltmain.sh
in the source tree.


-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
[Message part 2 (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 15:43:02 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.