Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159751796
D50951.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D50951.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D50951: share/mk: Substitute reproducible prefixes in dwarf info
Attached
Detach File
Event Timeline
Log In to Comment