RPI-3 上的 U 引导端口:"cc1: error: bad value (‘armv8-a’) for ‘-march=’ switch"时出错。



我正在使用链接:https://elinux.org/RPi_U-Boot。这是我的快照:

$ export CROSS_COMPILE=/scratch/rpi-tools/arm-bcm2708/arm 
bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-
pranav@abc:/scratch/u-boot$ export USE_PRIVATE_LIBGCC=yes
pranav@abc:/scratch/u-boot$ sudo make rpi_3_defconfig

到目前为止,编译成功。下一阶段给出错误

pranav@abc:/scratch/u-boot$ sudo make -j3
scripts/kconfig/conf  --silentoldconfig Kconfig
GEN     include/autoconf.mk.dep
cc1: warning: unknown register name: x18
cc1: warning: unknown register name: x18  
warning: unable to access '/home/pranav/.config/git/attributes': 
Permission denied
cc1: warning: unknown register name: x18
cc1: warning: unknown register name: x18
cc1: error: bad value (‘armv8-a’) for ‘-march=’ switch
cc1: error: bad value (‘armv8-a’) for ‘-march=’ switch
cc1: note: valid arguments to ‘-march=’ switch are: nocona core2 
make[1]: *** [lib/asm-offsets.s] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [arch/arm/lib/asm-offsets.s] Error 1
make: *** [prepare0] Error 2

在此之后,我使用了:

$ export CROSS_COMPILE=aarch64-linux-gnu-

但也给出了一些错误。

CROSS_COMPILE=/scratch/rpi-tools/arm-bcm2708/armBCM2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-与 32 位编译器有关。

您正在使用的 defconfig 适用于 64 位。因此,您必须安装 64 位工具链,然后指定CROSS_COMPILE以匹配已安装的跨构建工具。

在 Debian、Ubuntu 或 Mint 上,你会使用

sudo apt-get install gcc-aarch64-linux-gnu
export CROSS_COMPILE aarch64-linux-gnu-

最新更新