我正按照Chris Simmonds的“掌握嵌入式Linux编程”中的说明,尝试为beagle bone black构建u-boot。我已经构建了交叉工具链,现在我正在尝试使用该工具链构建Das U-boot,并且由于不支持THUMB指令(编译器?BeagleBone?),构建失败。我正在使用Denx的git存储库v2018.05发布的最新版本。建立在Ubuntu 18.04上。
以下是控制台输出:
johann@mars:~/uboot-work/u-boot$ make CROSS_COMPILE=arm-cortex_a8-linux-gnueabihf- am335x_evm_defconfig
#
# configuration written to .config
#
johann@mars:~/uboot-work/u-boot$ make CROSS_COMPILE=arm-cortex_a8-linux-gnueabihf-
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config.h
UPD include/config.h
CFG u-boot.cfg
GEN include/autoconf.mk
GEN include/autoconf.mk.dep
CFG spl/u-boot.cfg
GEN spl/include/autoconf.mk
CHK include/config/uboot.release
CHK include/generated/version_autogenerated.h
CHK include/generated/timestamp_autogenerated.h
UPD include/generated/timestamp_autogenerated.h
CC lib/asm-offsets.s
cc1: warning: target CPU does not support THUMB instructions
CHK include/generated/generic-asm-offsets.h
CC arch/arm/lib/asm-offsets.s
cc1: warning: target CPU does not support THUMB instructions
CHK include/generated/asm-offsets.h
HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
SHIPPED scripts/dtc/dtc-lexer.lex.c
SHIPPED scripts/dtc/dtc-parser.tab.h
HOSTCC scripts/dtc/dtc-lexer.lex.o
SHIPPED scripts/dtc/dtc-parser.tab.c
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTLD scripts/dtc/dtc
HOSTCC tools/mkenvimage.o
HOSTCC tools/lib/crc32.o
HOSTLD tools/mkenvimage
HOSTCC tools/common/bootm.o
HOSTCC tools/lib/fdtdec.o
HOSTCC tools/fit_image.o
HOSTCC tools/image-host.o
HOSTCC tools/dumpimage.o
HOSTLD tools/dumpimage
HOSTCC tools/mkimage.o
HOSTLD tools/mkimage
CC arch/arm/cpu/armv7/cache_v7.o
cc1: warning: target CPU does not support THUMB instructions
{standard input}: Assembler messages:
{standard input}:42: Error: selected processor does not support `dsb sy' in ARM mode
make[1]: *** [arch/arm/cpu/armv7/cache_v7.o] Error 1
Makefile:1363: recipe for target 'arch/arm/cpu/armv7' failed
make: *** [arch/arm/cpu/armv7] Error 2
可能是你使用错误的交叉编译器?
在Debian Buster上使用包gcc-7-arm-linux-gnueabihf
make am335x_evm_defconfig
export CROSS_COMPILE=arm-linux-gnueabihf-
make -j6
像魅力一样奔跑。
我一直在使用的软件包也可以在Ubuntu 18.04:https://launchpad.net/ubuntu/bionic/+package/gcc-7-arm-linux-gnueabihf中找到
我也在读这本书并得到同样的错误。我通过使用U-Boot的主分支解决了这个问题(日期:2019-03-19,操作系统:Ubuntu:18.04)。
但是,U-Boot的主分支没有am335x_boneblack_defconfig。我改用了am335x_evm_defconfig。
尽管有这些编译问题,但这本书非常出色。
编辑:
经过进一步调查,我发现根本原因是需要使用./ct-ng menuconfig将fpu类型设置为'neon-vfpv3'。
由于本书指示将float-abi设置为hard,因此fpu-type也应设置为neon-vfpv3。否则,Linux内核和Barebox / U-boot都不会被编译。