From owner-dev-commits-src-main@freebsd.org Wed Feb 3 09:38:41 2021 Return-Path: Delivered-To: dev-commits-src-main@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 7EC6B531742; Wed, 3 Feb 2021 09:38:41 +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 4DVxSw4m2Cz3sY6; Wed, 3 Feb 2021 09:38:40 +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 7A1C81E4ED; Wed, 3 Feb 2021 09:38:40 +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 1139ceVD009858; Wed, 3 Feb 2021 09:38:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1139ceOk009857; Wed, 3 Feb 2021 09:38:40 GMT (envelope-from git) Date: Wed, 3 Feb 2021 09:38:40 GMT Message-Id: <202102030938.1139ceOk009857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 9b131f1e51a0 - main - atf: Fix ATF_BUILD_* values when not using the bootstrap compiler MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b131f1e51a00c8bbbda32672fb5db88010400f6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 09:38:41 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=9b131f1e51a00c8bbbda32672fb5db88010400f6 commit 9b131f1e51a00c8bbbda32672fb5db88010400f6 Author: Alex Richardson AuthorDate: 2021-02-03 09:32:16 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 09:32:16 +0000 atf: Fix ATF_BUILD_* values when not using the bootstrap compiler Currently, we encode the full path and compile flags for the build compiler in libatf. However, these values are not correct when cross-compiling: For example, when I build on macOS, CC is set to the host path /usr/local/Cellar/llvm/11.0.0_1/bin/clang-11. This path will not exist on the target system. Simplify this logic and use cc/cpp/c++ since those binaries will exist on the target system unless the compiler was explicitly disabled. I'm not convinced ATF needs to encode these values, but this is a minimal fix for these tests when using a non-bootstrapped compiler. Reviewed By: ngie, brooks Differential Revision: https://reviews.freebsd.org/D28414 --- lib/atf/libatf-c/Makefile | 23 +---------------------- lib/atf/libatf-c/Makefile.inc | 7 +++++++ lib/atf/libatf-c/tests/Makefile | 1 + 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/lib/atf/libatf-c/Makefile b/lib/atf/libatf-c/Makefile index 78b821b3c64d..7c9807c24ded 100644 --- a/lib/atf/libatf-c/Makefile +++ b/lib/atf/libatf-c/Makefile @@ -28,22 +28,6 @@ .include .include -# Store the toolchain executable in ATF_BUILD_{CC,CPP,CXX} to ensure other -# values -- like -target, -B ..., etc -- don't get leaked into the tests. -# -# Be sure to omit ${CCACHE_BIN} (if specified) from the variable as it gets -# automatically appended to the variables in bsd.compiler.mk when -# ${MK_CCACHE_BUILD} != no. -ATF_BUILD_CC:= ${CC:N${CCACHE_BIN}:[1]} -ATF_BUILD_CPP:= ${CPP:N${CCACHE_BIN}:[1]} -ATF_BUILD_CXX:= ${CXX:N${CCACHE_BIN}:[1]} - -# Only capture defines, includes, linker flags, optimization levels, warnings -# and preprocessor flags when building ATF_BUILD_{C,CPP,CXX}FLAGS. -ATF_BUILD_CFLAGS:= ${CFLAGS:M-[DILOWf]*} -ATF_BUILD_CPPFLAGS:= ${CPPFLAGS:M-[DILOWf]*} -ATF_BUILD_CXXFLAGS:= ${CXXFLAGS:M-[DILOWf]*} - PACKAGE= tests LIB= atf-c PRIVATELIB= true @@ -54,12 +38,6 @@ ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF}/atf-c .PATH: ${ATF}/atf-c/detail -CFLAGS+= -DATF_BUILD_CC='"${ATF_BUILD_CC}"' -CFLAGS+= -DATF_BUILD_CFLAGS='"${ATF_BUILD_CFLAGS}"' -CFLAGS+= -DATF_BUILD_CPP='"${ATF_BUILD_CPP}"' -CFLAGS+= -DATF_BUILD_CPPFLAGS='"${ATF_BUILD_CPPFLAGS}"' -CFLAGS+= -DATF_BUILD_CXX='"${ATF_BUILD_CXX}"' -CFLAGS+= -DATF_BUILD_CXXFLAGS='"${ATF_BUILD_CXXFLAGS}"' CFLAGS+= -I${ATF} CFLAGS+= -I${.CURDIR} CFLAGS+= -I. @@ -160,5 +138,6 @@ MLINKS+= atf-c.3 atf-c-api.3 # Backwards compatibility. HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +.include "Makefile.inc" .include "../common.mk" .include diff --git a/lib/atf/libatf-c/Makefile.inc b/lib/atf/libatf-c/Makefile.inc index 265f86d1ed55..f668e36b2d6a 100644 --- a/lib/atf/libatf-c/Makefile.inc +++ b/lib/atf/libatf-c/Makefile.inc @@ -1,3 +1,10 @@ # $FreeBSD$ .include "../Makefile.inc" + +CFLAGS+= -DATF_BUILD_CC='"cc"' +CFLAGS+= -DATF_BUILD_CFLAGS='"-Wall"' +CFLAGS+= -DATF_BUILD_CPP='"cpp"' +CFLAGS+= -DATF_BUILD_CPPFLAGS='""' +CFLAGS+= -DATF_BUILD_CXX='"c++"' +CFLAGS+= -DATF_BUILD_CXXFLAGS='"-Wall"' diff --git a/lib/atf/libatf-c/tests/Makefile b/lib/atf/libatf-c/tests/Makefile index c99b2d115967..3bcdfc8f7071 100644 --- a/lib/atf/libatf-c/tests/Makefile +++ b/lib/atf/libatf-c/tests/Makefile @@ -35,4 +35,5 @@ SRCS.${_T}= ${_T}.c test_helpers.c TEST_METADATA.${_T}+= required_programs="cc" .endfor +.include "Makefile.inc" .include