QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3215|回复: 11

Debian下编译binutils出错

[复制链接]
发表于 2009-9-17 16:47:37 | 显示全部楼层 |阅读模式
我在构建交叉工具链,编译binutils时,怎么都不成功。关于环境变量的,我已经按照网的资料设置好。差点忘了,binutils是2.15版本的。
     ../binutils-2.15/configure --target=$TARGET --prefix=$PREFIX
此使命令的结果是:
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... arm-unknown-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking for i686-pc-linux-gnu-ar... no
checking for ar... (cached) ar
checking for i686-pc-linux-gnu-as... no
checking for as... (cached) as
checking for i686-pc-linux-gnu-dlltool... no
checking for dlltool... (cached) dlltool
checking for i686-pc-linux-gnu-ld... no
checking for ld... (cached) ld
checking for i686-pc-linux-gnu-nm... no
checking for nm... (cached) nm
checking for i686-pc-linux-gnu-ranlib... no
checking for ranlib... (cached) ranlib
checking for i686-pc-linux-gnu-windres... no
checking for windres... (cached) windres
checking for i686-pc-linux-gnu-objcopy... no
checking for objcopy... (cached) objcopy
checking for i686-pc-linux-gnu-objdump... no
checking for objdump... (cached) objdump
checking for arm-linux-ar... no
checking for arm-linux-as... no
checking for arm-linux-dlltool... no
checking for arm-linux-ld... no
checking for arm-linux-nm... no
checking for arm-linux-ranlib... no
checking for arm-linux-windres... no
checking whether to enable maintainer-specific portions of Makefiles... no
creating ./config.status
creating Makefile
出现很多的no,不知道有没有错,继续执行下一步
        make
此命令出错啦,结果是:
Configuring in libiberty
configure: loading cache ./config.cache
configure: error: `target_alias' has changed since the previous run:
configure:   former value:  
configure:   current value: arm-linux
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm ./config.cache' and start over
make: *** [configure-libiberty] Error 1
按照提示,执行make distclean再执行一次,结果还是一样。请问这个问题如何解决呢?
发表于 2009-9-17 16:54:57 | 显示全部楼层
你的 arm-gcc 是否正常?安装后的位置是否放进了 PATH ?
回复

使用道具 举报

 楼主| 发表于 2009-9-17 17:17:46 | 显示全部楼层
这里跟arm-gcc有关吗?我还没有安装这个哦。编译工具链不是在主机上用gcc编译的吗?
回复

使用道具 举报

发表于 2009-9-17 18:53:21 | 显示全部楼层
好像 binutils 需要 arm-gcc 吧?貌似是需要 arm-gcc 的某个 so 。
另外,建议删掉这个 binutils 的源代码目录重新解压缩。
回复

使用道具 举报

 楼主| 发表于 2009-9-21 14:06:34 | 显示全部楼层
这个我也试过啦,还是不行。根据提示,target_alias原来是空的,通过--target选项将target_alias设为arm-linux啦。不知道是不是这个原因。
回复

使用道具 举报

发表于 2009-9-21 16:18:24 | 显示全部楼层
你的 binutils 源代码有问题吧?
回复

使用道具 举报

 楼主| 发表于 2009-9-21 18:40:50 | 显示全部楼层
不至于那么严重吧,从官方网下的,应该不会有问题吧
回复

使用道具 举报

发表于 2009-9-21 19:31:01 | 显示全部楼层
我遇到这个问题只有第二次更换参数编译才会出现这个提示。
常规使用没见到过。

你是不是打了什么错误的补丁?
回复

使用道具 举报

 楼主| 发表于 2009-9-22 09:50:17 | 显示全部楼层
我一开始就没有打补丁,我在是Debian下的,会不会是要打什么补丁啊?
回复

使用道具 举报

 楼主| 发表于 2009-9-22 16:19:22 | 显示全部楼层
jiangtoa9999:谢谢你啦。我再一次重新解压binutils,然后configure 再make,居然上次的问题没有啦。不知道为什么。不过,现在又出现新的问题。提示缺少flex 与lex命令。这个上网查查应该可以解决。
回复

使用道具 举报

发表于 2009-9-22 17:28:55 | 显示全部楼层

典型的RPWT……
回复

使用道具 举报

 楼主| 发表于 2009-9-22 20:01:40 | 显示全部楼层
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-3-29 17:37 , Processed in 0.052379 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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