Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171007724
D28467.id83311.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
D28467.id83311.diff
View Options
Index: share/mk/bsd.lib.mk
===================================================================
--- share/mk/bsd.lib.mk
+++ share/mk/bsd.lib.mk
@@ -255,6 +255,15 @@
.if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME)
OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/}
+.if ${OBJS:M/*}
+# Absolute paths to OBJS should be an error inside ${SRCTOP}, but external users
+# might be relying on this feature, so make it a warning there.
+.if defined(SRCTOP) && ${OBJS:M${SRCTOP}*}
+.error "\$OBJS absolute path not allowed: ${OBJS:M${SRCTOP}*}"
+.else
+.warning "\$OBJS absolute path not allowed: ${OBJS:M/*}"
+.endif
+.endif
BCOBJS+= ${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g}
LLOBJS+= ${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.llo/g}
CLEANFILES+= ${OBJS} ${BCOBJS} ${LLOBJS} ${STATICOBJS}
Index: share/mk/bsd.prog.mk
===================================================================
--- share/mk/bsd.prog.mk
+++ share/mk/bsd.prog.mk
@@ -142,6 +142,15 @@
.if defined(SRCS)
OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/g}
+.if ${OBJS:M/*}
+# Absolute paths to OBJS should be an error inside ${SRCTOP}, but external users
+# might be relying on this feature, so make it a warning there.
+.if defined(SRCTOP) && ${OBJS:M${SRCTOP}*}
+.error "\$OBJS absolute path not allowed: ${OBJS:M${SRCTOP}*}"
+.else
+.warning "\$OBJS absolute path not allowed: ${OBJS:M/*}"
+.endif
+.endif
# LLVM bitcode / textual IR representations of the program
BCOBJS+=${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 9, 4:04 AM (14 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38560095
Default Alt Text
D28467.id83311.diff (1 KB)
Attached To
Mode
D28467: Emit an error when we seen absolute paths to .o files
Attached
Detach File
Event Timeline
Log In to Comment