Hi,
I want to use GCC 4.1.2 on a SLES 11.0 x86_64 system. SLES 11 comes with GCC 4.3, so I compiled 4.1.2 and `make install`'d myself. When trying to use it, I get:
Code:
# /usr/local/bin/gcc-4.1 hello.c
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
hello.c is simply:
Code:
#include <stdio.h>
int main () {
printf("hello world\n");
}
lgcc_s is libgcc_s.so.1 which is found in both /usr/local/lib/gcc/x86_64-suse-linux/lib64 and /usr/local/lib/gcc/x86_64-suse-linux/lib.
`/usr/local/bin/gcc-4.1 -static hello.c` works.
`/usr/local/bin/gcc-4.1 -L/usr/local/lib/gcc/x86_64-suse-linux/lib64 hello.c` works.
`/usr/bin/gcc-4.3 hello.c` works.
I created /etc/ld.so.conf.d/gcc-412.conf and added "/usr/local/lib/gcc/x86_64-suse-linux/lib64" and "/usr/local/lib/gcc/x86_64-suse-linux/lib" to it. I ran `ldconfig -v` and it does find them:
Code:
/usr/local/lib/gcc/x86_64-suse-linux/lib64:
libgcc_s.so.1 -> libgcc_s.so.1
/usr/local/lib/gcc/x86_64-suse-linux/lib:
libgcc_s.so.1 -> libgcc_s.so.1
However, I still get "cannot find -lgcc_s."
I did run the gcc test suites and there were only 12 unexpected failures or successes out of 55k, which the install page says is to be expected.
I ./configured gcc with
Quote:
Target: x86_64-suse-linux
Configured with: ../gcc-4.1.2/configure --enable-languages=c,c++ --enable-ssp --disable-libssp --disable-libgcj --disable-libmudflap --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --program-suffix=-4.1 --enable-linux-futex --without-system-libunwind --build=x86_64-suse-linux --host=x86_64-suse-linux
|
-- basically, I took SLES' gcc-4.3 ./configure line and removed the prefix & path directives and changed the program suffix. Considering I don't know the use of half those options I'm trying again taking as many defaults as possible.
But I don't know what I am missing. How do I get it so that I don't have to use -L or -static to use my gcc-4.1?