最新消息:20210917 已从crifan.com换到crifan.org

【记录】Ubuntu下基于Eclipse去调用Makefile交叉编译Uboot

Eclipse crifan 2670浏览 0评论

【背景】

之前已经弄了:

【记录】Ubuntu下用arm-xscale-linux-gnueabi交叉编译uboot

现在继续换个方式,通过Eclipse,去编译对应的uboot。

 

【折腾过程】

1.同样的去修改makefile,把对应交叉编译器改掉:

#CROSS_COMPILE = arm-xscale-linux-gnu-
CROSS_COMPILE = arm-xscale-linux-gnueabi-

2.然后先去创建对应的makefile的target:

uboot makefile create

create whgs config target

3.再去创建一个all的target:

create all target for uboot makefile

再去弄个clean:

for uboot create clean for makefile

4.然后就可以去先配置,再编译了。

去配置:

makefile make targets build shift f9

whgs config build

输出为:

make whgs config output

5.再去编译:

choose all then build for uboot

输出中,结果找不到交叉编译器:

【已解决】Ubuntu下Eclipse中交叉编译Uboot出错:make[1]: arm-xscale-linux-gnueabi-gcc: Command not found

6.同样的,也会出现找不到raise的问题:

image

然后参考之前的:

【已解决】uboot交叉编译出错:gcc/config/arm/lib1funcs.asm:1266: undefined reference to `raise’

去修改:

board/whgs/lowlevel_init.S

在最后加上:

@add empty raise() to fix (when use new EABI xscale cross compiler to) compile
@error gcc/config/arm/lib1funcs.asm:1266: undefined reference to `raise'
.globl raise
raise:
    nop
    mov pc, lr

为:

add lowlevel init s the raise function

然后再编译,就可以了:

for uboot in eclipse build done

 

【总结】

在Ubuntu下的Eclipse中交叉编译Uboot,总的来说,也还是额外花了点时间的,主要是:

必须给Makefile中的交叉编译器,加上绝对的路径:

#CROSS_COMPILE = arm-xscale-linux-gnu-
#CROSS_COMPILE = arm-xscale-linux-gnueabi-
#CROSS_COMPILE = /home/crifan/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/bin/arm-xscale-linux-gnueabi-
CROSS_COMPILE = /opt/crosscompile/xscale/gcc-4.6.0-glibc-2.9/bin/arm-xscale-linux-gnueabi-

这样Eclipse才能找到此交叉编译器。

而想要通过,把路径加到include中,或者是,添加修改PATH环境变量,都是没用的。

转载请注明:在路上 » 【记录】Ubuntu下基于Eclipse去调用Makefile交叉编译Uboot

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
92 queries in 0.165 seconds, using 23.33MB memory