Fast Development Kit(FDK)-NXP(Freescale) QorIQ T2080编译

参考

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章