-
Notifications
You must be signed in to change notification settings - Fork 35
gcc: Zc toolchain does not seem to allow half-word aligned functions #180
Comments
Hi - I think you should put this issue here instead: https://github.com/plctlab/llvm-project |
Possible duplicate of plctlab/corev-gcc#2 |
Using Are the gcc submodule pointers in this repo up to date with the newest development of the zc extension in gcc? |
Yes, that submodule points to the latest commit. What libc is it using, and how many variations you ended up after the compilation in install/riscv32-unkown-elf/lib ? |
It's using newlib-nano as far as I know and we end up with one variation "rv32ima" in the riscv32-unknown-elf/lib/ folder. The multilib generator string is I see the compiler produce cm.push and cm.pop instructions, however it does not produce any table jump code. Is there anything specific I need to enable to get gcc to use table-jumps? |
Yep, that didn't work with me, I had to specify the multilib generator string explicitly for it to generate the correct libs |
Re table jump, that should work without anything specific, for me simply march=rv32ima_zca_zcmt resulted in the linker generating them ! |
Do you know why we specify |
Zca = C without Floats, you need to use that now instead of C since we reuse the some of the compressed floating point instructions encoding space. |
I see, that makes sense. When it comes to the table jump it seems like there is something inside libc which is triggering the inclusion/exclusion of the table jump functionality. When I use nano.specs which pulls in libc_nano.a then the table jump functionality is turned off. If I don't use nano.specs and pull in libc.a then table jump is present. |
I am not sure what is causing that, two things come to my mind, either the linker search for setting up JVT CSR in the bootstrap code, or there is something differing in the linker script ? |
When libc.a is added I see that a section called |
I added an issue to the corev-binutils-gdb project for the table jump issues openhwgroup/corev-binutils-gdb#44. |
When building code with the gcc Zc* toolchain supplied in this repo I notice that functions are always word aligned and padding bytes are added which makes the code size larger than expected. Is this a bug in the toolchain, or is there a way I can force the compiler to accept half-word aligned functions when building with the documented Zc* march argument
-march=rv32ima_zca_zcb_zcmb_zcmp_zcmt -mabi=ilp32
The text was updated successfully, but these errors were encountered: