his linker was not configured to use sysroots和C compiler cannot create executables的解决办法

this linker was not configured to use sysroots和C compiler cannot create executables的解决办法

this linker was not configured to use sysroots

C compiler cannot create executables

在ubuntu下想编译linux kernel,键入命令

make menuconfig时,报出

this linker was not configured to use sysroots

查了一下,是因为/usr/local/bin/ld在编译前没有被配置为configure --with-sysroot

所以下载了binutils-2.22想编译一个带sysroot的

键入命令 …/binutils-2.22/configure --with-sysroot

结果报错:

C compiler cannot create executables,打开目录里的config.log

里面也有this linker was not configured to use sysroots的错误信息,

后来查了一下,/usr/bin目录下也有一个ld,用/usr/bin/ld --sysroot=/试了下,没有报错误信息

this linker was not configured to use sysroots,应该是支持sysroot的

然后就把/usr/bin/ld改名为/usr/bin/ldxxxx,命令为

mv /usr/bin/ld /usr/bin/ldxxxx

然后再执行…/binutils-2.22/configure --with-sysroot

make

make install

就成功了,这样就可以编译linux内核了,其实只将/usr/local/bin/ld改名为/usr/local/bin/ldxxxx

也应该能在linux内核目录里执行make menuconfig了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值