[opensuse] gcc Linking Problem
Hello folks! During the course of trying to build an app from the tgz sources, I received an odd looking message that gcc could not create an executable. After a little research, I tried to compile the canonical "Hello, world" program with this: gcc -o hello hello.c and I got this: daniel@danny:~> gcc -o hello hello.c /usr/lib/gcc/i586-suse-linux/4.1.2/../../../crt1.o: In function `_start': (.text+0xc): undefined reference to `__libc_csu_fini' /usr/lib/gcc/i586-suse-linux/4.1.2/../../../crt1.o: In function `_start': (.text+0x11): undefined reference to `__libc_csu_init' collect2: ld returned 1 exit status I've never seen anything like that before (since SuSE 6.1). Can anyone tell me what's going on here & how to fix it? Environment: openSUSE 10.2, kernel 2.6.18.8-0.3-default. I'm using gcc as provided. gcc -v gives: Using built-in specs. Target: i586-suse-linux Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.2 --enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --program-suffix=-4.1 --enable-version-specific-runtime-libs --without-system-libunwind --with-cpu=generic --host=i586-suse-linux Thread model: posix gcc version 4.1.2 20061115 (prerelease) (SUSE Linux) ld -v gives: GNU ld version 2.17.50.0.5 20060927 (SUSE Linux) Cheers, Daniel
On Fri, 27 Jul 2007 10:42:11 +0300
Daniel Feiglin
Hello folks!
During the course of trying to build an app from the tgz sources, I received an odd looking message that gcc could not create an executable.
After a little research, I tried to compile the canonical "Hello, world" program with this:
gcc -o hello hello.c
and I got this:
daniel@danny:~> gcc -o hello hello.c /usr/lib/gcc/i586-suse-linux/4.1.2/../../../crt1.o: In function `_start': (.text+0xc): undefined reference to `__libc_csu_fini' /usr/lib/gcc/i586-suse-linux/4.1.2/../../../crt1.o: In function `_start': (.text+0x11): undefined reference to `__libc_csu_init' collect2: ld returned 1 exit status
I've never seen anything like that before (since SuSE 6.1). Can anyone tell me what's going on here & how to fix it?
Environment: openSUSE 10.2, kernel 2.6.18.8-0.3-default. I'm using gcc as provided. gcc -v gives: Using built-in specs. Target: i586-suse-linux Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.2 --enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --program-suffix=-4.1 --enable-version-specific-runtime-libs --without-system-libunwind --with-cpu=generic --host=i586-suse-linux Thread model: posix gcc version 4.1.2 20061115 (prerelease) (SUSE Linux)
ld -v gives: GNU ld version 2.17.50.0.5 20060927 (SUSE Linux)
I would suggest that you may be missing some packages. Check YaST to
make sure that GCC is installed properly. I saw this a few weeks ago
when I was trying to run an old version of gcc (3.3.3). If everything
looks ok, then reinstall gcc and glibc. After reinstalling, just try
recompiling hello.c.
--
Jerry Feldman
Jerry Feldman wrote:
On Fri, 27 Jul 2007 10:42:11 +0300 Daniel Feiglin
wrote: Hello folks!
During the course of trying to build an app from the tgz sources, I received an odd looking message that gcc could not create an executable.
After a little research, I tried to compile the canonical "Hello, world" program with this:
gcc -o hello hello.c
and I got this:
daniel@danny:~> gcc -o hello hello.c /usr/lib/gcc/i586-suse-linux/4.1.2/../../../crt1.o: In function `_start': (.text+0xc): undefined reference to `__libc_csu_fini' /usr/lib/gcc/i586-suse-linux/4.1.2/../../../crt1.o: In function `_start': (.text+0x11): undefined reference to `__libc_csu_init' collect2: ld returned 1 exit status
I've never seen anything like that before (since SuSE 6.1). Can anyone tell me what's going on here & how to fix it?
Environment: openSUSE 10.2, kernel 2.6.18.8-0.3-default. I'm using gcc as provided. gcc -v gives: Using built-in specs. Target: i586-suse-linux Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.2 --enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --program-suffix=-4.1 --enable-version-specific-runtime-libs --without-system-libunwind --with-cpu=generic --host=i586-suse-linux Thread model: posix gcc version 4.1.2 20061115 (prerelease) (SUSE Linux)
ld -v gives: GNU ld version 2.17.50.0.5 20060927 (SUSE Linux)
I would suggest that you may be missing some packages. Check YaST to make sure that GCC is installed properly. I saw this a few weeks ago when I was trying to run an old version of gcc (3.3.3). If everything looks ok, then reinstall gcc and glibc. After reinstalling, just try recompiling hello.c.
Ouch! That's not very practicable. If you try to delete gcc and glibc you get a long lists of dependencies that will be broken - including simple apps, KDE, Xorg and whatever.. But problem solved a different way: 1. A static compile worked so the problem had to be with libc.so. 2. And of course it was - a renamed pointer (left over from trying to get Google Earth to tun a few months back). Thank anyway - and the moral of the story is that the days of frigging around with simple things (?) like gcc and glibc - have come and gone.
On Sun, 29 Jul 2007 10:44:50 +0300
Daniel Feiglin
That's not very practicable. If you try to delete gcc and glibc you get a long lists of dependencies that will be broken - including simple apps, KDE, Xorg and whatever..
I didn't say delete, I said reinstall. YaST will take care of the
dependencies.
In any case, you solved the problem.
--
Jerry Feldman
On Sun, 29 Jul 2007 10:44:50 +0300, Daniel Feiglin wrote:
Thank anyway - and the moral of the story is that the days of frigging around with simple things (?) like gcc and glibc - have come and gone.
Neither gcc nor glibc are simple things! As everything in the distribution (with a few exceptions) is linked dynamically, your whole system depends on glibc. If you trash glibc, your whole systems stops to function. Tinkering with gcc and glibc should only be done by someone who knows exactly what he's doing and of the consequences his doing will have. Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Daniel Feiglin
-
Jerry Feldman
-
Philipp Thomas