This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
rpath and libtool == testsuite woes
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 07 Aug 2003 14:59:55 +0930
- Subject: rpath and libtool == testsuite woes
Why do we use rpath anywhere in the gcc build process? In particular,
using --rpath /usr/local/lib on a linux system doesn't make much sense,
the major problem being that DT_RPATH takes precedence over
LD_LIBRARY_PATH.
I'm seeing lots of libjava testsuite failures with a powerpc-linux
native build, gcc-3.3 installed as the system compiler. eg.
Executing on host: /usr/tmp/ppc/gcc-curr/powerpc-linux/libjava/testsuite/../libtool --silent --tag=GCJ --mode=link /usr/tmp/ppc/gcc-curr/gcc/gcj -B/usr/tmp/ppc/gcc-curr/gcc/ --encoding=UTF-8 -B/usr/tmp/ppc/gcc-curr/powerpc-linux/./libjava/ /src/gcc-current/libjava/testsuite/libjava.jni/cxxtest.java -no-install -fjni -L. -lcxxtest -L/usr/tmp/ppc/gcc-curr/powerpc-linux/./libstdc++-v3/src -lstdc++ --main=cxxtest -g -L/usr/tmp/ppc/gcc-curr/powerpc-linux/./libjava/.libs -L/usr/tmp/ppc/gcc-curr/powerpc-linux/./boehm-gc/.libs -lm -o cxxtest (timeout = 300)
PASS: linking cxxtest
./cxxtest: /usr/local/lib/libgcc_s.so.1: version `GCC_3.3' not found (required by /usr/tmp/ppc/gcc-curr/powerpc-linux/./libstdc++-v3/src/.libs/libstdc++.so.6)
./cxxtest: /usr/local/lib/libgcc_s.so.1: version `GCC_3.3' not found (required by /usr/tmp/ppc/gcc-curr/powerpc-linux/./libjava/.libs/libgcj.so.4)
FAIL: cxxtest run
Obviously, we're picking up the wrong libgcc_s.so. Turns out this is
because libtool is passing --rpath /usr/local/lib to the linker.
/usr/tmp/ppc/gcc-curr/gcc/gcj -B/usr/tmp/ppc/gcc-curr/gcc/ --encoding=UTF-8 -B/usr/tmp/ppc/gcc-curr/powerpc-linux/./libjava/ /src/gcc-current/libjava/testsuite/libjava.jni/cxxtest.java -fjni --main=cxxtest -g -o cxxtest -L/usr/tmp/ppc/gcc-curr/powerpc-linux/libjava/testsuite -lcxxtest -L/usr/tmp/ppc/gcc-curr/powerpc-linux/./libstdc++-v3/src /usr/tmp/ppc/gcc-curr/powerpc-linux/./libstdc++-v3/src/.libs/libstdc++.so -L/usr/tmp/ppc/gcc-curr/powerpc-linux/libstdc++-v3/src -L/usr/tmp/ppc/gcc-curr/powerpc-linux/libstdc++-v3/src/.libs -lm -lm -lm -L/usr/tmp/ppc/gcc-curr/gcc -L/usr/local/powerpc-linux/bin -L/usr/local/powerpc-linux/lib -L/usr/local/lib/../powerpc-linux/lib -L/usr/local/lib -lgcc_s -lc -lgcc_s -lm -lgcc_s -lc -lgcc_s -L/usr/tmp/ppc/gcc-curr/powerpc-linux/./libjava/.libs -L/usr/tmp/ppc/gcc-curr/powerpc-linux/./boehm-gc/.libs -lm -Wl,--rpath -Wl,/usr/tmp/ppc/gcc-curr/powerpc-linux/./libstdc++-v3/src/.libs -Wl,--rpath -Wl,/usr/local/lib
--
Alan Modra
IBM OzLabs - Linux Technology Centre