LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   can't compile; configure won't complete: "C compiler cannot create executables" (https://www.linuxquestions.org/questions/slackware-14/can%27t-compile%3B-configure-won%27t-complete-c-compiler-cannot-create-executables-546737/)

pbhj 04-17-2007 07:34 AM

can't compile; configure won't complete: "C compiler cannot create executables"
 
Ok I've tried to compile a couple of things (kaffeine, kipi-plugins) now after upgrading to gcc-4.1.2 and nothing gets past the configure:

Error in console:
Code:

user@hostname:/usr/local/kaffeine-0.8.3$ ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking for -p flag to install... yes
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for kde-config... /usr/bin/kde-config
checking where to install... /usr (as returned by kde-config)
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.

Excerpt from config.log:
Code:

configure:3189: result: gcc
configure:3427: checking for C compiler version
configure:3434: gcc --version >&5
gcc (GCC) 4.1.2
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3437: $? = 0
configure:3444: gcc -v >&5
Reading specs from /usr/lib/gcc/i486-slackware-linux/4.1.2/specs
Target: i486-slackware-linux
Configured with: ../gcc-4.1.2/configure --prefix=/usr --enable-shared --enable-languages=ada,c,c++,fortran,java,objc --enable-threads=posix
--enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --with-arch=i486 --target=i486-slackware-linux --host=i486-slackware-linux
Thread model: posix
gcc version 4.1.2
configure:3447: $? = 0
configure:3454: gcc -v >&5
Reading specs from /usr/lib/gcc/i486-slackware-linux/4.1.2/specs
Target: i486-slackware-linux
Configured with: ../gcc-4.1.2/configure --prefix=/usr --enable-shared --enable-languages=ada,c,c++,fortran,java,objc --enable-threads=posix
--enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --with-arch=i486 --target=i486-slackware-linux --host=i486-slackware-linux
Thread model: posix
gcc version 4.1.2
configure:3457: $? = 0
configure:3480: checking for C compiler default output file name
configure:3507: gcc    conftest.c  >&5
/usr/lib/gcc/i486-slackware-linux/4.1.2/../../../../i486-slackware-linux/bin/ld:/usr/lib/gcc/i486-slackware-linux/4.1.2/../../../libc.so: fi
le format not recognized; treating as linker script
/usr/lib/gcc/i486-slackware-linux/4.1.2/../../../../i486-slackware-linux/bin/ld:/usr/lib/gcc/i486-slackware-linux/4.1.2/../../../libc.so:5:
parse error
collect2: ld returned 1 exit status
configure:3510: $? = 1
configure: failed program was:
| /* confdefs.h.  */

This is the "C compiler cannot create executables" error that there are a lot of threads on (eg http://www.linuxquestions.org/questi...readid=321150). Most seem to have distro specific fixes in them though.

I've tried, clearing LDFLAGS (nothing was set). Looking blankly at /etc/ld.so.conf (seemed fine to me and as you can see in the output the system is finding the 4.1.2 files). I've also tried reinstalling glibc-*.tgz packages.

Looking at the "configure" script the problem arises when the command
Code:

gcc -V </dev/null >&5
is issued.

Running gcc -V requires a number (eg 4.1.2).

I've also tried compiling a "hello world" that I found in another thread but this fails too:

Code:

gcc test.c -o test
/usr/lib/gcc/i486-slackware-linux/4.1.2/../../../../i486-slackware-linux/bin/ld:/usr/lib/gcc/i486-slackware-linux/4.1.2/../../../libc.so: file format not recognized; treating as linker script
/usr/lib/gcc/i486-slackware-linux/4.1.2/../../../../i486-slackware-linux/bin/ld:/usr/lib/gcc/i486-slackware-linux/4.1.2/../../../libc.so:5: parse error
collect2: ld returned 1 exit status

Code:

user@hostname:ll `locate libc.so`
lrwxrwxrwx 1 root root  11 2007-04-16 00:34 /lib/libc.so.6 -> libc-2.5.so*
lrwxrwxrwx 1 root root  13 2007-01-24 00:16 /lib/obsolete/tls/libc.so.6 -> libc-2.3.6.so*
-rw-r--r-- 1 root root 238 2006-12-21 19:51 /usr/lib/libc.so


Any thoughts on how to proceed?

piete 04-17-2007 08:00 AM

Did you cherry pick gcc 4 from current? If yes, try upgrading the rest of your toolchain from current (glibc, binutils, headers) ... and probably the rest of the system too =)

If you self-compiled gcc: did you run the test suites after compilation?

- Piete.

pbhj 04-17-2007 08:06 AM

I took gcc-4 and glibc-* and also upgrade binutils, and quite a lot of other stuff from current.

I didn't upgrade the headers, but then I've read elsewhere that this isn't a good idea (I'm running a self-compiled 2.6.16.13 kernel).

I've not gone the whole hog as I don't want to upgrade any Xorg stuff (which usually causes me problems).

pbhj 04-17-2007 08:38 AM

I'm an idiot, I hadn't actually updated binutils ... whoops there goes a day I'll never get back again.

yaplej 12-15-2010 02:29 AM

I was having the same problem on my Gentoo system. The box was very outdated so I had to manually update gcc from a precompiled package but even after doing that it would not "emerge gcc" to update the system using portage. I finally stumbled upon this after a couple of days that I also needed to update binutils from the latest precompiled package also.

Tips for updating old Gentoo systems.
http://blog.jolexa.net/2009/03/25/ge...-installation/
Code:

cd

wget http://tinderbox.dev.gentoo.org/default-linux/x86/sys-devel/gcc-4.4.4-r2.tbz2
wget http://tinderbox.dev.gentoo.org/default-linux/x86/sys-devel/binutils-2.20.1-r1.tbz2

cd /

tar xfpj root/gcc-4.4.4-r2.tbz2
tar xfpj root/binutils-2.20.1-r1.tbz2

Then I was able to switch to the new binutils and finally begin updating the system with emerge.
Code:

eselect binutils list
eselect binutils set 2
env-update
source /etc/profile


Alien Bob 12-15-2010 06:59 AM

This is Slackware forum, we do not care about Gentoo... and please do not resurrect a thread that has been dead for three and a half year!

Eric


All times are GMT -5. The time now is 06:40 AM.