在mx6ull编译uboot时报错arm-linux-gnueabihf-gcc: error: missing argument to ‘-march=’
时间: 2024-05-20 15:12:21 浏览: 9
这个错误是由于你在编译 U-Boot 时使用的交叉编译器版本与所选的 CPU 架构不兼容所导致的。
你需要检查编译器版本和所选的 CPU 架构是否匹配。例如,如果你的 CPU 架构是 ARM Cortex-A7,则应该使用 arm-linux-gnueabihf-gcc,而不是使用其他版本的交叉编译器。
你可以尝试在编译 U-Boot 时加上 -march=armv7-a 参数,这样编译器就可以根据指定的 CPU 架构来生成相应的代码,例如:make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ull_14x14_evk_defconfig && make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 -march=armv7-a。
如果还有其他问题,请提供更多的上下文信息和错误日志,以便我更好地帮助你解决问题。
相关问题
以 EMMC 核心板为例,讲解一下如何编译出对应的 Linux 镜像文件。新建名为 “mx6ull_alientek_emmc.sh”的 shell 脚本,然后在这个 shell 脚本里面输入如下所示内容: 示例代码 35.2.1 mx6ull_alientek_emmc.sh 文件内容 1 #!/bin/sh 2 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean 3 make ARCH=arm CROSS_COMPILE=arm-lin
ux-gnueabihf- alientek_emmc_defconfig
4 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
5 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4
6 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage
7 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules
8 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- dtbs
9 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- imx6ull-alientek-emmc.dtb
10 mkdir -p output
11 cp -f arch/arm/boot/uImage output/
12 cp -f arch/arm/boot/dts/imx6ull-alientek-emmc.dtb output/
13 cp -f System.map output/
14 mkdir -p output/lib/modules
15 cp -fRv modules/* output/lib/modules/
16 rm output/lib/modules/`uname -r`/build
17 rm output/lib/modules/`uname -r`/source
18 tar -cf output.tar output
19 rm -rf output
上述代码中,第 2 行的 make 命令用于清除之前的编译结果,第 3 行的 make 命令用于配置编译环境,第 4 行的 make 命令用于打开内核配置界面,第 5 行的 make 命令用于编译内核,第 6 行的 make 命令用于编译内核镜像,第 7 行的 make 命令用于编译内核模块,第 8 行的 make 命令用于编译设备树二进制文件,第 9 行的 make 命令用于编译特定设备树文件,第 10-18 行的命令用于创建输出目录,并将编译结果复制到输出目录中,最后一行的命令用于清除临时文件。
这个脚本是针对 MX6ULL alientek EMMC 核心板进行编译的,如果需要编译其他型号的核心板,则需要相应调整配置文件和设备树文件的名称。
make: *** No rule to make target 'topeet_mx6ull_emmc_defconfig'。 停止。
根据引用\[1\]中提到的配置文件和引用\[2\]中提到的命令,可以看出在执行"make topeet_mx6ull_emmc_defconfig"命令时出现了错误。错误信息"make: *** No rule to make target 'topeet_mx6ull_emmc_defconfig'"表示在uboot的Makefile中没有找到名为'topeet_mx6ull_emmc_defconfig'的规则。
可能的原因是配置文件'topeet_mx6ull_emmc_defconfig'不存在或者没有正确放置在uboot的configs目录中。请确保该配置文件存在,并且位于正确的位置。
另外,还需要检查Makefile文件中的路径是否正确。根据引用\[3\]中提到的修改,需要确保在board/freescale/topeet_mx6ull_emmc/Makefile文件的第6行中正确设置了obj-y的值为topeet_mx6ull_emmc.o。
请检查以上两个方面的问题,并确保配置文件和路径设置正确后再次尝试执行命令。
#### 引用[.reference_title]
- *1* *2* [I.MX6ULL_Linux_系统篇(12)uboot了解与编译](https://blog.csdn.net/weixin_41252596/article/details/127164688)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [i.MX6ULL终结者U-Boot移植](https://blog.csdn.net/weixin_46635880/article/details/109525536)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]