|
|
发表于 2006-4-17 20:43:16
|
显示全部楼层
我也遇到这个问题。
Fedora Core 5
gcc 4.1.0
参照资料http://www.linuxsir.cn/bbs/showthread.php?t=244052
出错步骤
../gcc-3.4.3/configure --prefix=/tools --libexecdir=/tools/lib --with-local-prefix=/tools --disable-nls --enable-shared --enable-languages=c
提示信息
creating cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for a BSD compatible install... /usr/bin/install -cz
*** This configuration is not supported in the following subdirectories:
target-libstdc++-v3 target-libf2c target-libffi target-boehm-gc target-zlib target-libjava zlib fastjar target-libobjc
(Any other directories should still work fine.)
/tools/bin/ld:/usr/lib/gcc/i386-redhat-linux/4.1.0/../../../libc.so: file format not recognized; treating as linker script
/tools/bin/ld:/usr/lib/gcc/i386-redhat-linux/4.1.0/../../../libc.so:5: syntax error
collect2: ld returned 1 exit status
*** The command 'gcc -o conftest -g -O2 conftest.c' failed.
*** You must set the environment variable CC to a working compiler.
$ rpm -qif /usr/lib/libc.so
Name : glibc-devel Relocations: (not relocatable)
Version : 2.4 Vendor: Red Hat, Inc.
Release : 4 Build Date: Wed Mar 8 06:00:38 2006
Install Date: Sat Apr 15 09:46:40 2006 Build Host: hs20-bc1-3.build.redhat.com
Group : Development/Libraries Source RPM: glibc-2.4-4.src.rpm
Size : 4559092 License: LGPL
Signature : DSA/SHA1, Wed Mar 8 11:07:42 2006, Key ID b44269d04f2a6fd2
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Summary : Object files for development using standard C libraries.
Description :
The glibc-devel package contains the object files necessary
for developing programs which use the standard C libraries (which are
used by nearly all programs). If you are developing programs which
will use the standard C libraries, your system needs to have these
standard object files available in order to create the
executables.
Install glibc-devel if you are going to develop programs which will
use the standard C libraries.
$ file /usr/lib/libc.so
/usr/lib/libc.so: ASCII C program text
$ cat /usr/lib/libc.so
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-i386)
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.2 ) ) |
|