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

Wilco Dijkstra Wilco.Dijkstra@arm.com
Tue Sep 20 16:00:34 GMT 2022


Hi Florian,

>> 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.
>
> -flto with a linker plugin already covers this.  I don't think we need
> anything else.  Maybe an LTO mode that only deals with visibility, but
> otherwise does little cross-TU optimization?

Well it would be great if LTO solved this problem, but unfortunately it can't...
LTO tells you which symbols are locally defined, but this doesn't help PIC.
Local definitions with default visibility must still indirect via the GOT/PLT,
similarly interprocedural optimizations are still blocked.

A LTO-lite option that just deals with visibility and global variable optimization
(eg. better use of anchors) and other cheap optimizations seems useful indeed.

Cheers,
Wilco


More information about the Libc-alpha mailing list