Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Risc-V Qemu C cross compile error(Risc-V Qemu C cross compile: riscv-none-embed-gcc: command not found)
Risc-V Qemu C cross compile error [message #1844906] Wed, 29 September 2021 08:55 Go to next message
Eclipse UserFriend
A standard "Hello World" C issue:

14:32:10 **** Incremental Build of configuration Debug for project test ****
make all
Building target: test.elf
/bin/sh: riscv-none-embed-gcc: command not found
Invoking: GNU RISC-V Cross C Linker
riscv-none-embed-gcc -msmall-data-limit=8 -mno-save-restore -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g3 -Xlinker --gc-sections -Wl,-Map,"test.map" -o "test.elf" ./main.o
make: *** [test.elf] Error 127
"make all" terminated with exit code 2. Build might be incomplete.

14:32:10 Build Failed. 2 errors, 0 warnings. (took 71ms)

riscv-none-embed-gcc is nowhere in the startup disc.

I found riscv-none-embed-gcc at: https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/ but I don't know how to install it.

How to fix "/bin/sh: riscv-none-embed-gcc: command not found" ?

Mac Sierra 10.12.6.


Re: Risc-V Qemu C cross compile error [message #1844909 is a reply to message #1844906] Wed, 29 September 2021 09:49 Go to previous message
Eclipse UserFriend
Eclipse doesn't supply build tools like compilers
so you need to install it yourself.

I have never used this cross compiler myself but, in general,
suggest you get the version most appropriate for your system.
If you are using Linux (which I'm guessing you are)
it's probably the one labelled linux-x64.

The best place to get information on how to install it is at the github site.
The link to it is in the link you provided: "Continue reading »"
https://xpack.github.io/blog/2021/01/05/riscv-none-embed-gcc-v10-1-0-1-1-released/
in a section unsurprisingly labelled: Install.
Ask there (the support is linked in the page)

If you need to, you can compile and install it yourself.

After you get it, tell Eclipse you are using a Cross Compiler
and set:

  • PATH: the path to the gcc (usually ends in /bin)
  • PREFIX: what ever is in front of gcc in that directory
    (maybe riscv-none-embed- ?)



[Updated on: Wed, 29 September 2021 15:05] by Moderator

Previous Topic:Problems with GDB with Eclipse for C/C++ on Windows
Next Topic:Link library
Goto Forum:
  


Current Time: Sun Jul 13 01:40:52 EDT 2025

Powered by FUDForum. Page generated in 0.03650 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top