LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1809|回复: 14

求助, 第五章第一遍 gcc-3.4.3出错了.

[复制链接]
发表于 2006-4-16 22:08:40 | 显示全部楼层 |阅读模式
宿主系统: Fedora core 4
lfs-6.1.1

安装第一遍 gcc-3.4.3 时候出错了.

出错步骤为:
../gcc-3.4.3/configure --prefix=/tools \
    --libexecdir=/tools/lib --with-local-prefix=/tools \
    --disable-nls --enable-shared --enable-languages=c

出错提示:

loading 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 -c
*** 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.0.0/../../../libc.so: file format not recognized; treating as linker script
/tools/bin/ld:/usr/lib/gcc/i386-redhat-linux/4.0.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 libc.so
Name        : glibc-devel
Version     : 2.3.5   

希望大牛指点一下.
我都是拷贝帮助上面的命令来执行的.
发表于 2006-4-17 10:21:03 | 显示全部楼层
file /usr/lib/libc.so
cat /usr/lib/libc.so
回复 支持 反对

使用道具 举报

发表于 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 ) )
回复 支持 反对

使用道具 举报

发表于 2006-4-17 21:11:37 | 显示全部楼层
configure 里边,加入 --with-gnu-ld 试试
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-17 23:33:52 | 显示全部楼层
我按照下面的做了以后还是不行.
lfs:/mnt/lfs/sources/gcc-build$ ../gcc-3.4.3/configure --with-gnu-ld --prefix=/tools     --libexecdir=/tools/lib --with-local-prefix=/tools     --disable-nls --enable-shared --enable-languages=c


输出的结果还是和上面一样的错误信息.
难道是在 configure  文件中改么?
回复 支持 反对

使用道具 举报

发表于 2006-4-17 23:42:38 | 显示全部楼层
用LiveCD试试。。
也许是FC 的问题。
回复 支持 反对

使用道具 举报

发表于 2006-4-18 01:54:03 | 显示全部楼层
你的 binutils  安装成功没?。。。。
我看到别人也有这个错误,但是是binutils的,你编译的binutils版本是?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-18 20:27:17 | 显示全部楼层
binutils-2.15.94.0.2.2

这个binutils 安装成功了阿.
回复 支持 反对

使用道具 举报

发表于 2006-4-18 22:00:22 | 显示全部楼层
噢。没有FC4,,你用LiveCD试试。对了,看置顶贴。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-5-19 15:03:59 | 显示全部楼层
我升级到FC5.0以后,在编译binutils的时候, 就出现了这个错误。
然后, 我比较了一下
FC5.0上面的 libc.so和
我的另外的机子 RH9.0上面的 libc.so
发现
#cat 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 ) )

而RH9.0上面的是
/* 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  )

所以,我就把不一样的地方删了, 然后就成功了。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表