From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:18:54 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92E53666B72; Wed, 21 Jul 2021 16:18:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLPB25vdz3Mhq; Wed, 21 Jul 2021 16:18:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A5B121402; Wed, 21 Jul 2021 16:18:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGIrwv081458; Wed, 21 Jul 2021 16:18:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGIrDe081457; Wed, 21 Jul 2021 16:18:53 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:18:53 GMT Message-Id: <202107211618.16LGIrDe081457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: ee6908d78275 - stable/12 - loader: make sure CPUTYPE is ignored when building MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ee6908d78275449011f8fb1b6d73bde75c02f705 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:18:55 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ee6908d78275449011f8fb1b6d73bde75c02f705 commit ee6908d78275449011f8fb1b6d73bde75c02f705 Author: Warner Losh AuthorDate: 2021-07-15 03:06:08 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:16:32 +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 514a6c9b98dc..3f440d9017f8 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