This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to build an RPATH into gcc?
Adrian Bunk <bunk@fs.tum.de> writes:
> > > LDFLAGS="-L/usr/local/lib -R/usr/local/lib" ../configure
> > > didn't work
> >
> > Why didn't this work? Does the sparc-netbsdelf1.5 linker support the
> > -R option? If it does not support -R, does it support --rpath? Was
>
> -R is not an option for ld, it's an option for gcc.
That turns out not to be the case. Insofar as gcc supports the -R
option, it supports it by passing it on to the linker.
In fact, the gcc documentation does not even document -R. The GNU
linker documentation does document -R.
On my i386 GNU/Linux system (Fedora Core 1) I get this:
gossamer> gcc -R/tmp -o hello hello.o
gcc: unrecognized option `-R/tmp'
gossamer> gcc -Wl,-R/tmp -o hello hello.o
gossamer> objdump -p hello | grep RPATH
RPATH /tmp
> > the -R option actually used when linking gcc?
>
> Obviously were the LDFLAGS not used...
The obvious case is that things work correctly. When things fail to
work, you must look at what actually happened, not at what is obvious.
It might possibly be worth trying
LDFLAGS="-Wl,-R/usr/local/lib" ../configure
Hard to say.
Ian