Bug 38628 - no 4.3.3 libraries for non-C languages if 4.3.3 and 4.4.0 in parallel
Summary: no 4.3.3 libraries for non-C languages if 4.3.3 and 4.4.0 in parallel
Status: RESOLVED DUPLICATE of bug 346
Alias: None
Product: gcc
Classification: Unclassified
Component: driver (show other bugs)
Version: 4.4.0
: P3 major
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: link-failure
Depends on:
Blocks:
 
Reported: 2008-12-26 10:42 UTC by Thomas Koenig
Modified: 2010-05-22 18:00 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Koenig 2008-12-26 10:42:00 UTC
I just did a bootstrap with 4.4.0 and 4.3.3 with the
latest trunk respectively branch, with identical prefixes:

tkoenig@gcc16:~$ gfortran -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/home/tkoenig --enable-languages=c,fortran,c++ --with-gmp=/opt/cfarm/mpfr-2.3.1/
Thread model: posix
gcc version 4.4.0 20081226 (experimental) (GCC)
tkoenig@gcc16:~$ gfortran -V4.3.3 -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4_3/configure --prefix=/home/tkoenig --enable-languages=c,fortran,c++ --with-gmp=/opt/cfarm/mpfr-2.3.2/
Thread model: posix
gcc version 4.3.3 20081226 (prerelease) (GCC)
tkoenig@gcc16:~$ which gfortran
/home/tkoenig/bin/gfortran

First, I installed 4.3.3, then I installed 4.4.0.

Now, 4.3.3 cannot find its libraries, with or without -static:

tkoenig@gcc16:/tmp$ gfortran -V4.3.3 hello.f90 && ./a.out
/usr/lib/../lib64/crt1.o: In function `_start':
../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
/tmp/ccCDPugS.o: In function `MAIN__':
hello.f90:(.text+0x16): undefined reference to `_gfortran_set_options'
hello.f90:(.text+0x4b): undefined reference to `_gfortran_st_write'
hello.f90:(.text+0x61): undefined reference to `_gfortran_transfer_character'
hello.f90:(.text+0x6d): undefined reference to `_gfortran_st_write_done'
collect2: ld returned 1 exit status
tkoenig@gcc16:/tmp$ gfortran  -V4.3.3 -static hello.f90 && ./a.out
/usr/lib/../lib64/crt1.o: In function `_start':
../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
/tmp/cceKTvXP.o: In function `MAIN__':
hello.f90:(.text+0x16): undefined reference to `_gfortran_set_options'
hello.f90:(.text+0x4b): undefined reference to `_gfortran_st_write'
hello.f90:(.text+0x61): undefined reference to `_gfortran_transfer_character'
hello.f90:(.text+0x6d): undefined reference to `_gfortran_st_write_done'
collect2: ld returned 1 exit status

LD_LIBRARY_PATH=/home/tkoenig/lib64/

Am I doing something really stupid here?

Following is an strace to check where the compiler really is looking...

tkoenig@gcc16:/tmp$ strace -f -eopen,execve gfortran -V4.3.3 hello.f90
execve("/home/tkoenig/bin/gfortran", ["gfortran", "-V4.3.3", "hello.f90"], [/* 22 vars */]) = 0
open("/home/tkoenig/lib64/tls/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/lib64/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/lib64/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/libc.so.6", O_RDONLY)        = 3
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
open("/home/tkoenig/share/locale/en_US.UTF-8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/share/locale/en_US.utf8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/share/locale/en_US/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/share/locale/en.UTF-8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/share/locale/en.utf8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/share/locale/en/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
execve("/opt/cfarm/autoconf-2.59/bin//x86_64-unknown-linux-gnu-gcc-4.3.3", ["x86_64-unknown-linux-gnu-gcc-4.3"..., "hello.f90"], [/* 23 vars */]) = -1 ENOENT (No such file or directory)
execve("/home/tkoenig/bin/x86_64-unknown-linux-gnu-gcc-4.3.3", ["x86_64-unknown-linux-gnu-gcc-4.3"..., "hello.f90"], [/* 23 vars */]) = 0
open("/home/tkoenig/lib64/tls/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/lib64/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/lib64/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/libc.so.6", O_RDONLY)        = 3
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
open("/home/tkoenig/share/locale/en_US.UTF-8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/share/locale/en_US.utf8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/share/locale/en_US/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/share/locale/en.UTF-8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/share/locale/en.utf8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/tkoenig/share/locale/en/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/tmp/ccLFd6Zj.s", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
Process 15557 attached
Process 15556 suspended
[pid 15557] execve("/home/tkoenig/libexec/gcc/x86_64-unknown-linux-gnu/4.3.3/f951", ["/home/tkoenig/libexec/gcc/x86_64"..., "hello.f90", "-quiet", "-dumpbase", "hello.f90", "-mtune=generic", "-auxbase", "hello", "-fintrinsic-modules-path", "/home/tkoenig/lib/gcc/x86_64-unk"..., "-o", "/tmp/ccLFd6Zj.s"], [/* 24 vars */]) = 0
[pid 15557] open("/home/tkoenig/lib64/tls/x86_64/libgmp.so.3", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15557] open("/home/tkoenig/lib64/tls/libgmp.so.3", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15557] open("/home/tkoenig/lib64/x86_64/libgmp.so.3", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15557] open("/home/tkoenig/lib64/libgmp.so.3", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15557] open("/etc/ld.so.cache", O_RDONLY) = 3
[pid 15557] open("/usr/lib/libgmp.so.3", O_RDONLY) = 3
[pid 15557] open("/home/tkoenig/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15557] open("/lib/libc.so.6", O_RDONLY) = 3
[pid 15557] open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
[pid 15557] open("/usr/share/locale/locale.alias", O_RDONLY) = 3
[pid 15557] open("/home/tkoenig/share/locale/en_US.UTF-8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15557] open("/home/tkoenig/share/locale/en_US.utf8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15557] open("/home/tkoenig/share/locale/en_US/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15557] open("/home/tkoenig/share/locale/en.UTF-8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15557] open("/home/tkoenig/share/locale/en.utf8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15557] open("/home/tkoenig/share/locale/en/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15557] open("/etc/mtab", O_RDONLY) = 3
[pid 15557] open("/proc/meminfo", O_RDONLY) = 3
[pid 15557] open("/etc/mtab", O_RDONLY) = 3
[pid 15557] open("/proc/meminfo", O_RDONLY) = 3
[pid 15557] open("/etc/mtab", O_RDONLY) = 3
[pid 15557] open("/proc/meminfo", O_RDONLY) = 3
[pid 15557] open("hello.f90", O_RDONLY) = 3
[pid 15557] open("/tmp/ccLFd6Zj.s", O_RDWR|O_CREAT|O_TRUNC, 0666) = 3
[pid 15557] open("hello.gcda", O_RDWR)  = -1 ENOENT (No such file or directory)
Process 15556 resumed
Process 15557 detached
--- SIGCHLD (Child exited) @ 0 (0) ---
open("/tmp/cc7ebrol.o", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
Process 15558 attached
Process 15556 suspended
[pid 15558] execve("/opt/cfarm/autoconf-2.59/bin//as", ["as", "-Qy", "-o", "/tmp/cc7ebrol.o", "/tmp/ccLFd6Zj.s"], [/* 24 vars */]) = -1 ENOENT (No such file or directory)
[pid 15558] execve("/home/tkoenig/bin/as", ["as", "-Qy", "-o", "/tmp/cc7ebrol.o", "/tmp/ccLFd6Zj.s"], [/* 24 vars */]) = -1 ENOENT (No such file or directory)
[pid 15558] execve("/usr/local/bin/as", ["as", "-Qy", "-o", "/tmp/cc7ebrol.o", "/tmp/ccLFd6Zj.s"], [/* 24 vars */]) = -1 ENOENT (No such file or directory)
[pid 15558] execve("/usr/bin/as", ["as", "-Qy", "-o", "/tmp/cc7ebrol.o", "/tmp/ccLFd6Zj.s"], [/* 24 vars */]) = 0
[pid 15558] open("/home/tkoenig/lib64/tls/x86_64/libbfd-2.17.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15558] open("/home/tkoenig/lib64/tls/libbfd-2.17.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15558] open("/home/tkoenig/lib64/x86_64/libbfd-2.17.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15558] open("/home/tkoenig/lib64/libbfd-2.17.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15558] open("/etc/ld.so.cache", O_RDONLY) = 3
[pid 15558] open("/usr/lib/libbfd-2.17.so", O_RDONLY) = 3
[pid 15558] open("/home/tkoenig/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15558] open("/lib/libc.so.6", O_RDONLY) = 3
[pid 15558] open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
[pid 15558] open("/tmp/cc7ebrol.o", O_RDWR|O_CREAT|O_TRUNC, 0666) = 3
[pid 15558] open("/tmp/ccLFd6Zj.s", O_RDONLY) = 4
[pid 15558] open("/usr/share/locale/locale.alias", O_RDONLY) = 4
[pid 15558] open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/gas.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15558] open("/usr/share/locale/en_US.utf8/LC_MESSAGES/gas.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15558] open("/usr/share/locale/en_US/LC_MESSAGES/gas.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15558] open("/usr/share/locale/en.UTF-8/LC_MESSAGES/gas.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15558] open("/usr/share/locale/en.utf8/LC_MESSAGES/gas.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15558] open("/usr/share/locale/en/LC_MESSAGES/gas.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
Process 15556 resumed
Process 15558 detached
--- SIGCHLD (Child exited) @ 0 (0) ---
Process 15559 attached
Process 15556 suspended
[pid 15559] execve("/home/tkoenig/libexec/gcc/x86_64-unknown-linux-gnu/4.3.3/collect2", ["/home/tkoenig/libexec/gcc/x86_64"..., "--eh-frame-hdr", "-m", "elf_x86_64", "-dynamic-linker", "/lib64/ld-linux-x86-64.so.2", "/usr/lib/../lib64/crt1.o", "/usr/lib/../lib64/crti.o", "/home/tkoenig/lib/gcc/x86_64-unk"..., "-L/home/tkoenig/lib/gcc/x86_64-u"..., "-L/home/tkoenig/lib/gcc/x86_64-u"..., "-L/lib/../lib64", "-L/usr/lib/../lib64", "-L/home/tkoenig/lib/gcc/x86_64-u"..., "/tmp/cc7ebrol.o", "-lgcc", ...], [/* 26 vars */]) = 0
[pid 15559] open("/home/tkoenig/lib64/tls/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15559] open("/home/tkoenig/lib64/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15559] open("/home/tkoenig/lib64/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15559] open("/home/tkoenig/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15559] open("/etc/ld.so.cache", O_RDONLY) = 3
[pid 15559] open("/lib/libc.so.6", O_RDONLY) = 3
[pid 15559] open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
[pid 15559] open("/usr/share/locale/locale.alias", O_RDONLY) = 3
[pid 15559] open("/home/tkoenig/share/locale/en_US.UTF-8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15559] open("/home/tkoenig/share/locale/en_US.utf8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15559] open("/home/tkoenig/share/locale/en_US/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15559] open("/home/tkoenig/share/locale/en.UTF-8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15559] open("/home/tkoenig/share/locale/en.utf8/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15559] open("/home/tkoenig/share/locale/en/LC_MESSAGES/gcc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15559] open("/tmp/ccZk0yja.c", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
[pid 15559] open("/tmp/cc83Gyta.o", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
[pid 15559] open("/tmp/ccHUqtDa.ld", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
[pid 15559] open("/tmp/ccA3S2Pa.le", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
[pid 15559] open("/tmp/ccHUqtDa.ld", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
[pid 15559] open("/tmp/ccA3S2Pa.le", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
Process 15560 attached
Process 15559 suspended
[pid 15560] execve("/usr/bin/ld", ["/usr/bin/ld", "--eh-frame-hdr", "-m", "elf_x86_64", "-dynamic-linker", "/lib64/ld-linux-x86-64.so.2", "/usr/lib/../lib64/crt1.o", "/usr/lib/../lib64/crti.o", "/home/tkoenig/lib/gcc/x86_64-unk"..., "-L/home/tkoenig/lib/gcc/x86_64-u"..., "-L/home/tkoenig/lib/gcc/x86_64-u"..., "-L/lib/../lib64", "-L/usr/lib/../lib64", "-L/home/tkoenig/lib/gcc/x86_64-u"..., "/tmp/cc7ebrol.o", "-lgcc", ...], [/* 27 vars */]) = 0
[pid 15560] open("/home/tkoenig/lib64/tls/x86_64/libbfd-2.17.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/home/tkoenig/lib64/tls/libbfd-2.17.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/home/tkoenig/lib64/x86_64/libbfd-2.17.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/home/tkoenig/lib64/libbfd-2.17.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/etc/ld.so.cache", O_RDONLY) = 3
[pid 15560] open("/usr/lib/libbfd-2.17.so", O_RDONLY) = 3
[pid 15560] open("/home/tkoenig/lib64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/lib/libc.so.6", O_RDONLY) = 3
[pid 15560] open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
[pid 15560] open("a.out", O_RDWR|O_CREAT|O_TRUNC, 0666) = 3
[pid 15560] open("/usr/lib/../lib64/crt1.o", O_RDONLY) = 4
[pid 15560] open("/usr/lib/../lib64/crti.o", O_RDONLY) = 5
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/crtbegin.o", O_RDONLY) = 6
[pid 15560] open("/tmp/cc7ebrol.o", O_RDONLY) = 7
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/libgcc.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/libgcc.a", O_RDONLY) = 8
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib64/libgcc_s.so", O_RDONLY) = 9
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/libc.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/libc.a", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib64/libc.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib64/libc.a", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/lib/../lib64/libc.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/lib/../lib64/libc.a", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/usr/lib/../lib64/libc.so", O_RDONLY) = 10
[pid 15560] open("/usr/lib/../lib64/libc.so", O_RDONLY) = 11
[pid 15560] open("/usr/lib/../lib64/libc.so", O_RDONLY) = 10
[pid 15560] open("/lib/libc.so.6", O_RDONLY) = 11
[pid 15560] open("/usr/lib/libc_nonshared.a", O_RDONLY) = 12
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/libgcc.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/libgcc.a", O_RDONLY) = 13
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/../../../../lib64/libgcc_s.so", O_RDONLY) = 14
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/crtend.o", O_RDONLY) = 3
[pid 15560] open("/usr/lib/../lib64/crtn.o", O_RDONLY) = 4
[pid 15560] open("/home/tkoenig/lib64//ld-linux-x86-64.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/usr/etc/ld.so.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/etc/ld.so.conf", O_RDONLY) = 5
[pid 15560] open("/etc/ld.so.conf.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 15
[pid 15560] open("/etc/ld.so.conf.d/x86_64-linux-gnu.conf", O_RDONLY) = 15
[pid 15560] open("/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/usr/bin/../lib/ld-linux-x86-64.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/usr/x86_64-linux-gnu/lib64/ld-linux-x86-64.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/usr/local/lib64/ld-linux-x86-64.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/lib64/ld-linux-x86-64.so.2", O_RDONLY) = 5
[pid 15560] open("/usr/lib/../lib64/crt1.o", O_RDONLY) = 6
[pid 15560] open("/usr/lib/../lib64/crti.o", O_RDONLY) = 7
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/crtbegin.o", O_RDONLY) = 8
[pid 15560] open("/tmp/cc7ebrol.o", O_RDONLY) = 9
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/libgcc.a", O_RDONLY) = 11
[pid 15560] open("/lib/libc.so.6", O_RDONLY) = 12
[pid 15560] open("/usr/lib/libc_nonshared.a", O_RDONLY) = 5
[pid 15560] open("/lib64/ld-linux-x86-64.so.2", O_RDONLY) = 6
[pid 15560] open("/usr/share/locale/locale.alias", O_RDONLY) = 14
[pid 15560] open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/ld.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/usr/share/locale/en_US.utf8/LC_MESSAGES/ld.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/usr/share/locale/en_US/LC_MESSAGES/ld.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/usr/share/locale/en.UTF-8/LC_MESSAGES/ld.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/usr/share/locale/en.utf8/LC_MESSAGES/ld.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("/usr/share/locale/en/LC_MESSAGES/ld.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15560] open("a.out", O_RDWR)       = 7
[pid 15560] open("/usr/lib/../lib64/crt1.o", O_RDONLY) = 8
[pid 15560] open("/usr/lib/../lib64/crti.o", O_RDONLY) = 11
[pid 15560] open("/home/tkoenig/lib/gcc/x86_64-unknown-linux-gnu/4.3.3/crtbegin.o", O_RDONLY) = 13
Process 15559 resumed
Process 15560 detached
[pid 15559] --- SIGCHLD (Child exited) @ 0 (0) ---
[pid 15559] open("/tmp/ccHUqtDa.ld", O_RDONLY) = 3
[pid 15559] open("/tmp/ccA3S2Pa.le", O_RDONLY) = 3
/usr/lib/../lib64/crt1.o: In function `_start':
../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
/tmp/cc7ebrol.o: In function `MAIN__':
hello.f90:(.text+0x16): undefined reference to `_gfortran_set_options'
hello.f90:(.text+0x4b): undefined reference to `_gfortran_st_write'
hello.f90:(.text+0x61): undefined reference to `_gfortran_transfer_character'
hello.f90:(.text+0x6d): undefined reference to `_gfortran_st_write_done'
collect2: ld returned 1 exit status
[pid 15559] open("/tmp/ccHUqtDa.ld", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 15559] open("/tmp/ccA3S2Pa.le", O_RDONLY) = -1 ENOENT (No such file or directory)
Process 15556 resumed
Process 15559 detached
--- SIGCHLD (Child exited) @ 0 (0) ---
Process 15556 detached
Comment 1 Thomas Koenig 2008-12-26 10:54:01 UTC
Same problem with g++:

tkoenig@gcc16:/tmp$ g++ hello.cc
tkoenig@gcc16:/tmp$ g++ -V4.3.3 hello.cc
/tmp/ccQtuMbq.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
tkoenig@gcc16:/tmp$

Adjusting subject.

Hmm... just wondering, did this ever work?
Comment 2 Daniel Franke 2008-12-26 12:53:53 UTC
--enable-version-specific-runtime-libs, maybe?
Comment 3 Andrew Pinski 2008-12-26 13:34:29 UTC
IIRC this is by design.
Comment 4 Thomas Koenig 2008-12-26 15:44:41 UTC
(In reply to comment #3)
> IIRC this is by design.

What on earth for?

Especially, what could be the reason for having -V, while making sure
it doesn't work?

I'll try the switch suggested by Daniel.

Comment 5 Thomas Koenig 2008-12-26 16:40:40 UTC
(In reply to comment #2)
> --enable-version-specific-runtime-libs, maybe?
> 

Doesn't do what I want:

tkoenig@gcc16:/tmp$ g++ -V4.3.3 -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4_3/configure --prefix=/home/tkoenig --enable-languages=c,fortran,c++ --with-gmp=/opt/cfarm/mpfr-2.3.2/ --enable-version-specific-runtime-libs
Thread model: posix
gcc version 4.3.3 20081226 (prerelease) (GCC)
tkoenig@gcc16:/tmp$ g++ -V4.3.3 hello.cc
/tmp/cc40A3Ee.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
tkoenig@gcc16:/tmp$                                   
Comment 6 Daniel Franke 2008-12-26 17:31:19 UTC
Just to make sure, you cleaned out the prefix before?

I use a similar setup at work, 4.2, 4.3 and trunk, all in the same prefix. Besides "--enable-version-specific-runtime-libs", I also have "--program-suffix=-${branch}". The binaries are called gfortran-4.2, gfortran-4.3 and gfortran-svn and this works nicely for me.
Comment 7 Andrew Pinski 2008-12-26 17:49:07 UTC
That is because when you use -V, it calls ${target}-gcc-4.3 rather than ${target}-gfortran-4.3 or ${target}-4.3-g++.
Comment 8 Andrew Pinski 2008-12-26 17:50:32 UTC
Plus this is documented this way:
http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Target-Options.html#index-V-901
Comment 9 Andrew Pinski 2008-12-26 17:50:43 UTC
The -V and -b options work by running the <machine>-gcc-<version> executable, so there's no real reason to use them if you can just run that directly.
Comment 10 Thomas Koenig 2008-12-26 22:48:09 UTC
(In reply to comment #8)
> Plus this is documented this way:
> http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Target-Options.html#index-V-901

I see this works for gcc.  I also see (in the 4.4.0 docs)

# The C++ compiler is G++, the Ada compiler is GNAT, and so on.  When we
# talk about compiling one of those languages, we might refer to that
# compiler by its own name, or as GCC.  Either is correct.

In the text you quoted, it says

# The argument version specifies which version of GCC to run.

so GCC clearly refers to any of the suite of GCC compilers, not just the
gcc command itself.

The documentation doesn't match what's happening, so this is a bug.
Comment 11 Joseph S. Myers 2010-05-22 18:00:52 UTC
-V and -b have been removed, if anything is left here it's a duplicate
of bug 346.


*** This bug has been marked as a duplicate of 346 ***