As part of a CHERI project I'm working on, I'm trying to compile a `static-pie` executable to run on a Morello box with Linux installed. I'm using pre-built binaries for the `gcc` compiler for x86-64 host [1] for this. In my example, trying to compile with native `gcc` and the `-static-pie` flag works, but trying to compile the same with Morello `gcc` fails. I have some leads on what the issue might be (and might add a follow-up post with more detail), but before I spend more time on this, I'd like to inquire if anyone might be aware whether `-static-pie` might just not be supported by the Morello `gcc` compiler or CHERI, or if it's not fully implemented yet (I am aware that CheriBSD does not support this, but that would be due to it being forked off FreeBSD, which also does not support `static-pie`s, to my knowledge).
Regards,Andrei.
[1] developer.arm.com/.../arm-gnu-toolchain-for-morello-downloads
Hi Andrei,
I checked with the Morello GNU folks - at the moment, Morello glibc doesn't support static PIE. That would require implementing early self-relocation, like in the classic static (non-PIE) case. In principle there should be no blocker on the GCC side though.
Cheers,Kevin
Thanks for the clarification, Kevin. Can I quickly check that "Morello glibc doesn't support static PIE" is correct, and that's not a typo?
I believe that is correct, what is missing to support static PIE is on the glibc side, not GCC.