[RESEND PATCH] Makeconfig: Set pie-ccflag to -fPIE by default

Wilco Dijkstra Wilco.Dijkstra@arm.com
Tue Sep 20 13:59:45 GMT 2022


Hi Fangrui,

> In Clang, -fpic/-fPIC without  -fno-semantic-interposition still allows
> interprocedural optimizations of default visibility external linkage definitions.
>
> It is unfortunate that GCC doesn't allow it and
> --enable-default-semantic-interposition is rejected (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100937)

I think it now does it with -Ofast, so that's a start at least...

> So if such an option -ffast-PIC is made, it will only benefit GCC.
> I have a long write-up in https://maskray.me/blog/2021-05-09-fno-semantic-interposition#in-action

Well if changing the default of fPIC is unacceptable in GCC, adding a new option
should help LLVM too since it could imply more than -fno-semantic-interposition.
A key question is whether we could require that exported symbols are marked
explicitly so that we only emit GOT and PLT indirections on such exported symbols.

Cheers,
Wilco


More information about the Libc-alpha mailing list