git: 5ad4296780de - stable/13 - loader: make sure CPUTYPE is ignored when building
Warner Losh
imp at FreeBSD.org
Wed Jul 21 16:14:08 UTC 2021
The branch stable/13 has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=5ad4296780ded135e8cd48a3877b52c4a7f4cb1d
commit 5ad4296780ded135e8cd48a3877b52c4a7f4cb1d
Author: Warner Losh <imp at FreeBSD.org>
AuthorDate: 2021-07-15 03:06:08 +0000
Commit: Warner Losh <imp at FreeBSD.org>
CommitDate: 2021-07-21 16:13:10 +0000
loader: make sure CPUTYPE is ignored when building
CPUTYPE?=native causes -march=native to be added to the command
line. When the host machine is haswell, this causes some versions of
clang to generate code that can't execute in the efi boot loader
environment. Set _CPUCFLAGS= to undo what's done bsd.cpu.mk. bsd.cpu.mk
is included too early to control with NO_CPU_CFLAGS here. The only other
option is to put that in all the Makefiles, and this is less tedious and
error prone.
PR: 194641
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D31187
MFC After: 1 week
(cherry picked from commit 7a0c0ff7ee25ff1efa3dbedcb20d2c80178639cc)
---
stand/defs.mk | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/stand/defs.mk b/stand/defs.mk
index 54b7a7250c48..d50c89879613 100644
--- a/stand/defs.mk
+++ b/stand/defs.mk
@@ -15,6 +15,14 @@ MAN=
NO_PIC=
INTERNALLIB=
.endif
+# Should be NO_CPU_FLAGS, but bsd.cpu.mk is included too early in bsd.init.mk
+# via the early include of bsd.opts.mk. Moving Makefile.inc include earlier in
+# that file causes weirdness, so this is the next best thing. We need to do this
+# because the loader needs very specific flags to work right, and things like
+# CPUTYPE?=native prevent that, and introduce an endless game of whack-a-mole
+# to disable more and more features. Boot loader performance is never improved
+# enough to make that hassle worth chasing.
+_CPUCFLAGS=
.include <src.opts.mk>
.include <bsd.linker.mk>
More information about the dev-commits-src-all
mailing list