GNU RISC-V 嵌入式海合会扔出“x ISA 扩展 `xw 必须与版本设置为xw ”错误
原标题:GNU RISC-V Embedded GCC throws "x ISA extension `xw must be set with the versions" error
I can build the c-files from my WCH CH32V003F4P6 microcontroller project with the GNU RISC-V Embedded GCC v8.2.0 toolchain shipped with the Eclipse IDE from WCH (MounRiver Studio). However, if I try to build the same c-files with a similar toolchain downloaded here (see https://xpack.github.io/dev-tools/riscv-none-elf-gcc/releases/), then I get incomprehensible errors like:
Error: x ISA extension xw must be set with the versions
or
cc1.exe: error: -march=rv32ecxw: unsupported ISA substring xw
Reproduce the problem
To reproduce the problem, you should:
First install MounRiver Studio (see http://www.mounriver.com/download)
Second, download the microcontroller sample projects from http://www.wch-ic.com/products/CH32V003.html (see the CH32V003EVT.ZIP file at the bottom of the webpage). Unzip it to your C:/ drive. The GPIO_Toggle sample project is now at "C:/CH32V003EVT/EVT/EXAM/GPIO/GPIO_Toggle/".
Let s now compile the main.c file from the GPIO_Toggle project, like this:
> "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
This should work.
Let s try with a few other toolchains. Download some GNU RISC-V Embedded GCC toolchains from here: https://xpack.github.io/dev-tools/riscv-none-elf-gcc/releases/
Unzip them to your C:/ drive:
Now invoke the same compilation command with each of these toolchains:
> "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
-...
I got these obscure errors:
Error: x ISA extension xw must be set with the versions
cc1.exe: error: -march=rv32ecxw: unsupported ISA substring xw
I can t wrap my head around them.
Compare the toolchains
As a first reaction, I compare the toolchains. The one from MounRiver Studio outputs the following for --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.
I get the exact same output from one of the other toolchains:
> "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.
So they must be identical, no? How then is it possible that the one from MounRiver works and the other one doesn t?
问题回答
The xPack GNU RISC-V Embedded GCC supports only the standard RISC-V extensions. The xw extension is custom one, added by WCH for their own designs, and is supported only by their custom toolchain.
相关问题
Fastest method for running a binary search on a file in C?
For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...
开放源C/C++ 3d 提供器(在3ds 最大模型的支持下)
最好、最小、最快、开放的来源、C/C++ 3d 提供方(在3ds max模型的支持下),而不是通用公平市价,
Print possible strings created from a Number
Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad.
i.e. for 1,0-> No Letter
for 2->...
Tips for debugging a made-for-linux application on windows?
I m trying to find the source of a bug I have found in an open-source application.
I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...
Trying to split by two delimiters and it doesn t work - C
I wrote below code to readin line by line from stdin ex.
city=Boston;city=New York;city=Chicago
and then split each line by ; delimiter and print each record.
Then in yet another loop I try to ...
Good, free, easy-to-use C graphics libraries? [closed]
I was wondering if there were any good free graphics libraries for C that are easy to use?
It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...
DDD Alternative that also Draws Pretty Pictures of Data Structures
Is there anything other than DDD that will draw diagrams of my data structures like DDD does that runs on Linux?
ddd is okay and runs, just kind of has an old klunky feeling to it, just wanted to ...
Encoding, decoding an integer to a char array
Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array?
I was looking for an answer but didn t get any satisfactory answer in the ...