Xilinx Vitis arm-xilinx-eabi-gcc.exe: error: *.c: Invalid argument

This problem may be a bug of version 2021.1 only. Unfortunately, I'm just currently using this version.

After Build Project:

Find where this Makefile is through "make: Leaving directory" information. For me, it is located at  Zynq_CPU_wrapper_hw_platform_1\zynq_fsbl\zynq_fsbl_bsp\ps7_cortexa9_0\libsrc\rtl_multiplier_v1_0\src\Makefile (we assume Zynq_CPU_wrapper_hw_platform_1 is the platform name and is under the Vitis workspace folder). Locate this file, we see the following code:

COMPILER=
ARCHIVER=
CP=cp
COMPILER_FLAGS=
EXTRA_COMPILER_FLAGS=
LIB=libxil.a

RELEASEDIR=../../../lib
INCLUDEDIR=../../../include
INCLUDES=-I./. -I${INCLUDEDIR}

INCLUDEFILES=*.h
LIBSOURCES=*.c
OUTS = *.o

libs:
	echo "Compiling rtl_multiplier..."
	$(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) $(LIBSOURCES)
	$(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OUTS}
	make clean

include:
	${CP} $(INCLUDEFILES) $(INCLUDEDIR)

clean:
	rm -rf ${OUTS}

According to

Drivers created in Vivado fail in Vitis 2021.1https://support.xilinx.com/s/question/0D52E00006ihQSXSA2/drivers-created-in-vivado-fail-in-vitis-2021175527 - Drivers created in Create or Import Wizard in Vivado fail in Vitishttps://support.xilinx.com/s/article/75527

and damiet's answer inVitis IDE 2021.1 custom AXI IP core compile errorhttps://support.xilinx.com/s/question/0D52E00006hpYgWSAU/vitis-ide-20211-custom-axi-ip-core-compile-errorNote if we do not modify LIBSOURCES as instructed above, there will be still an error pointing to the same line because it requires $(LIBSOURCES):

We modify the Makefile as:

COMPILER=
ARCHIVER=
CP=cp
COMPILER_FLAGS=
EXTRA_COMPILER_FLAGS=
LIB=libxil.a

RELEASEDIR=../../../lib
INCLUDEDIR=../../../include
INCLUDES=-I./. -I${INCLUDEDIR}

INCLUDEFILES=*.h
LIBSOURCES=$(wildcard *.c)
OUTS = *.o
OBJECTS = $(addsuffix .o, $(basename $(wildcard *.c)))
ASSEMBLY_OBJECTS = $(addsuffix .o, $(basename $(wildcard *.S)))

libs:
	echo "Compiling rtl_multiplier..."
	$(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) $(LIBSOURCES)
	$(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OBJECTS} ${ASSEMBLY_OBJECTS}
	make clean

include:
	${CP} $(INCLUDEFILES) $(INCLUDEDIR)

clean:
	rm -rf ${OBJECTS} ${ASSEMBLY_OBJECTS}

We only modify LIBSOURCES, add OBJECTS and ASSEMBLY_OBJECTS, and replace $(OUTS) at $(ARCHIVER) line and rm -rf line with $(OBJECTS) $(ASSEMBLY_OBJECTS). If you go through Makefile under other directories under libsrc, like Zynq_CPU_wrapper_hw_platform_1\zynq_fsbl\zynq_fsbl_bsp\ps7_cortexa9_0\libsrc\cpu_cortexa9_v2_11\src\Makefile, you will see how is this patch invented.

This time building goes further, but still fails:

and two identical pop-up windows:

By adding echo, we found that this error is no longer caused by the Makefile we modified before. Reading information given by Build Console carefully, we found the following information:

'Finished building libraries'

make: Leaving directory 'D:/Documents/GitHub/ECE4810J_FA2021/Lab1/Zynq_CPU_wrapper_hw_platform_1/zynq_fsbl/zynq_fsbl_bsp'

arm-none-eabi-gcc -o fsbl.elf  sd.o  nand.o  image_mover.o  md5.o  fsbl_hooks.o  main.o  nor.o  qspi.o  rsa.o  ps7_init.o  pcap
.o  fsbl_handoff.o -MMD -MP       -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard   -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -
Wl,-build-id=none -specs=Xilinx.spec  -lrsa -Wl,--start-group,-lxil,-lgcc,-lc,--end-group -Wl,--start-group,-lxilffs,-lxil,-lgc
c,-lc,--end-group -Wl,--start-group,-lrsa,-lxil,-lgcc,-lc,--end-group                                    -Wl,--gc-sections -Lzy
nq_fsbl_bsp/ps7_cortexa9_0/lib -L./ -Tlscript.ld

Building the BSP Library for domain  - standalone_ps7_cortexa9_0 on processor ps7_cortexa9_0
make --no-print-directory seq_libs

"Running Make include in ps7_cortexa9_0/libsrc/coresightps_dcc_v1_8/src"

make -C ps7_cortexa9_0/libsrc/coresightps_dcc_v1_8/src -s include  "SHELL=CMD" "COMPILER=arm-none-eabi-gcc" "ASSEMBLER=arm-none
-eabi-as" "ARCHIVER=arm-none-eabi-ar" "COMPILER_FLAGS=  -O2 -c" "EXTRA_COMPILER_FLAGS=-mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=h
ard -nostartfiles -g -Wall -Wextra -fno-tree-loop-distribute-patterns"

For me, it is located at Zynq_CPU_wrapper_hw_platform_1\ps7_cortexa9_0\standalone_ps7_cortexa9_0\bsp\ps7_cortexa9_0\libsrc\rtl_multiplier_v1_0\src\Makefile. Its contents are identical to the contents of the previous Makefile.

Interestingly, another same Makefile Zynq_CPU_wrapper_hw_platform_1\hw\drivers\rtl_multiplier_v1_0\src\Makefile does not cause any errors.

After done that, we can see the qemu_args.txt error mentioned by Programaths's answer in

Vitis 2021.1 error Makefilehttps://support.xilinx.com/s/question/0D52E00006hpRo8SAE/vitis-20211-error-makefile

10:48:42 **** Incremental Build of configuration Debug for project hello_rtl_multiplier_system ****
make all 
Generating bif file for the system project
generate_system_bif.bat 1453 D:/Documents/GitHub/ECE4810J_FA2021/Lab1/Zynq_CPU_wrapper_hw_platform_1/export/Zynq_CPU_wrapper_hw_platform_1/Zynq_CPU_wrapper_hw_platform_1.xpfm standalone_ps7_cortexa9_0 D:/Documents/GitHub/ECE4810J_FA2021/Lab1/hello_rtl_multiplier_system/Debug/system.bif
sdcard_gen --xpfm D:/Documents/GitHub/ECE4810J_FA2021/Lab1/Zynq_CPU_wrapper_hw_platform_1/export/Zynq_CPU_wrapper_hw_platform_1/Zynq_CPU_wrapper_hw_platform_1.xpfm --sys_config Zynq_CPU_wrapper_hw_platform_1 --bif D:/Documents/GitHub/ECE4810J_FA2021/Lab1/hello_rtl_multiplier_system/Debug/system.bif --bitstream D:/Documents/GitHub/ECE4810J_FA2021/Lab1/hello_rtl_multiplier/_ide/bitstream/Zynq_CPU_wrapper_hw_platform_1.bit --elf D:/Documents/GitHub/ECE4810J_FA2021/Lab1/hello_rtl_multiplier/Debug/hello_rtl_multiplier.elf,ps7_cortexa9_0
creating BOOT.BIN using D:/Documents/GitHub/ECE4810J_FA2021/Lab1/hello_rtl_multiplier/_ide/bitstream/Zynq_CPU_wrapper_hw_platform_1.bit
Error intializing SD boot data : Software platform XML error, sdx:qemuArguments value "Zynq_CPU_wrapper_hw_platform_1/qemu/qemu_args.txt" path does not exist D:/Documents/GitHub/ECE4810J_FA2021/Lab1/Zynq_CPU_wrapper_hw_platform_1/export/Zynq_CPU_wrapper_hw_platform_1/sw/Zynq_CPU_wrapper_hw_platform_1/qemu/qemu_args.txt, platform path D:/Documents/GitHub/ECE4810J_FA2021/Lab1/Zynq_CPU_wrapper_hw_platform_1/export/Zynq_CPU_wrapper_hw_platform_1, sdx:configuration Zynq_CPU_wrapper_hw_platform_1, sdx:image standard
make: *** [makefile:39: package] Error 1

10:48:48 Build Finished (took 5s.544ms)

Under Zynq_CPU_wrapper_hw_platform_1\export\Zynq_CPU_wrapper_hw_platform_1\sw\Zynq_CPU_wrapper_hw_platform_1, create a new folder called qemu, and create a new TXT file called qemu_args.txt under qemu folder. Just leave it empty (you may find another existing qemu_args under standalone_ps7_cortexa9_0\qemu folder).

Finally, we solved this problem. 

make: arm-xilinx-linux-gnueabi-gcc: Command not found CLEAN scripts/basic make[2]: arm-xilinx-linux-gnueabi-gcc: Command not found CLEAN scripts/kconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o HOSTCC scripts/kconfig/confdata.o HOSTCC scripts/kconfig/expr.o LEX scripts/kconfig/lexer.lex.c YACC scripts/kconfig/parser.tab.[ch] HOSTCC scripts/kconfig/lexer.lex.o HOSTCC scripts/kconfig/parser.tab.o HOSTCC scripts/kconfig/preprocess.o HOSTCC scripts/kconfig/symbol.o HOSTLD scripts/kconfig/conf scripts/Kconfig.include:35: compiler 'arm-xilinx-linux-gnueabi-gcc' not found scripts/kconfig/Makefile:90: recipe for target 'xilinx_zynq_defconfig' failed make[1]: *** [xilinx_zynq_defconfig] Error 1 Makefile:567: recipe for target 'xilinx_zynq_defconfig' failed make: *** [xilinx_zynq_defconfig] Error 2 UPD scripts/kconfig/mconf-cfg HOSTCC scripts/kconfig/mconf.o HOSTCC scripts/kconfig/lxdialog/checklist.o HOSTCC scripts/kconfig/lxdialog/inputbox.o HOSTCC scripts/kconfig/lxdialog/menubox.o HOSTCC scripts/kconfig/lxdialog/textbox.o HOSTCC scripts/kconfig/lxdialog/util.o HOSTCC scripts/kconfig/lxdialog/yesno.o HOSTLD scripts/kconfig/mconf scripts/kconfig/mconf Kconfig scripts/Kconfig.include:35: compiler 'arm-xilinx-linux-gnueabi-gcc' not found scripts/kconfig/Makefile:33: recipe for target 'menuconfig' failed make[1]: *** [menuconfig] Error 1 Makefile:567: recipe for target 'menuconfig' failed make: *** [menuconfig] Error 2 Makefile:613: include/config/auto.conf: 没有那个文件或目录 Makefile:660: include/config/auto.conf.cmd: 没有那个文件或目录 make: arm-xilinx-linux-gnueabi-gcc: Command not found *** *** Configuration file ".config" not found! *** *** Please run some configurator (e.g. "make oldconfig" or *** "make menuconfig" or "make xconfig"). *** Makefile:663: recipe for target '.config' failed make: *** [.config] Error 1
最新发布
03-21
<think>嗯,用户遇到了编译错误,提示找不到arm-xilinx-linux-gnueabi-gcc这个命令。首先,我需要确认这个错误的原因。可能的情况是交叉编译工具链没有安装或者没有正确配置环境变量。 用户可能是在为XilinxZynq平台编译内核或驱动,所以需要对应的交叉编译器。常见的解决方案是安装Xilinx提供的工具链,比如Vitis或PetaLinux。另外,需要检查工具链的路径是否添加到PATH环境变量中,或者是否通过CROSS_COMPILE变量指定了正确的前缀。 另外,错误信息中显示在运行make xilinx_zynq_defconfig时失败,这通常是因为配置过程中需要交叉编译器来检查一些依赖项。如果工具链没有安装,配置步骤就会失败。用户可能没有正确安装工具链,或者安装后没有激活环境设置脚本。 还有,后续出现的menuconfig错误和缺少.config文件,可能是因为初始配置失败,导致后续步骤无法进行。需要先解决编译器缺失的问题,才能继续配置和编译。 需要提醒用户检查工具链的安装情况,确认安装路径,并正确设置环境变量。如果是使用PetaLinux,可能需要先运行source settings.sh来设置环境。如果工具链未安装,应指导用户从Xilinx官网下载并安装合适的版本。 可能还需要验证交叉编译器是否能在命令行中直接运行,输入完整路径看是否存在,或者检查是否有拼写错误。有时候,工具链的前缀可能略有不同,比如arm-xilinx-linux-gnueabihf-gcc,需要注意是否正确。 总结下来,用户需要安装正确的交叉编译工具链,并确保环境变量配置正确,特别是PATH和CROSS_COMPILE,这样才能解决找不到编译器的问题,进而继续编译过程。</think>这个错误信息表明编译过程中找不到 `arm-xilinx-linux-gnueabi-gcc` 交叉编译器。以下是逐步分析和解决方案: --- ### **原因分析** 1. **交叉编译器未安装** 系统缺少针对ARM架构的Xilinx交叉编译工具链(`arm-xilinx-linux-gnueabi-gcc`),导致无法编译针对Zynq平台的Linux内核或驱动。 2. **环境变量未配置** 即使已安装工具链,若未正确设置 `PATH` 或 `CROSS_COMPILE` 环境变量,系统仍无法找到编译器。 3. **Makefile配置问题** 编译脚本(如 `Kconfig` 或 `Makefile`)要求使用特定名称的交叉编译器,但实际安装的版本可能名称不同。 --- ### **解决方案** #### **1. 安装Xilinx交叉编译工具链** Xilinx工具链通常包含在以下开发套件中: - **PetaLinux**: Xilinx官方嵌入式Linux开发工具,自动配置工具链。 - **Vitis SDK**: 提供独立安装的交叉编译器。 **安装步骤**- **方法1**: 通过PetaLinux安装 运行 PetaLinux 安装目录下的环境配置脚本: ```bash source <petalinux-install-dir>/settings.sh ``` - **方法2**: 手动下载工具链 从[Xilinx官网](https://www.xilinx.com/support/download.html)下载 `arm-xilinx-linux-gnueabi-gcc` 对应的工具链(如 `Xilinx Embedded Toolchain`),解压后添加路径到 `PATH`: ```bash export PATH=/path/to/toolchain/bin:$PATH ``` --- #### **2. 配置环境变量** 在编译前需明确指定交叉编译器: ```bash # 设置交叉编译器前缀 export CROSS_COMPILE=arm-xilinx-linux-gnueabi- # 检查编译器是否存在 which ${CROSS_COMPILE}gcc ``` --- #### **3. 修复编译配置** 若已安装工具链但名称不匹配,可尝试以下操作: - **修改Makefile**:将 `CROSS_COMPILE` 改为实际安装的编译器前缀。 - **符号链接**:为编译器创建软链接以匹配名称: ```bash sudo ln -s /path/to/your/gcc /usr/bin/arm-xilinx-linux-gnueabi-gcc ``` --- #### **4. 重新编译** 确保环境变量生效后,清理并重新编译: ```bash make distclean make xilinx_zynq_defconfig make menuconfig # 或直接 make ``` --- ### **验证工具链是否生效** 运行以下命令检查交叉编译器版本: ```bash arm-xilinx-linux-gnueabi-gcc --version ``` 若输出类似以下信息,则工具链已正确安装: ``` arm-xilinx-linux-gnueabi-gcc (Xilinx Embedded Toolchain) x.x.x ``` --- ### **常见问题排查** - **权限问题**:确保工具链可执行文件具有 `+x` 权限。 - **路径错误**:检查工具链安装路径是否与 `PATH` 中配置的一致。 - **依赖缺失**:安装32位兼容库(在64位系统上): ```bash sudo apt install lib32stdc++6 # Ubuntu/Debian ``` --- 通过以上步骤应能解决 `arm-xilinx-linux-gnueabi-gcc` 缺失的问题。如果仍遇到错误,请检查Xilinx文档或社区支持论坛。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Ayka

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值