rsd-devel / rsd

RSD: RISC-V Out-of-Order Superscalar Processor
Apache License 2.0
934 stars 95 forks source link

Use C libraries like string.h and stddef.h #24

Open odxa20 opened 3 years ago

odxa20 commented 3 years ago

Is there a way to use some of the libraries included with the gnu toolchain when writing programs ? Whenever I try to use the string library I get the following error

undefined reference to `strlen'

I have tried removing the -ffreestanding -fno-builtin -nostdlib -nodefaultlibs flags from the Makefile but I've had no luck

shioyadan commented 3 years ago

Sorry for my late reply. In general, GLIBC integrated into GCC cannot be used in RSD because GLIBC works along with OS such as Linux. Instead of the default GLIBC, you have to use libc that can be used under a bare-metal environment without rich OS features.

We confirmed that some applications built for Zephyr OS, which is an embedded OS, can be executed on RSD. So, if you need libc features, my recommendation is to try Zephyr OS.

We are now working on providing some scripts that convert ELF binaries built for Zephyr OS into code.hex for RSD.