httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Bannert <aa...@clove.org>
Subject Re: Run-time linking paths via LDFLAGS on Linux with gcc.
Date Tue, 08 Jan 2002 01:09:32 GMT
Comments below:

On Sun, Jan 06, 2002 at 10:40:43PM -0800, Justin Erenkrantz wrote:
> gcc on Linux is brain-dead w.r.t. run-time link paths.  In order 
> to add any run-time search dir, you must specify "-Wl,-rpath <path>"
> to add a dir via gcc.  However, libtool only recognizes "-R" or 
> "-rpath" as the link path options.  So, these two options are 
> completely incompatible.  (FWIW, gcc on Solaris recognizes -R 
> natively, so it isn't a problem there - -R works for both gcc
> and libtool - probably why I've skirted the issue for so long.)

Right, the reason gcc doesn't take -rpath directly is because that
is a linker directive. Normally, LDFLAGS is passed to the linker,
not the compiler.

> I usually add the Berkeley DB libraries so APR-util finds it
> (SVN requires that apr-util links against db-4.0.14 which is
> different than what is in my /usr/lib):
> 
> CPPFLAGS="-I/pkg/db-4.0.14/include" \
> LDFLAGS="-L/pkg/db-4.0.14/lib -Wl,-rpath /pkg/db-4.0.14/lib" \
> ./configure ...<options>...

I would expect this on Linux to be:
LDFLAGS="-L/pkg/db-4.0.14/lib -rpath /pkg/db-4.0.14/lib"

.. But you're saying this is breaking also, right?

> If we specify "-Wl,-rpath", we fail at link-time when building
> the binaries, since libtool does not understand -Wl,-rpath.
> 
> However, if you specify "-R" instead of -Wl,-rpath, we will fail 
> at configure-time in httpd since configure will try to link with 
> LDFLAGS and gcc will say that "-R" is unrecognized.

-R on linux would be wrong to pass to either gcc or ld. If this
is failing in configure then our configure.in is broken for calling
gcc instead of ld (or libtool). Can we get autoconf's tests to
use libtool instead of gcc/ld directly?

[snip]

-aaron

Mime
View raw message