git: 7cedaf50721b - stable/14 - pkgbase: set the prefix of debug files and macros to /usr/src

From: Emmanuel Vadot <>
Date: Sat, 02 Dec 2023 09:45:30 UTC
The branch stable/14 has been updated by manu:


commit 7cedaf50721b125b5c46f8e974806248356787bf
Author:     Baptiste Daroussin <>
AuthorDate: 2023-11-13 17:18:58 +0000
Commit:     Emmanuel Vadot <>
CommitDate: 2023-12-02 09:44:04 +0000

    pkgbase: set the prefix of debug files and macros to /usr/src
    When the macro PACKAGE_BUILDING is set, then consider we are building package
    for pkgbase, this has already been used in Makefile.inc1 and reuse the
    PACKAGE_BUILDING macros already used for that purpose in the ports tree
    In the future this should be tied to REPRODUCIBLE_BUILD
    MFC After:      3 days
    Reviewed by:    emaste
    Differential Revision:
    (cherry picked from commit 030af1b62d7b9a86f5ecdceff5a1fa23e9570be1)
 share/mk/ | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/share/mk/ b/share/mk/
index edf369638d9d..d5c2af0c559d 100644
--- a/share/mk/
+++ b/share/mk/
@@ -38,6 +38,9 @@ __postrcconf_${var}:=	${MK_${var}:U-}${WITHOUT_${var}:Uno:Dyes}${WITH_${var}:Uno
 # default over to -fno-common, making this redundant.
 CFCOMMONFLAG?=	-fno-common
+.if defined(PACKAGE_BUILDING)
+CFLAGS+=	-fmacro-prefix-map=${SRCTOP}=/usr/src -fdebug-prefix-map=${SRCTOP}=/usr/src