Page MenuHomeFreeBSD

D50951.diff
No OneTemporary

D50951.diff

diff --git a/share/mk/bsd.debug.mk b/share/mk/bsd.debug.mk
--- a/share/mk/bsd.debug.mk
+++ b/share/mk/bsd.debug.mk
@@ -13,6 +13,28 @@
MK_WERROR= no
.endif
+# If reproducible build mode is enabled, map the root of the source
+# directory to /usr/src and the root of the object directory to
+# /usr/obj.
+.if ${MK_REPRODUCIBLE_BUILD} != "no" && !defined(DEBUG_PREFIX)
+.if defined(SRCTOP)
+DEBUG_PREFIX+= ${SRCTOP:S,/$,,}=/usr/src
+.endif
+.if defined(OBJROOT)
+# Strip off compat subdirectories, e.g., /usr/obj/usr/src/amd64.amd64/obj-lib32
+# becomes /usr/obj/usr/src/amd64.amd64, since object files compiled there might
+# refer to something outside the root.
+DEBUG_PREFIX+= ${OBJROOT:S,/$,,:C,/obj-[^/]*$,,}=/usr/obj
+.endif
+.endif
+
+.if defined(DEBUG_PREFIX)
+.for map in ${DEBUG_PREFIX}
+CFLAGS+= -ffile-prefix-map=${map}
+CXXFLAGS+= -ffile-prefix-map=${map}
+.endfor
+.endif
+
.if defined(DEBUG_FLAGS)
CFLAGS+=${DEBUG_FLAGS}
CXXFLAGS+=${DEBUG_FLAGS}
diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk
--- a/share/mk/bsd.opts.mk
+++ b/share/mk/bsd.opts.mk
@@ -78,6 +78,7 @@
CCACHE_BUILD \
CTF \
INSTALL_AS_USER \
+ REPRODUCIBLE_BUILD \
RETPOLINE \
RUN_TESTS \
STALE_STAGED \

File Metadata

Mime Type
text/plain
Expires
Thu, Jun 18, 9:13 PM (6 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34057501
Default Alt Text
D50951.diff (1 KB)

Event Timeline