On Thu, Oct 18, 2018 at 1:04 AM Antti Lukats <
antti....@gmail.com> wrote:
> ..\bin\riscv-none-embed-gcc.exe -march=rv32i -mabi=ilp32 -DPREALLOCATE=1 -mcmodel=medany -static -nostdlib --std=gnu99 -O3 -ffast-math -fno-common -fno-builtin-printf -Wl,-static,-nostdlib,-nostartfiles,-lm,-lgcc,-T test.ld crt.S syscalls.c dhrystone.c dhrystone_main.c
The -lm -lgcc must be at the end of the compiler command line. Unix
style libraries are only used to satisfy undefined symbol references.
If you put a library first on the link line, there will be no
undefined references at the time that the linker looks at the library,
and hence no symbols will be pulled from the library.
"-Wl,-T test.ld" isn't a valid option combination. This is only
working by accident. This should either be "-Wl,-T,test.ld" or else
just "-T test.ld" because the compiler driver does know about the
linker -T option and will handle it correctly.
You used -static twice. You only need to pass it to the compiler, and
the compiler will then pass it to the linker.
You are passing -nostartfiles to the linker, but it is a compiler
option not a linker option.
Jim