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

From: Baptiste Daroussin <>
Date: Mon, 04 Dec 2023 10:39:39 UTC
The branch stable/13 has been updated by bapt:


commit 7b68016c7678db478cb8ac7a15fa821c0231fccc
Author:     Baptiste Daroussin <>
AuthorDate: 2023-11-13 17:18:58 +0000
Commit:     Baptiste Daroussin <>
CommitDate: 2023-12-04 10:39:16 +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