[oct1158@oct1158-fedora u-boot]$ ls
build.sh clean.sh E4412_N.bl1.bin env.bin mkuboot.sh tools
[oct1158@oct1158-fedora u-boot]$ ./build.sh
#
# configuration written to .config
#
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config.h
UPD include/config.h
CFG u-boot.cfg
GEN include/autoconf.mk.dep
CFG spl/u-boot.cfg
GEN include/autoconf.mk
GEN spl/include/autoconf.mk
CHK include/config/uboot.release
CHK include/generated/timestamp_autogenerated.h
UPD include/generated/timestamp_autogenerated.h
HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/dtc/flattree.o
UPD include/config/uboot.release
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
CHK include/config.h
HOSTCC scripts/dtc/treesource.o
CFG u-boot.cfg
HOSTCC scripts/dtc/srcpos.o
CHK include/generated/version_autogenerated.h
UPD include/generated/version_autogenerated.h
CC lib/asm-offsets.s
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
CC arch/arm/lib/asm-offsets.s
SHIPPED scripts/dtc/dtc-lexer.lex.c
SHIPPED scripts/dtc/dtc-parser.tab.h
CHK include/generated/generic-asm-offsets.h
SHIPPED scripts/dtc/dtc-parser.tab.c
HOSTCC scripts/dtc/dtc-lexer.lex.o
UPD include/generated/generic-asm-offsets.h
CHK include/generated/asm-offsets.h
UPD include/generated/asm-offsets.h
HOSTCC scripts/dtc/dtc-parser.tab.o
LDS u-boot.lds
HOSTLD scripts/dtc/dtc
/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [scripts/Makefile.host:108: scripts/dtc/dtc] Error 1
make[1]: *** [scripts/Makefile.build:425: scripts/dtc] Error 2
make: *** [Makefile:493: scripts] Error 2
cp: cannot stat 'u-boot.bin': No such file or directory
copy u-boot.bin done.
notice: not found itop4412-spl.bin !
解决办法
修改顶层Makefile文件(u-boot-2017.11-itop4412-2.0.0/u-boot-2017.11/Makefile),添加:
HOSTCFLAGS += -fcommon
笔者用的交叉编译器是gcc-arm-10.2-2020.11-x86_64-arm-none-eabi
最后uboot编译成功了,烧写进SD卡:
dd iflag=dsync oflag=dsync if=u-boot-iTOP-4412.bin of=/dev/sdb seek=1
可以运行: