]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[build] Work around -fPIE patched versions of gcc on all architectures
authorMichael Brown <mcb30@ipxe.org>
Thu, 4 Feb 2021 02:05:28 +0000 (02:05 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 4 Feb 2021 02:53:25 +0000 (02:53 +0000)
commite80299c56b86d907b1ea226d8214b22da39e0cb6
treeee3708c8265c28126484fb95d34ed9ed1e524f94
parentbfb72ec2342409ff196bc5efa34ea367cb8c963e
[build] Work around -fPIE patched versions of gcc on all architectures

Several distributions include versions of gcc that are patched to
create position-independent executables by default.  These have caused
multiple problems over the years: see e.g. commits fe61f6d ("[build]
Fix compilation when gcc is patched to default to -fPIE -Wl,-pie"),
5de1346 ("[build] Apply the "-fno-PIE -nopie" workaround only to i386
builds"), 7c395b0 ("[build] Use -no-pie on newer versions of gcc"),
and decee20 ("[build] Disable position-independent code for ARM64 EFI
builds").

The build system currently attempts to work around these mildly broken
patched versions of gcc for the i386 and arm64 architectures.  This
misses the relatively obscure bin-x86_64-pcbios build platform, which
turns out to also require the same workaround.

Attempt to preempt the next such required workaround by moving the
existing i386 version to apply to all platforms and all architectures,
unless -fpie has been requested explicitly by another Makefile (as is
done by arch/x86_64/Makefile.efi).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/Makefile.housekeeping
src/arch/arm64/Makefile.efi
src/arch/i386/Makefile