On 08/09/2022 07:10, Jan Beulich wrote:
> On 07.09.2022 16:33, Julien Grall wrote:
>> On 25/08/2022 08:17, Jan Beulich wrote:
>>> I haven't been able to find evidence of "-nopie" ever having been a
>>> supported compiler option. The correct spelling is "-no-pie".
>>> Furthermore like "-pie" this is an option which is solely passed to the
>>> linker. The compiler only recognizes "-fpie" / "-fPIE" / "-fno-pie", and
>>> it doesn't infer these options from "-pie" / "-no-pie".
>> OOI, how did you find out this issue?
> By reviewing Andrew's "x86/hvmloader: Don't build as PIC/PIE".

It was actually first discussed here:
https://lore.kernel.org/xen-devel/[email protected]/

The reason why I hadn't got back around to this patch yet is because the
commit message is wrong (not helped to some appalling GCC/Binutils
documentation).

The -f forms are to do with GCC code generation.  These are CFLAGS, but
they want want specifying (or not) together, and not split across
EMBEDDED_EXTRA_CFLAGS and something else like this.

The non-f forms are LDFLAGS but do behave as described.  Passing -no-pie
causes GCC to cancel passing -pie to LD; it does not pass -no-pie.  But
it does other things too, because different cr0 objects get passed. 
This matters for hosted binaries, but not for freestanding.

~Andrew

Reply via email to