ubuntu版本:ubuntu-18.04
arm-gcc版本:gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12
u-boot版本: u-boot-2009-08
開發闆圖檔:

1、根據這篇文章首先設定交叉編譯器
https://blog.csdn.net/yuanlu837/article/details/117969450?spm=1001.2014.3001.5501(交叉編譯器配置)
2、首先解壓uboot-imx.tar.bz2 到指定目錄
1)添加交叉編譯器到lib_arm/config.mk
$ cd uboot-imx
$ vim lib_arm/config.mk +24 把24行内容修改為如下
24 CROSS_COMPILE ?= arm-none-linux-gnueabi-
2)載入config檔案以及編譯
$ make mx6q_marsboard_config
$ make
3、如果出現如下問題:
1)問題一:cannot find common/env_embedded.o
arm-none-linux-gnueabi-ld: cannot find common/env_embedded.o
Makefile:339: recipe for target 'u-boot' failed
make: *** [u-boot] Error 1
解決方法:進行如下操作:
首先 make distclean
再次 make mx6q_marsboard_config
make(開始編譯)