Open MarcoBonino opened 1 month ago
Assuming the link passed, what do you plan to do with the resulting binary?
Assuming the link passed, what do you plan to do with the resulting binary?
Run it! For now it will be on simulators, like spike, qemu...
Run it! For now it will be on simulators, like spike, qemu...
And how do you expect the output stream resulting from writing to cout
to reach you?
Run it! For now it will be on simulators, like spike, qemu...
And how do you expect the output stream resulting from writing to
cout
to reach you?
Not sure how it works... I was using riscv64-unknown-elf-g++ from https://github.com/riscv-software-src/homebrew-riscv/blob/HEAD/riscv-gnu-toolchain.rb before. That was able to compile and I could run and see the print using "spike pk my_binary".
In general I would like to link all statically in the final binary, so that It should run without extra libraries (if I'm correct).
I could run and see the print using "spike pk my_binary".
That binary worked because that toolchain is specific to spike.
Generally you have to add code to redirect the output to something your environment supports, like semihosting, which is supported well by QEMU.
But things are not that obvious as you may think, you have to define a startup, linker scripts, etc.
You can try to instantiate a project from my hello-world-qemu-template-xpack project template and take a look at the resulting code.
Hello!
I'm trying to use the toolchain 14.2.0 (also tried with 13.2.0). I'm always getting the same link error when my code use some c++ std things (like cout or vector).
I downloaded the toolchain but also tried to install it via package manager. Same error.
See the example:
Compilation:
Am I doing something wrong ? Could you help on this ?
Thanks!