riscv-software-src / riscv-tools

RISC-V Tools (ISA Simulator and Tests)
1.14k stars 447 forks source link

Error when executing ./build.sh #231

Closed willeggeredwin closed 6 years ago

willeggeredwin commented 6 years ago

I tried to build the riscv-tools but I get the following error:

/riscv-tools/riscv-tests/build/../isa/../env/v/link.ld:0: syntax error collect2: error: ld returned 1 exit status make[1]: *** [rv32ui-v-simple] Fehler 1 make: *** [isa] Fehler 2

I'am using Ubuntu 16.04 and gcc version 5.4.0

jim-wilson commented 6 years ago

It isn't obvious what the problem is. You may have to debug it a bit on your side. For some reason the linker script file isn't parsing correctly, but the really odd thing is that the parse error is happening before reading the first line which is very odd.

You can find the build command in the file riscv-tests/build/build.log, look for the rv32ui-v-simple build command. You can try running that with -v and -Wl,--verbose to see what the compiler and linker are doing. You should also try using "git status" in the riscv-tests dir to make sure that you haven't accidentally modified any source files.

riscv-test is an ISA testsuite for verifying hardware implementations, not a testsuite for the compiler, so it doesn't really matter if it works if you just care about the compiler. If you can compile a hello world problem then you are probably OK and can ignore riscv-tests, unless perhaps you need it for some reason.

By the way, riscv-tools is old, unmaintained, and unsupported. If you want a compiler, you are better off using riscv-gnu-toolchain directly. This tree is being maintained. If you want a linux kernel + buildroot, I'd suggest sifive/freedom-u-sdk.

willeggeredwin commented 6 years ago

Thanks for the very fast response and the possible places where I can look to solve the issue.

At the moment I don't need the test suit but maybe I will have to use it later, because I'll have to verify my hardware implementation.

I am using riscv-tools because I am working on a branch of a RISCV-CPU called Ariane and they were using it. But thanks for the idea of using the riscv-gnu-toolchain as a compiler. I'will take a look at it.

willeggeredwin commented 6 years ago

Together with a friend I found the reason for the problem. I was installing the tool chain on a shared folder of my virtual machine. This caused the problem.

I installed the tools now to an ordinary folder, and it works! :-)