我正在尝试创建一个u-boot镜像文件。但是我是不是有一些错误。
gcc version: 7.3.0
make PATH=/opt/CodeSourcery/Sourcery_G++_Lite/arm-2011.03-41-arm-none-linux-gnueabi:$PATH
export CROSS_COMPILE=arm-linux-gnueabihf-(or arm-none-linux-gnueabi)
make ARCH=arm xilinx_zynq_defconfig
make -j ARCH=arm UIMAGE_LOADADDR=0x8000 uImage
错误:
gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mlittle-endian’; did you mean ‘-fconvert=little-endian’?
gcc: error: unrecognized command line option ‘-mfpu=vfp’; did you mean ‘-mcpu=’?
CC scripts/mod/devicetable-offsets.s
我该怎么修复呢?有什么想法吗?
发布于 2020-06-19 20:13:28
指向您想要使用的确切工具链的一种更确定的方法是在设置
CROSS_COMPILE
时提供其完整前缀。这将避免可能出现的与路径相关的错误,并且用于构建的确切工具链的信息将嵌入到构建脚本中。
完整示例-安装官方Arm gcc工具链,并为xilinx_zynq_virt检索/构建u-boot 20.04 (使用您自己的u-boot和defconfig):
# gcc 9.2.0
mkdir -p /opt/arm/9
wget 'https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-arm-none-eabi.tar.xz?revision=64186c5d-b471-4c97-a8f5-b1b300d6594a&la=en&hash=5E9204DA5AF0B055B5B0F50C53E185FAA10FF625'
tar Jxf gcc-arm-9.2-2019.12-x86_64-arm-none-eabi.tar.xz -C /opt/arm/9
# u-boot
wget https://github.com/u-boot/u-boot/archive/v2020.04.tar.gz
tar zxf v2020.04.tar.gz
cd u-boot-2020.04
make CROSS_COMPILE=/opt/arm/9/gcc-arm-9.2-2019.12-x86_64-arm-none-eabi/bin/arm-none-eabi- ARCH=arm mrproper xilinx_zynq_virt_defconfig all
ll -gG u-boot*
-rwxrwxr-x 1 5778348 Jun 19 08:08 u-boot*
-rwxrwxr-x 1 599172 Jun 19 08:08 u-boot.bin*
-rw-rw-r-- 1 14907 Jun 19 08:08 u-boot.cfg
-rw-rw-r-- 1 9181 Jun 19 08:09 u-boot.cfg.configs
-rwxrwxr-x 1 665132 Jun 19 08:09 u-boot.elf*
-rw-rw-r-- 1 70 Jun 19 08:09 u-boot-elf.lds
-rw-rw-r-- 1 599612 Jun 19 08:09 u-boot-elf.o
-rw-rw-r-- 1 599236 Jun 19 08:09 u-boot.img