riscv-software-src / riscv-tools

RISC-V Tools (ISA Simulator and Tests)
1.13k stars 446 forks source link

RISC-V libc Package for Ubuntu? #309

Open bradjc opened 4 years ago

bradjc commented 4 years ago

It doesn't seem like there is a newlib or libc package for ubuntu. I see the compiler here, but I am unable to actually compile since I get errors about missing libraries and header files.

Can you ask that a newlib package be added, or point me in the right direction? It's not really clear who (or which organization) in the risc-v ecosystem might be responsible for this, so I thought this repo might be a place to start.

jim-wilson commented 4 years ago

riscv-tools is a collection of misc tools, mostly for hardware developers. riscv-gnu-toolchain is the GNU toolchain. RISC-V International does not have the resources to build toolchains for every linux distro. Toolchains if any are built by the linux distros themselves.

Most linux distros will build linux cross compilers for other platforms they support, and debian does support riscv64, so debian has a full set of linux cross compiler packages for riscv64, which ubuntu has then inherited from debian. This compiler appears functional, though I have to static link to get it to run on qemu. Looks like a library path problem which I didn't investigate.

Most linux distros don't build embedded elf cross compilers. Debian does have a volunteer that provides a cross compiler package for arm and riscv64. Ubuntu has inherited this from Debian, though it does seem like the Ubuntu packages are incomplete. The C library is missing. This is either an Ubuntu bug, not pulling all of the packages from Debian, or a Debian bug for providing an incomplete package list. It isn't something we can fix here. You would have to take it up with Ubuntu and/or Debian as appropriate.

The easy solution is to just build your own toolchain. Or download one from someone building packags. The SiFive web site for instance has toolchain binaries you can download and install for several popular systems, including Ubuntu. And we have pointers to some third party toolchains also.

bradjc commented 4 years ago

I thought maybe you would know of someone in particular who might be willing to help. Having easy access to toolchains really lowers the bar for development. We're working on an OS with embedded RISC-V support, and it isn't feasible for us to ask our (potentially new) users to compile a toolchain from source.

jim-wilson commented 4 years ago

RISC-V International doesn't have engineering staff, and there are only a very small number of volunteers contributing to the toolchain. SiFive has toolchains on its web site. Liviu ionescu has a nice eclipse based embedded cross compiler system though I think it is mainly built for MS Windows. There are various commercial toolchains that are now available. Most recent linux distros will have riscv64-linux compilers available. Most linux distors won't have riscv64-elf cross compilers, though debian testing has a set of packages that should work. Otherwise, you have to build one.

The RISC-V International web site has pointers to available software. https://riscv.org/software-status/

This is actually boards and software, scroll down to find the software. https://www.sifive.com/boards

tommythorn commented 2 years ago

FWIW, that https://riscv.org/software-status/ is 404 now.

jim-wilson commented 2 years ago

The riscv.org web site has a "RISC-V Exchange" menu with an "Available Software" menu item that points at https://riscv.org/exchange/software/ which is also a 404. Shrug. I'll send email to help@riscv.org to report the problem.

Some of the old info is now in the wiki. https://wiki.riscv.org/display/HOME/RISC-V+Software+Ecosystem but the focus of these pages are different. This isn't a list of commercial tools, but rather a list of what features are supported in the free tools.

jim-wilson commented 2 years ago

The RISC-V Exchange Available Software page is working again, though the URL has changed, again. https://riscv.org/exchanges/software/ I was told that they are migrating RISC-V Exchange to a new system, so there may be some more interruptions in services for these pages. You might want to try using the menus on the riscv.org site to reach these pages rather than the URLs here.