GNU RISC-V 嵌入式 GCC 抛出“x ISA 扩展‘xw’必须使用版本进行设置”错误

问题描述 投票:0回答:1

我可以使用 WCH (MounRiver Studio) 的 Eclipse IDE 随附的

CH32V003F4P6
工具链从我的 WCH
GNU RISC-V Embedded GCC v8.2.0
微控制器项目构建 c 文件。但是,如果我尝试使用此处下载的类似工具链构建相同的 c 文件(请参阅https://xpack.github.io/dev-tools/riscv-none-elf-gcc/releases/),那么我出现难以理解的错误,例如:

Error: x ISA extension 'xw' must be set with the versions

cc1.exe: error: -march=rv32ecxw: unsupported ISA substring 'xw'

重现问题

要重现该问题,您应该:

现在让我们从

main.c
项目编译
GPIO_Toggle
文件,如下所示:

> "C:/MounRiver/MounRiver_Studio/toolchain/RISC-V Embedded GCC/bin/riscv-none-embed-gcc"
    -march=rv32ecxw
    -mabi=ilp32e
    -msmall-data-limit=0
    -msave-restore
    -fsigned-char
    -fno-common
    -Wunused
    -Wuninitialized
    -Og
    -g3
    -fmessage-length=0
    -ffunction-sections
    -fdata-sections
    -Wno-comment
    -Wno-unused-function
    -std=gnu99
    -Werror-implicit-function-declaration
    -I"C:/CH32V003EVT/EVT/EXAM/SRC/Core"
    -I"C:/CH32V003EVT/EVT/EXAM/SRC/Debug"
    -I"C:/CH32V003EVT/EVT/EXAM/SRC/Peripheral/inc"
    -I"C:/CH32V003EVT/EVT/EXAM/GPIO/GPIO_Toggle/User"
    "C:/CH32V003EVT/EVT/EXAM/GPIO/GPIO_Toggle/User/main.c"
    -o "C:/CH32V003EVT/EVT/EXAM/GPIO/GPIO_Toggle/build/main.o"
    -c

这应该有效。

让我们尝试一下其他一些工具链。从这里下载一些

GNU RISC-V Embedded GCC
工具链:https://xpack.github.io/dev-tools/riscv-none-elf-gcc/releases/

将它们解压到您的

C:/
驱动器:

enter image description here

现在使用每个工具链调用相同的编译命令:

> "C:/xpack-riscv-none-embed-gcc-8.2.0-3.1-win32-x32/bin/riscv-none-embed-gcc"
    -march=rv32ecxw
    -mabi=ilp32e
    -...
> "C:/xpack-riscv-none-embed-gcc-8.2.0-3.1-win32-x64/bin/riscv-none-embed-gcc"
    -march=rv32ecxw
    -mabi=ilp32e
    -...
> "C:/xpack-riscv-none-elf-gcc-12.2.0-3-win32-x64/bin/riscv-none-elf-gcc"
    -march=rv32ecxw
    -mabi=ilp32e
    -...

我遇到了这些晦涩的错误:

  • Error: x ISA extension 'xw' must be set with the versions

  • cc1.exe: error: -march=rv32ecxw: unsupported ISA substring 'xw'

我无法理解它们。

比较工具链

作为第一反应,我比较了工具链。 MounRiver Studio 的输出结果为

--version

> "C:/MounRiver/MounRiver_Studio/toolchain/RISC-V Embedded GCC/bin/riscv-none-embed-gcc" --version
riscv-none-embed-gcc (xPack GNU RISC-V Embedded GCC, 32-bit) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

我从其他工具链之一获得完全相同的输出:

> "C:/xpack-riscv-none-embed-gcc-8.2.0-3.1-win32-x32/bin/riscv-none-embed-gcc" --version
riscv-none-embed-gcc (xPack GNU RISC-V Embedded GCC, 32-bit) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

所以它们一定是相同的,不是吗?那么怎么可能MounRiver 的一个可以用而另一个却不能呢?

c gcc embedded riscv riscv32
1个回答
0
投票

xPack GNU RISC-V 嵌入式 GCC 仅支持标准 RISC-V 扩展。 “xw”扩展是自定义扩展,由 WCH 为其自己的设计添加,并且仅受其自定义工具链支持。

© www.soinside.com 2019 - 2024. All rights reserved.