]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[build] Work around distros that use -fcf-protection=full by default
authorMichael Brown <mcb30@ipxe.org>
Thu, 4 Feb 2021 11:07:46 +0000 (11:07 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 4 Feb 2021 11:24:05 +0000 (11:24 +0000)
commite8393c3728bf7073d033410373ef6781549c7c3e
tree0cc65305328e8ae42a83442278344b3c69b7f7e3
parente80299c56b86d907b1ea226d8214b22da39e0cb6
[build] Work around distros that use -fcf-protection=full by default

Some patched versions of gcc (observed with gcc 9.3.0 on Ubuntu 20.04)
enable -fcf-protection=full by default.  This breaks code that is not
explicitly written to expect the use of this flag.  The breakage
occurs only at runtime if the affected code (such as setjmp()) happens
to execute, and is therefore a particularly pernicious class of bug to
be introduced into working code by a broken compiler.

Work around these broken patched versions of gcc by detecting support
for -fcf-protection and explicitly setting -fcf-protection=none if
found.

If any Ubuntu maintainers are listening: PLEASE STOP DOING THIS.  It's
extremely unhelpful to have to keep working around breakages that you
introduce by modifying the compiler's default behaviour.  Do what Red
Hat does instead: set your preferred CFLAGS within the package build
system rather than by patching the compiler to behave in violation of
its own documentation.

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