libtool
[Top][All Lists]
Advanced

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

Re: problems with LD_LIBRARY_PATH and libtool wrapper


From: Ralf Wildenhues
Subject: Re: problems with LD_LIBRARY_PATH and libtool wrapper
Date: Thu, 21 Aug 2008 10:30:08 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

My analysis was at least partly wrong:

* Ralf Wildenhues wrote on Thu, Aug 21, 2008 at 08:37:37AM CEST:
> * Dan McMahill wrote on Wed, Aug 20, 2008 at 03:55:19AM CEST:
> >
> > /bin/ksh ../libtool --tag=CC   --mode=link gcc  -g -O2 -Wall  
> > -Wl,-R/usr/pkg/lib
> > -Wl,--rpath -Wl,/usr/pkg/lib -Wl,-R/usr/X11R6/lib -L/usr/pkg/lib  
> 
> Here's your problem: something adds
>   -Wl,-R/usr/pkg/lib -Wl,--rpath -Wl,/usr/pkg/lib
> 
> to the link line of your program.  Find out what that is, probably
> either some flag in your Makefile.am or a configure macro.
[...]

> I'm still wondering whether this is a bug in libtool though.
> Namely:
> 
> If the user passes run paths with -R to libtool, should these run paths
> be reordered to always appear _after_ those run paths added by libtool
> which point to uninstalled locations?

If the user passes run paths with -R to libtool, then they _are_ already
put after all uninstalled run paths.  So this bug does not exist.

The issue then is one of users passing in run paths via other methods,
e.g., '-Wl,-R' or '-Wl,--rpath'.  Actually, there are two issues here:
First, the one Dan reported.  Second, the fact that it is not portable
to do so.  Even if the instance that added those paths would take care
to substitute the right system-specific linker flag, then there are
systems which allow only one such flag on the command line (with run
paths separated by colon or so).  So libtool _has_ to mangle them any
way.

We could just decree that passing -Wl,-rpath and the like to libtool is
not allowed, and one should always pass with -R.  Then the fix would be
a documentation clarification one only.

So, for you, Dan, that would mean tracking down whatever macro sets
those flags, and getting it to pass -R to libtool instead.  Or better
even not passing that: at least if the aim is to link against some
installed libraries, if those are libtool libraries, they should just
be listed as /foo/bar/libfoo.la.

Hope that helps.

Cheers,
Ralf




reply via email to

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