------- Comment #9 from martin dot drab at fjfi dot cvut dot cz  2008-05-23 
11:09 -------
OK, so I tried to compile with autogenerated paths just from the prefix, and
with the --enable-version-specific-runtime-libs option. The path no longer
seems corrupted. It searches all its internal include directories properly now.

So, that rises a question. Why there is the posibility to explicitly set all
the various directories (like --libdir, --libexecdir, --includedir, ...etc.),
when if you set them gcc can't handle it?

And there is also one more problem with the paths. I tried the simple example
with the

----x.cc--------------
#include <streambuf>
int main () {return 0;}
---------------------

as in the initial report. See what it produces below. Though includes are found
fine, this time it is the libgcc_s, that is not found. For some reason, it is
generated to an entirely different directory than all other libraries of the
gcc. While most of the libraries are generated into the
<prefix>/lib/gcc/<arch>/<version>/ (for 64-bit libs) and
<prefix>/lib/gcc/<arch>/<version>/32 (for 32-bit libs), the libgcc_s is for
some unknown reason generated into the <prefix>/lib/gcc/<arch>/lib64/ and
<prefix>/lib/gcc/<arch>/lib32/ directories respectively, and gcc can't find
them since it does not pass these paths to the linker. Why is that?

----------------
$ gcc -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: ../../../gcc-SVN-20080522/gcc-SVN-20080522/configure
--build=x86_64-pc-linux-gnu --prefix=/usr/local/opt/MDL/opt/gcc-4.4
--program-suffix=-4.4 --sharedstatedir=/var --localstatedir=/var
--enable-languages=c,c++,fortran --enable-generated-files-in-srcdir
--enable-targets=all --disable-libada --enable-libssp --disable-werror
--enable-shared --enable-static --enable-parallel-mark
--enable-version-specific-runtime-libs --with-gnu-ld --disable-werror-always
--enable-multilib --enable-threads=posix --enable-tls --disable-rpath
--with-demangler-in-ld --with-gnu-as --with-x --disable-coverage
--disable-checking --enable-visibility --with-arch=core2
Thread model: posix
gcc version 4.4.0 20080522 (experimental) (GCC)
----------------

----------------
$ g++ -o x x.cc -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: ../../../gcc-SVN-20080522/gcc-SVN-20080522/configure
--build=x86_64-pc-linux-gnu --prefix=/usr/local/opt/MDL/opt/gcc-4.4
--program-suffix=-4.4 --sharedstatedir=/var --localstatedir=/var
--enable-languages=c,c++,fortran --enable-generated-files-in-srcdir
--enable-targets=all --disable-libada --enable-libssp --disable-werror
--enable-shared --enable-static --enable-parallel-mark
--enable-version-specific-runtime-libs --with-gnu-ld --disable-werror-always
--enable-multilib --enable-threads=posix --enable-tls --disable-rpath
--with-demangler-in-ld --with-gnu-as --with-x --disable-coverage
--disable-checking --enable-visibility --with-arch=core2
Thread model: posix
gcc version 4.4.0 20080522 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-o' 'x' '-v' '-shared-libgcc' '-mtune=generic'
'-march=core2'
 /usr/local/opt/MDL/opt/gcc-4.4/libexec/gcc/x86_64-pc-linux-gnu/4.4.0/cc1plus
-quiet -v -D_GNU_SOURCE x.cc -quiet -dumpbase x.cc -mtune=generic -march=core2
-auxbase x -version -o /tmp/ccNva0wT.s
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/local/opt/MDL/opt/gcc-4.4/include"
ignoring nonexistent directory
"/usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/../../../../x86_64-pc-linux-gnu/include"
ignoring duplicate directory "/usr/local/opt/MDL/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/opt/MDL/include
 /usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/include/c++

/usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/include/c++/x86_64-pc-linux-gnu

/usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/include/c++/backward
 /usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/include
 /usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/include-fixed
 /usr/include
End of search list.
GNU C++ (GCC) version 4.4.0 20080522 (experimental) (x86_64-pc-linux-gnu)
        compiled by GNU C version 4.4.0 20080522 (experimental), GMP version
4.2.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: f17dd6d038665e28e2542948829f7272
COLLECT_GCC_OPTIONS='-o' 'x' '-v' '-shared-libgcc' '-mtune=generic'
'-march=core2'
 as -v -V -Qy -o /tmp/ccaFqdPM.o /tmp/ccNva0wT.s
GNU assembler version 2.18.50 (x86_64-pc-linux-gnu) using BFD version (GNU
Binutils) 2.18.50.20080413
COMPILER_PATH=/usr/local/opt/MDL/opt/gcc-4.4/libexec/gcc/x86_64-pc-linux-gnu/4.4.0/:/usr/local/opt/MDL/opt/gcc-4.4/libexec/gcc/x86_64-pc-linux-gnu/4.4.0/:/usr/local/opt/MDL/opt/gcc-4.4/libexec/gcc/x86_64-pc-linux-gnu/:/usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/:/usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/:/usr/libexec/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/
LIBRARY_PATH=/usr/local/opt/MDL/lib/../lib64/:/usr/local/opt/MDL/lib32/../lib64/:/usr/local/opt/MDL/lib/../lib64/:/usr/local/opt/MDL/lib32/../lib64/:/usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/:/usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/local/opt/MDL/lib/:/usr/local/opt/MDL/lib32/:/usr/local/opt/MDL/lib/:/usr/local/opt/MDL/lib32/:/usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-o' 'x' '-v' '-shared-libgcc' '-mtune=generic'
'-march=core2'
 /usr/local/opt/MDL/opt/gcc-4.4/libexec/gcc/x86_64-pc-linux-gnu/4.4.0/collect2
--eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o x
/usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o
/usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/crtbegin.o
-L/usr/local/opt/MDL/lib/../lib64 -L/usr/local/opt/MDL/lib32/../lib64
-L/usr/local/opt/MDL/lib/../lib64 -L/usr/local/opt/MDL/lib32/../lib64
-L/usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0
-L/usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/local/opt/MDL/lib
-L/usr/local/opt/MDL/lib32 -L/usr/local/opt/MDL/lib -L/usr/local/opt/MDL/lib32
-L/usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/../../..
/tmp/ccaFqdPM.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/local/opt/MDL/opt/gcc-4.4/lib/gcc/x86_64-pc-linux-gnu/4.4.0/crtend.o
/usr/lib/../lib64/crtn.o
/usr/local/opt/MDL/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
----------------


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36213

Reply via email to