-
Notifications
You must be signed in to change notification settings - Fork 447
Error while building riscv-tests - Multiple definitions of tohost
and fromhost
- riscv64-unknown-elf-gcc 10.1.0
#316
Comments
sounds like https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common , -fcommon might work as a workaround? |
It has already been fixed in riscv-tests. Unfortunately, riscv-tools is rather poorly maintained, so doesn't have the fix yet. Note that riscv-tools has a version of riscv-tests from Sept 2018, but the last change to riscv-tests was July 14, 2020. There is almost two years worth of changes missing from riscv-tools. The same is true for many of the other submodules. I would suggest avoiding riscv-tools as it is mostly useless, or else if you do use riscv-tools then manually update the submodules to get up to date software. |
I also met this issue and just resolved it. What I did is to modify ./riscv-tests/env/v/vm.c by adding the "extern" when calling tohost and fromhost. Applying "-fcommon" does not work in my case. |
Hi, I confirm that @t-cheng-ou 's workaround worked like a charm and the installation was completed. Thank you very much! Currently the installation path of my risc-v tools is: RISCV=/eda/tools/riscv/riscv-tools and the created folders inside are: ./bin If I understand your suggestion correctly, I should follow the installation instructions here https://github.com/riscv/riscv-tests and use as a prefix path in the .configure step, the risc-v tools installation path shown above: ./configure --prefix=$RISCV/ Am I correct on that? Will this update the riscv-tests submodule incorporating the latest changes? I want to start experimenting with Ariane (https://github.com/openhwgroup/cva6) and according to their installation instruction, RISC-V tools are needed. Thank you in advance for your time on my matter. Kind regards, |
In theory, checking out riscv-tests and building it the same way as the riscv-tools build.sh script does should work. However, I don't know if there are interdependencies between riscv-tests and riscv-isa-sim (aka spike) and other packages. A new version of riscv-tests may not work with the old version of riscv-isa-sim and other packages that you have for instance. You might need to check out and build new versions of the other packages too. Another way to accomplish this is to use riscv-tools, but manually update the submodules. E.g. in the riscv-tools source tree, you can do "cd riscv-tests; git pull" and you will get the current version of riscv-tests. You then need to be careful to avoid doing a git submodule update at the top level, as that will then revert riscv-tests to the old version. As above, this might not work unless you manually update all of the submodules. You can see a list of them in the .gitmodules file. Manually updating submodules might cause other problems if their build systems have changed and are no longer compatible with the riscv-tools build.sh script but that seems unlikely. |
I don't have a Thanks, |
Oops, my bad, vm.c is still there, but in a sub-sub-module (which I had deleted by mistake). |
Switch the riscv-tests submodule in riscv-gnu-toolchain to newer tag or master branch will let the riscv-tools build pass. |
@darren0h I am using master branch of riscv-gnu-toolchain (gcc 10.2.0). but it still reports this error. Is there anything I am missing? |
There is no problem with riscv-gnu-toolchain. it is riscv-tools that is broken; its maintenance is poor to non-existent. You may want to stop using it. Or you can manually update the riscv-tests submodule as riscv-tools has a 2 year old version of it. This bug was fixed in riscv-tests months ago. |
Hi,
I am using riscv64-unknown-elf-gcc (GCC) 10.1.0 version and I am trying to build the riscv-tools.
While trying to build the riscv-tests, I get the following error:
From a search I did, it is reported twice in the parent repo of the riscv-tests as an issue
riscv-software-src/riscv-tests#282
riscv-software-src/riscv-tests#286
It seems that the version of gcc is causing all the fuzz.
Are there any workarounds to finish building (besides using an older version of gcc or a precompiled toolchain)?
Thank you in advance for your responses and help.
Kind regards,
Nassos
The text was updated successfully, but these errors were encountered: