LinuxSir.cn,穿越时空的Linuxsir!

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

LFS5.0,安装 GCC-3.3.1 - 第一遍,出现这个错误

[复制链接]
发表于 2004-10-6 10:51:21 | 显示全部楼层 |阅读模式
不知道该怎么办了
lfs@richie:/mnt/lfs/sources/gcc-build$ ../gcc-3.3.1/configure --prefix=/tools     --with-local-prefix=/tools     --disable-nls --enable-shared     --enable-languages=c
Configuring for a i686-pc-linux-gnu host.
Created "Makefile" in /mnt/lfs/sources/gcc-build using "mt-frag"
/tools/bin/ld: unrecognized option '--as-needed'
/tools/bin/ld: use the --help option for usage information
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
发表于 2004-10-6 16:44:48 | 显示全部楼层
I think it is because binutils is older than the version in your host system.
 楼主| 发表于 2004-10-6 17:02:19 | 显示全部楼层
I have googled this answer,but i still don't know
the solution.
someone told me to use the high version binutils,and i
failed again,-.-
发表于 2004-10-7 22:34:20 | 显示全部楼层
rpm -qa |grep binutil

to see what version your binutils is.
发表于 2004-10-9 12:18:04 | 显示全部楼层
你用的是不是Fedore Core 2啊,它自带的binutils是2.15版
2.15支持--as-needed选项,所以相应的gcc也认为binutils应该认识--as-needed
可是2.14版不支持该选项,所以编译失败
我的解决办法是先在lfs中编译binutils-2.15,
然后用binutils-2.15编译gcc-3.3.1(用不着bootstrip),
再用编译出的gcc来重新编译binutils-2.14
再编译gcc-3.3.1就没问题了。
发表于 2004-10-10 00:06:45 | 显示全部楼层
check you $PATH first
make sure /tools/bin is in the first place of PATH
e.g. PATH="/tools/bin:
发表于 2004-10-10 00:08:44 | 显示全部楼层
有时重开shell后,先看看/tools/bin是不是还在PATH中第一位置,或者gcc -v看看版本对不对
不对就快改吧
发表于 2004-10-22 15:17:30 | 显示全部楼层
最初由 charlee 发表
你用的是不是Fedore Core 2啊,它自带的binutils是2.15版
2.15支持--as-needed选项,所以相应的gcc也认为binutils应该认识--as-needed
可是2.14版不支持该选项,所以编译失败
我的解决办法是先在lfs中编译binutils-2.15,
然后用binutils-2.15编译gcc-3.3.1(用不着bootstrip),
再用编译出的gcc来重新编译binutils-2.14
再编译gcc-3.3.1就没问题了。


请问为什么不用bootstrap呢?
发表于 2004-10-22 17:14:24 | 显示全部楼层
我开始时是照中文版的做的
后来发现它和5.1.1有点区别
后来照英文的做一下
有些问题可以解决了
现在正在努力继续做
挺有意思的!

尤其是这个问题
和binutils的版本有关系
装上binutils-2.5就可以了
相信对不少和我一样照中文说明来做的newbie都会有帮助的
发表于 2004-10-23 00:28:44 | 显示全部楼层
在第一次编译gcc的时候,configure前边加 CC="gcc -B/usr/bin",应该可以解决binutil的问题。(BOOK说的)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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