NXP(Freescale) QorIQ T2080独立编译BSP

作者

QQ群:852283276
微信:arm80x86
微信公众号:青儿创客基地
B站:主页 https://space.bilibili.com/208826118

参考

为Freescale QorIQ搭建Linux交叉编译环境时遇到的问题总结
zImage构成图解

编译

编译内核,报错如下,编译之前unset LDFLAGS

powerpc64-fsl-linux-ld: unrecognized option '-Wl,-O1'

编译内核没有Image只有zImage和uImage,但是查看uImage和zImage一样大,应该是大64字节的啊,怀疑次uImage无法使用。没有Image,打算手动生成Image,使用objcopy。
在这里插入图片描述
编译u-boot报错,参考Error in standalone u-boot compilation for QorIQ T1042standalone compilation of u-boot for T1040 using QORIQ SDK1.7,只能使用32bit工具链。编译应用tools/env时,找不到string.h。

fatal error: string.h: No such file or directory
 #include <string.h>
                    ^
compilation terminated.

手动添加头文件路径到sysroot,仍无法编译,报错,发现是在arch/powerpc/config.mk里面设置了这个标志,

powerpc-fsl-linux-gcc: error: unrecognized command line option '-melf32ppclinux'
scripts/Makefile.host:108: recipe for target 'tools/env/fw_printenv' failed
grep
arch/powerpc/config.mk:20:PLATFORM_LDFLAGS  += -m32 -melf32ppclinux

在env的Makefile里干掉这个,

# fw_printenv is supposed to run on the target system, which means it should be
# built with cross tools. Although it may look weird, we only replace "HOSTCC"
# with "CC" here for the maximum code reuse of scripts/Makefile.host.


#HOSTCC = powerpc-fsl-linux-gcc  -m32 -mhard-float -mcpu=e6500 --sysroot=/home/zc/program/QorIQ-SDK-V2.0-20160527-yocto/fsl-qoriq/2.0/ppc/sysroots/ppce6500-fsl-linux
HOSTCC = powerpc64-fsl-linux-gcc  -mhard-float -m64 -mcpu=e6500 --sysroot=/home/zc/program/QorIQ-SDK-V2.0-20160527-yocto/fsl-qoriq/2.0/ppc64/sysroots/ppc64e6500-fsl-linux

需要重新设置CC,不知道为什么CC被改变了,应该是被Makefile字符串切割了只剩powerpc-fsl-linux-gcc,导致找不到头文件等等错误,可以看到env的Makefile调用Makefile.host,在line108行执行env的编译操作。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值