No, that's not correct. Newlib is simply a slimmer version of libc,
but still by default makes Linux syscalls for things such as printf.
It is absolutely normal to use riscv64-unknown-elf-gcc to make
programs to run in Spike because the most important attribute is it
links the program statically, so everything needed is included in the
one binary.
I use riscv64-unknown-elf-gcc all the time to make programs that I
want to run on a variety of RISC-V Linux boards with different OS
distros and different glibc versions.
On Tue, Mar 5, 2024 at 2:26 AM Tommy Murphy <
tommy_...@hotmail.com> wrote:
>
> You're compiling your program with a bare-metal Newlib toolchain (e.g. riscv64-unknown-elf-gcc) but running Spike with pk which is normally (always?) intended for programs compiled with the Linux toolchain (e.g. riscv64-unknown-linux-gnu-gcc) creating a Linux user mode executable.
>
> You should search for information about running bare-metal programs on Spike. There should be some useful info out there for your situation. Or else try compiling your program with a RISC-V Linux toolchain.
>
> --
> You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
sw-dev+un...@groups.riscv.org.
> To view this discussion on the web visit
https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/LO2P123MB7050F3AE610DEE51BD6386D2F9232%40LO2P123MB7050.GBRP123.PROD.OUTLOOK.COM.