imxq Freescale Yocto Project編譯記錄

參考: IMX6Q環境搭建、安裝Yocto包和編譯

編譯內核

  • 配置menuconfig指令:
    bitbake -c menuconfig -v linux-imx
  • 單獨編譯kernel、模塊、設備樹
    bitbake -c compile -f -v linux-imx
    bitbake linux-imx -c compile_kernelmodules -f -v
    bitbake -c deploy -f -v linux-imx
  • 若要編譯文件系統則用下面總指令
    bitbake core-image-minimal
  • 單獨編譯u-boot
    bitbake -c compile -f -v u-boot-imx
    bitbake -c deploy -f -v u-boot-imx

下面是使用Ubuntu 16.04遇到的ERROR:
1.

| In file included from /home/okletsgo/work/tmp/fsl-release-bsp/build/tmp/work/x86_64-linux/ncurses-native/5.9-r15.1/ncurses-5.9/ncurses/curses.priv.h:283:0,
|                  from ../ncurses/lib_gen.c:19:
| _15038.c:1364:15: error: expected ')' before 'int'
| ../include/curses.h:1906:56: note: in definition of macro 'mouse_trafo'
|  #define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)

解決: 解決從源碼編譯ncurses6.0編譯lib_gen.c報錯的問題
搜索 curses.tail 文件. 將該文件中的註釋"/* generated /"刪除.
extern NCURSES_EXPORT(bool) mouse_trafo (int
, int*, bool); /* generated */
然後刪除文件curses.h, 再編譯.

argp-help.o: In function `argp_fmtstream_write':
argp-help.c:(.text+0x1df0): multiple definition of `argp_fmtstream_write'
argp-fmtstream.o:argp-fmtstream.c:(.text+0x7a0): first defined here
argp-help.o: In function `argp_fmtstream_puts':
argp-help.c:(.text+0x1e40): multiple definition of `argp_fmtstream_puts'
argp-fmtstream.o:argp-fmtstream.c:(.text+0x860): first defined here
argp-help.o: In function `argp_fmtstream_putc':
argp-help.c:(.text+0x1eb0): multiple definition of `argp_fmtstream_putc'
argp-fmtstream.o:argp-fmtstream.c:(.text+0x800): first defined here

原因: argp-fmtstream.h 中 #define ARGP_FS_EI extern inline
extern inline在GNU89和C99標準中用法不同,這裏使用GNU89標準編譯
解決:
vim /home/okletsgo/work/tmp/fsl-release-bsp/build/tmp/work/x86_64-linux/cross-localedef-native/2.20-r0/build/Makefile
添加編譯參數 -std=gnu89
可以將cross-localedef-native提取出來編譯, 生成argp-fmtstream.o argp-help.o後替換進去

其他:


linux源碼:/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.10.53-r0/git

設備樹:/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.10.53-r0/git/arch/arm/boot/dts

u-boot源碼:/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/work/imx6qsabresd-poky-linux-gnueabi/u-boot-imx/2014.04-r0/git

rootfs:/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/work/imx6qsabresd-poky-linux-gnueabi/fsl-image-gui/1.0-r0/rootfs

cross-gcc-4.8.2: /media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/x86_64-linux/usr/bin/cortexa9-vfp-neon-poky-linux-gnueabi

u-boot單獨編譯:---------------------------------------

vim build_u-boot.sh
#!/bin/bash

export ARCH=arm
export CROSS_COMPILE=/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/x86_64-linux/usr/bin/cortexa9-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi- 
export CC="/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/x86_64-linux/usr/bin/cortexa9-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/media/okletsgo/other/freescale/fsl-arm-yocto-bsp-3.10.53/build-fb/tmp/sysroots/imx6qsabresd"
make mx6qsabresd_config
make CC="$CC"
./build_u-boot.sh
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章