From nobody Fri Oct 08 06:11:07 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8E25812D4040; Fri, 8 Oct 2021 06:11:20 +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 4HQd9g6LQsz3LVm; Fri, 8 Oct 2021 06:11:19 +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 F3DF821FD9; Fri, 8 Oct 2021 06:11:07 +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 1986B7wQ007644; Fri, 8 Oct 2021 06:11:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1986B7UZ007643; Fri, 8 Oct 2021 06:11:07 GMT (envelope-from git) Date: Fri, 8 Oct 2021 06:11:07 GMT Message-Id: <202110080611.1986B7UZ007643@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 19a32560ab25 - stable/12 - Create CFLAGS_EARLY.file for boot loader. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 19a32560ab25624d9a31c674d07edb2e6b8f8992 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=19a32560ab25624d9a31c674d07edb2e6b8f8992 commit 19a32560ab25624d9a31c674d07edb2e6b8f8992 Author: Warner Losh AuthorDate: 2020-08-28 17:36:14 +0000 Commit: Kyle Evans CommitDate: 2021-10-08 05:24:27 +0000 Create CFLAGS_EARLY.file for boot loader. Some external code requires a specific set of include paths to work properly since it emulates the typical environment the code is used in. Enable this by creating a CFLAGS_EARLY.file variable that can be used to build this stack. Otherwise the include stack we build for stand programs may get in the way. Code that uses this feature has to tolerate the normal stack of inclues being last on the list (and presumably unused), though. Generally, it it should only be used for the specific include directories. Defines and that sort of thing should be done in the normal CFLAGS variable. There is a global CFLAGS_EARY hook as well for everything in a Makefile. (cherry picked from commit f9553770c03e82abcae07397025797ef346fbdab) --- stand/defs.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stand/defs.mk b/stand/defs.mk index 6fba2051301b..431b629939d8 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -63,6 +63,11 @@ LIBSA32= ${BOOTOBJ}/libsa32/libsa32.a # Standard options: CFLAGS+= -nostdinc +# Allow CFLAGS_EARLY.file/target so that code that needs specific stack +# of include paths can set them up before our include paths. Normally +# the only thing that should be there are -I directives, and as few of +# those as possible. +CFLAGS+= ${CFLAGS_EARLY} ${CFLAGS_EARLY.${.IMPSRC:T}} ${CFLAGS_EARLY.${.TARGET:T}} .if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1 CFLAGS+= -I${BOOTOBJ}/libsa32 .else