參考
編譯
編譯內核,報錯如下,編譯之前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 T1042,standalone 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的編譯操作。