OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 1122|回复: 1

编译uboot时报错unrecognized command line option ‘-mgeneral-regs-only’

[复制链接]

0

主题

1

帖子

0

精华

新手入门

积分
3
金钱
3
注册时间
2022-5-19
在线时间
1 小时
发表于 2022-5-19 15:08:52 | 显示全部楼层 |阅读模式
1金钱
本帖最后由 james8422 于 2022-5-19 16:10 编辑

我按照《I.MX6U 嵌入式 Linux 驱动开发指南》中的方法尝试编译NXP的IMX8MQ-evk的uboot、虽然一个是IMX6一个是IMX8、但是我觉得应该是通用的、uboot源码是clone的https://source.codeaurora.org/external/imx/uboot-imx的imx_v2020.04_5.4.70_2.3.0分支、
arm-linux-gnueabihf-gcc版本是:gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)


执行:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- imx8mq_evk_defconfig
make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j2


报错:
arm-linux-gnueabihf-gcc: error: unrecognized command line option ‘-mgeneral-regs-only’

百度了一下基本上都是说编译器问题、尝试过使用正点原子推荐的4.9.4版本gcc、也会报同样的错误、而且会显示:*** Your GCC is older than 6.0 and will not be supported、

求问、

补充:我编译imx6的、也就是make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ull_14x14_evk_emmc_defconfig、make后编译可以成功、头疼

附完整输出信息:
  CLEAN   scripts/basic
  CLEAN   scripts/kconfig
  CLEAN   include/config include/generated
  CLEAN   .config include/config.h
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACC    scripts/kconfig/zconf.tab.c
  LEX     scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
make -f ./Makefile syncconfig
make -f ./scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
make -f ./scripts/Makefile.build obj=scripts/kconfig syncconfig
mkdir -p include/config include/generated
scripts/kconfig/conf  --syncconfig Kconfig
make -f ./scripts/Makefile.autoconf || \
        { rm -f include/config/auto.conf; false; }
if [ -d arch/arm/mach-imx8m/include/mach ]; then        \
        dest=../../mach-imx8m/include/mach;                        \
else                                                                \
        dest=arch-imx8m;                        \
fi;                                                                \
ln -fsn $dest arch/arm/include/asm/arch
set -e; : '  CHK     include/config.h'; mkdir -p include/;         (echo "/* Automatically generated - do not edit */"; for i in $(echo "IMX_CONFIG=arch/arm/mach-imx/imx8m/imximage.cfg" | sed 's/,/ /g'); do echo \#define CONFIG_$i | sed '/=/ {s/=/        /;q; } ; { s/$/        1/; }'; done; echo \#define CONFIG_BOARDDIR board/freescale/imx8mq_evk; echo \#include \<config_defaults.h\>; echo \#include \<config_uncmd_spl.h\>; echo \#include \<configs/"imx8mq_evk".h\>; echo \#include \<asm/config.h\>; echo \#include \<linux/kconfig.h\>; echo \#include \<config_fallbacks.h\>;) < scripts/Makefile.autoconf > include/config.h.tmp; if [ -r include/config.h ] && cmp -s include/config.h include/config.h.tmp; then rm -f include/config.h.tmp; else : '  UPD     include/config.h'; mv -f include/config.h.tmp include/config.h; fi
  arm-linux-gnueabihf-gcc -E -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -O2 -fno-stack-protector -fno-delete-null-pointer-checks  -g -fstack-usage -Wno-format-nonliteral  -Werror=date-time  -D__KERNEL__ -D__UBOOT__   -D__ARM__ -marm -mno-thumb-interwork  -mabi=aapcs-linux  -mword-relocations  -fno-pic   -ffunction-sections -fdata-sections -fno-common -ffixed-r9  -msoft-float    -fno-common -ffixed-x18 -pipe -Iinclude  -I./arch/arm/include -include ./include/linux/kconfig.h  -nostdinc -isystem /usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.4/include  -DDO_DEPS_ONLY -dM ./include/common.h > u-boot.cfg.tmp && { grep 'define CONFIG_' u-boot.cfg.tmp > u-boot.cfg; rm u-boot.cfg.tmp; } || { rm u-boot.cfg.tmp; false; }
  arm-linux-gnueabihf-gcc -x c -DDO_DEPS_ONLY -M -MP -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -O2 -fno-stack-protector -fno-delete-null-pointer-checks  -g -fstack-usage -Wno-format-nonliteral  -Werror=date-time  -D__KERNEL__ -D__UBOOT__   -D__ARM__ -marm -mno-thumb-interwork  -mabi=aapcs-linux  -mword-relocations  -fno-pic   -ffunction-sections -fdata-sections -fno-common -ffixed-r9  -msoft-float    -fno-common -ffixed-x18 -pipe -Iinclude  -I./arch/arm/include -include ./include/linux/kconfig.h  -nostdinc -isystem /usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.4/include -MQ include/config/auto.conf ./include/common.h > include/autoconf.mk.dep || { rm include/autoconf.mk.dep; false; }
cc1: 警告: 未知的寄存器名:x18
cc1: 警告: 未知的寄存器名:x18
mkdir -p spl/
  arm-linux-gnueabihf-gcc -E -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -O2 -fno-stack-protector -fno-delete-null-pointer-checks  -g -fstack-usage -Wno-format-nonliteral  -Werror=date-time  -D__KERNEL__ -D__UBOOT__   -D__ARM__ -marm -mno-thumb-interwork  -mabi=aapcs-linux  -mword-relocations  -fno-pic   -ffunction-sections -fdata-sections -fno-common -ffixed-r9  -msoft-float    -fno-common -ffixed-x18 -pipe -Iinclude  -I./arch/arm/include -include ./include/linux/kconfig.h  -nostdinc -isystem /usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.4/include -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM ./include/common.h > spl/u-boot.cfg.tmp && { grep 'define CONFIG_' spl/u-boot.cfg.tmp > spl/u-boot.cfg; rm spl/u-boot.cfg.tmp; } || { rm spl/u-boot.cfg.tmp; false; }
cc1: 警告: 未知的寄存器名:x18
  sed -n -f ./tools/scripts/define2mk.sed u-boot.cfg | while read line; do if [ -n "" ] || ! grep -q "${line%=*}=" include/config/auto.conf; then echo "$line"; fi done > include/autoconf.mk
mkdir -p spl/include/
  sed -n -f ./tools/scripts/define2mk.sed spl/u-boot.cfg | while read line; do if [ -n "" ] || ! grep -q "${line%=*}=" include/config/auto.conf; then echo "$line"; fi done > spl/include/autoconf.mk
touch include/config/auto.conf
arm-linux-gnueabihf-gcc: 错误: unrecognized command line option ‘-mgeneral-regs-only’
set -e; : '  CHK     include/config/uboot.release'; mkdir -p include/config/;         echo "2020.04$(/bin/bash ./scripts/setlocalversion .)" < include/config/auto.conf > include/config/uboot.release.tmp; if [ -r include/config/uboot.release ] && cmp -s include/config/uboot.release include/config/uboot.release.tmp; then rm -f include/config/uboot.release.tmp; else : '  UPD     include/config/uboot.release'; mv -f include/config/uboot.release.tmp include/config/uboot.release; fi
set -e; : '  CHK     include/generated/timestamp_autogenerated.h'; mkdir -p include/generated/;         (if test -n "${SOURCE_DATE_EPOCH}"; then SOURCE_DATE="@${SOURCE_DATE_EPOCH}"; DATE=""; for date in gdate date.gnu date; do ${date} -u -d "${SOURCE_DATE}" >/dev/null 2>&1 && DATE="${date}"; done; if test -n "${DATE}"; then LC_ALL=C ${DATE} -u -d "${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; LC_ALL=C ${DATE} -u -d "${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; LC_ALL=C ${DATE} -u -d "${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; LC_ALL=C ${DATE} -u -d "${SOURCE_DATE}" +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; LC_ALL=C ${DATE} -u -d "${SOURCE_DATE}" +'#define U_BOOT_BUILD_DATE 0x%Y%m%d'; else return 42; fi; else LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; LC_ALL=C date +'#define U_BOOT_TIME "%T"'; LC_ALL=C date +'#define U_BOOT_TZ "%z"'; LC_ALL=C date +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; LC_ALL=C date +'#define U_BOOT_BUILD_DATE 0x%Y%m%d'; fi) < Makefile > include/generated/timestamp_autogenerated.h.tmp; if [ -r include/generated/timestamp_autogenerated.h ] && cmp -s include/generated/timestamp_autogenerated.h include/generated/timestamp_autogenerated.h.tmp; then rm -f include/generated/timestamp_autogenerated.h.tmp; else : '  UPD     include/generated/timestamp_autogenerated.h'; mv -f include/generated/timestamp_autogenerated.h.tmp include/generated/timestamp_autogenerated.h; fi
make -f ./scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
*** Your GCC is older than 6.0 and will not be supported
make -f ./scripts/Makefile.build obj=scripts
make -f ./scripts/Makefile.build obj=scripts/dtc
  cc -Wp,-MD,scripts/dtc/.dtc.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer  -std=gnu11    -Iscripts/dtc -Iscripts/dtc/libfdt -c -o scripts/dtc/dtc.o scripts/dtc/dtc.c
  cc -Wp,-MD,scripts/dtc/.flattree.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer  -std=gnu11    -Iscripts/dtc -Iscripts/dtc/libfdt -c -o scripts/dtc/flattree.o scripts/dtc/flattree.c
  cc -Wp,-MD,scripts/dtc/.fstree.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer  -std=gnu11    -Iscripts/dtc -Iscripts/dtc/libfdt -c -o scripts/dtc/fstree.o scripts/dtc/fstree.c
  cc -Wp,-MD,scripts/dtc/.data.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer  -std=gnu11    -Iscripts/dtc -Iscripts/dtc/libfdt -c -o scripts/dtc/data.o scripts/dtc/data.c
  cc -Wp,-MD,scripts/dtc/.livetree.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer  -std=gnu11    -Iscripts/dtc -Iscripts/dtc/libfdt -c -o scripts/dtc/livetree.o scripts/dtc/livetree.c
  cc -Wp,-MD,scripts/dtc/.treesource.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer  -std=gnu11    -Iscripts/dtc -Iscripts/dtc/libfdt -c -o scripts/dtc/treesource.o scripts/dtc/treesource.c
  cc -Wp,-MD,scripts/dtc/.srcpos.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer  -std=gnu11    -Iscripts/dtc -Iscripts/dtc/libfdt -c -o scripts/dtc/srcpos.o scripts/dtc/srcpos.c
  cc -Wp,-MD,scripts/dtc/.checks.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer  -std=gnu11    -Iscripts/dtc -Iscripts/dtc/libfdt -c -o scripts/dtc/checks.o scripts/dtc/checks.c
  cc -Wp,-MD,scripts/dtc/.util.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer  -std=gnu11    -Iscripts/dtc -Iscripts/dtc/libfdt -c -o scripts/dtc/util.o scripts/dtc/util.c
  flex -oscripts/dtc/dtc-lexer.lex.c -L scripts/dtc/dtc-lexer.l
  bison -o/dev/null --defines=scripts/dtc/dtc-parser.tab.h -t -l scripts/dtc/dtc-parser.y
  bison -oscripts/dtc/dtc-parser.tab.c -t -l scripts/dtc/dtc-parser.y
set -e; : '  CHK     include/generated/version_autogenerated.h'; mkdir -p include/generated/;         (echo \#define PLAIN_VERSION \"2020.04""\"; echo \#define U_BOOT_VERSION \"U-Boot \" PLAIN_VERSION; echo \#define CC_VERSION_STRING \"$(LC_ALL=C arm-linux-gnueabihf-gcc --version | head -n 1)\"; echo \#define LD_VERSION_STRING \"$(LC_ALL=C arm-linux-gnueabihf-ld.bfd --version | head -n 1)\"; ) < include/config/uboot.release > include/generated/version_autogenerated.h.tmp; if [ -r include/generated/version_autogenerated.h ] && cmp -s include/generated/version_autogenerated.h include/generated/version_autogenerated.h.tmp; then rm -f include/generated/version_autogenerated.h.tmp; else : '  UPD     include/generated/version_autogenerated.h'; mv -f include/generated/version_autogenerated.h.tmp include/generated/version_autogenerated.h; fi
  cc -Wp,-MD,scripts/dtc/.dtc-lexer.lex.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer  -std=gnu11    -Iscripts/dtc -Iscripts/dtc/libfdt -c -o scripts/dtc/dtc-lexer.lex.o scripts/dtc/dtc-lexer.lex.c
  cc -Wp,-MD,scripts/dtc/.dtc-parser.tab.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer  -std=gnu11    -Iscripts/dtc -Iscripts/dtc/libfdt -c -o scripts/dtc/dtc-parser.tab.o scripts/dtc/dtc-parser.tab.c
make -f ./scripts/Makefile.build obj=.
mkdir -p lib/
  arm-linux-gnueabihf-gcc -Wp,-MD,lib/.asm-offsets.s.d  -nostdinc -isystem /usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.4/include -Iinclude   -I./arch/arm/include -include ./include/linux/kconfig.h -D__KERNEL__ -D__UBOOT__ -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks -g -fstack-usage -Wno-format-nonliteral -Werror=date-time -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -mword-relocations -fno-pic -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float -fno-common -ffixed-x18 -pipe -march=armv8-a -mgeneral-regs-only -D__LINUX_ARM_ARCH__=8 -DDO_DEPS_ONLY    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(asm_offsets)"  -D"KBUILD_MODNAME=KBUILD_STR(asm_offsets)"  -fverbose-asm -S -o lib/asm-offsets.s lib/asm-offsets.c
arm-linux-gnueabihf-gcc: 错误: unrecognized command line option ‘-mgeneral-regs-only’
Kbuild:43: recipe for target 'lib/asm-offsets.s' failed
make[1]: *** [lib/asm-offsets.s] Error 1
Makefile:1785: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
make: *** 正在等待未完成的任务....
  cc  -o scripts/dtc/dtc scripts/dtc/dtc.o scripts/dtc/flattree.o scripts/dtc/fstree.o scripts/dtc/data.o scripts/dtc/livetree.o scripts/dtc/treesource.o scripts/dtc/srcpos.o scripts/dtc/checks.o scripts/dtc/util.o scripts/dtc/dtc-lexer.lex.o scripts/dtc/dtc-parser.tab.o


最佳答案

查看完整内容[请看2#楼]

好了解决了、我真是愚蠢、imx6ull的CPU是Cortex-A7(ARMv7)、imx8mq的CPU是Cortex-A53(ARMv8)、ARMv是32位的不用说、ARMv8指令集为aarch64兼容aarch32、也就是我需要一个编译64位的交叉编译工具链、所以当然不能用arm-linux-gnueabihf-gcc、应该用aarch64-linux-gnu-gcc、愚蠢、真是过于愚蠢、
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

0

主题

1

帖子

0

精华

新手入门

积分
3
金钱
3
注册时间
2022-5-19
在线时间
1 小时
 楼主| 发表于 2022-5-19 15:08:53 | 显示全部楼层
本帖最后由 james8422 于 2022-5-20 13:29 编辑

好了解决了、我真是愚蠢、imx6ull的CPU是Cortex-A7(ARMv7)、imx8mq的CPU是Cortex-A53(ARMv8)、ARMv是32位的不用说、ARMv8指令集为aarch64兼容aarch32、也就是我需要一个编译64位的交叉编译工具链、所以当然不能用arm-linux-gnueabihf-gcc、应该用aarch64-linux-gnu-gcc、愚蠢、真是过于愚蠢、
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-11-25 10:30

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表