From owner-dev-commits-src-all@freebsd.org Wed Feb 17 22:27:21 2021 Return-Path: <owner-dev-commits-src-all@freebsd.org> Delivered-To: dev-commits-src-all@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 EF86053802F; Wed, 17 Feb 2021 22:27:21 +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 4DgssP6W4yz3pL4; Wed, 17 Feb 2021 22:27:21 +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 D2A074DDE; Wed, 17 Feb 2021 22:27:21 +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 11HMRLDK099680; Wed, 17 Feb 2021 22:27:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11HMRLYi099679; Wed, 17 Feb 2021 22:27:21 GMT (envelope-from git) Date: Wed, 17 Feb 2021 22:27:21 GMT Message-Id: <202102172227.11HMRLYi099679@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis <brooks@FreeBSD.org> Subject: git: d616ae46b484 - main - Add fileprefixmap compiler feature MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d616ae46b4849b0678326dfacbba5fd7c8febbea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository <dev-commits-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/> List-Post: <mailto:dev-commits-src-all@freebsd.org> List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Wed, 17 Feb 2021 22:27:22 -0000 The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=d616ae46b4849b0678326dfacbba5fd7c8febbea commit d616ae46b4849b0678326dfacbba5fd7c8febbea Author: Dan McGregor <dan.mcgregor@usask.ca> AuthorDate: 2021-02-17 22:26:49 +0000 Commit: Brooks Davis <brooks@FreeBSD.org> CommitDate: 2021-02-17 22:26:49 +0000 Add fileprefixmap compiler feature -ffile-prefix-map=<old>=<new> is a compiler feature first added in GCC 8, and implemented for clang 10. It remaps old paths to new paths in both debug information and __FILE__ and __BASE_FILE__ macros. It can be used to improve reproducibility or to hide local system directories. I intend to use it to replace the real source directory and real object directory with constant values across all builds. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D28632 --- share/mk/bsd.compiler.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index fa8e6c44a17e..0d8f02489f00 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -226,6 +226,10 @@ ${X_}COMPILER_FEATURES+= c++17 .if ${${X_}COMPILER_TYPE} == "clang" ${X_}COMPILER_FEATURES+= retpoline init-all .endif +.if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 100000 || \ + (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 80100) +${X_}COMPILER_FEATURES+= fileprefixmap +.endif .else # Use CC's values