Hello,
I'm afraid I don't quite understand what the --enable-version-specific-runtime-libs configure option is supposed to do. I've just built gcc-3.4.3 from source with the following options:
../gcc-3.4.3/configure --prefix=/local/gonzalez/gcc-3.4.3 --program-suffix=-3.4.3 --with-arch=pentium4 --disable-nls --enable-version-specific-runtime-libs --enable-languages=c,c++
Thread model: posix
gcc version 3.4.3
My impression was that the option allowed several versions of GCC to coexist peacefully. If I have e.g. 4 different versions of GCC (3.4.0, 3.4.1, 3.4.2, 3.4.3), each with its own libstdc++.so.6, I thought the driver would be smart enough to use the version specific library (as the option name implies).
For example, the g++ driver could set LD_RUN_PATH, or add the appropriate -Wl,rpath command when calling the linker?
However...
$ cat toto.cxx int main(void) { return 0; }
gonzalez@ulysse ~$ g++-3.4.3 -v toto.cxx
Reading specs from /local/gonzalez/gcc-3.4.3/lib/gcc/i686-pc-linux-gnu/3.4.3/specs
Configured with: ../gcc-3.4.3/configure --prefix=/local/gonzalez/gcc-3.4.3 --program-suffix=-3.4.3 --with-arch=pentium4 --disable-nls --enable-version-specific-runtime-libs --enable-languages=c,c++
Thread model: posix
gcc version 3.4.3
/local/gonzalez/gcc-3.4.3/libexec/gcc/i686-pc-linux-gnu/3.4.3/cc1plus -quiet -v -D_GNU_SOURCE toto.cxx -quiet -dumpbase toto.cxx -march=pentium4 -auxbase toto -version -o /tmp/ccR2CHod.s
ignoring nonexistent directory "/local/gonzalez/gcc-3.4.3/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/local/gonzalez/gcc-3.4.3/lib/gcc/i686-pc-linux-gnu/3.4.3/include/c++
/local/gonzalez/gcc-3.4.3/lib/gcc/i686-pc-linux-gnu/3.4.3/include/c++/i686-pc-linux-gnu
/local/gonzalez/gcc-3.4.3/lib/gcc/i686-pc-linux-gnu/3.4.3/include/c++/backward
/usr/local/include
/local/gonzalez/gcc-3.4.3/include
/local/gonzalez/gcc-3.4.3/lib/gcc/i686-pc-linux-gnu/3.4.3/include
/usr/include
End of search list.
GNU C++ version 3.4.3 (i686-pc-linux-gnu)
compiled by GNU C version 3.4.3.
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=129032
as -V -Qy -o /tmp/ccyF5mDf.o /tmp/ccR2CHod.s
GNU assembler version 2.13.90.0.18 (i386-redhat-linux) using BFD version 2.13.90.0.18 20030206
/local/gonzalez/gcc-3.4.3/libexec/gcc/i686-pc-linux-gnu/3.4.3/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /local/gonzalez/gcc-3.4.3/lib/gcc/i686-pc-linux-gnu/3.4.3/crtbegin.o -L/local/gonzalez/gcc-3.4.3/lib/gcc/i686-pc-linux-gnu/3.4.3 -L/local/gonzalez/gcc-3.4.3/lib/gcc/i686-pc-linux-gnu/3.4.3/../../.. /tmp/ccyF5mDf.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /local/gonzalez/gcc-3.4.3/lib/gcc/i686-pc-linux-gnu/3.4.3/crtend.o /usr/lib/crtn.o
$ ldd a.out libstdc++.so.6 => not found libm.so.6 => /lib/i686/libm.so.6 (0x4002d000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4004f000) libc.so.6 => /lib/i686/libc.so.6 (0x40058000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
I must have missed something. How am I supposed to make multiple version-specific libstdc++.so.6 versions coexist. If I set LD_LIBRARY_PATH, it seems the same libstdc++.so.6 will be used every time instead of the version-specific one? I could set LD_RUN_PATH to the proper path before I use each version, but I thought the g++ driver would do that?
-- Regards, Grumble