Hello,
I'm working on a hobby OS for x86_64 and would like to use gcc using
both mno-red-zone and mcmodel=kernel.
From https://wiki.osdev.org/Libgcc_without_red_zone, I've work out a
simple patch that I can apply to the source in order to get a
no-red-zone version of ligbcc.
I tried to add "mcmodel=kernel" to MULTILIB_OPTIONS/MULTILIB_DIRNAMES
but it fails with a "cc1: error: code model kernel does not support PIC
mode". The only solution I could found (derived from
https://wiki.osdev.org/Building_libgcc_for_mcmodel=kernel) was to hack
the Makefiles of the libgcc in order to remove the PICFLAG.
But it feels a bit too hacky for me, I would prefer to be able to use a
patch on the original source; instead of the generated one.I did try to
play with ./gcc/src/config/picflag.m4 but without success.
Have help/advice would be appreciated.
Thanks,
Regards,
Ludovic