Index: share/mk/bsd.dep.mk =================================================================== --- share/mk/bsd.dep.mk +++ share/mk/bsd.dep.mk @@ -192,6 +192,17 @@ # avoid collisions. DEPEND_FILTER= C,/,_,g .if !empty(OBJS) +.if !defined(_ALLOW_ABSOLUTE_OBJ_PATH) && ${OBJS:M/*} +# Absolute paths to OBJS should be an error inside ${SRCTOP}, but some users +# might be relying on this feature, so add an opt-out mechanism. +.if defined(SRCTOP) && ${OBJS:M${SRCTOP}*} +.error "$$OBJS inside $$SRCTOP not allowed: ${OBJS:M${SRCTOP}*}" +.elif ${OBJS:N${_ABSOLUTE_PATH_OBJS}:M/*} +.error "$$OBJS absolute path not allowed: ${OBJS:N${_ABSOLUTE_PATH_OBJS}:M/*}. \ + If this is intended, add them to _ABSOLUTE_PATH_OBJS to silence this error\ + or define _ALLOW_ABSOLUTE_OBJ_PATH to disable this diagnostic." +.endif +.endif DEPENDOBJS+= ${OBJS} .else DEPENDSRCS+= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} Index: stand/i386/loader/Makefile =================================================================== --- stand/i386/loader/Makefile +++ stand/i386/loader/Makefile @@ -91,6 +91,8 @@ # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} +# We actually do want an absolute path to OBJS here, silence the diagnostic. +_ABSOLUTE_PATH_OBJS=${BTXCRT} DPADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBI386} ${LIBSA32} LDADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBI386} ${LIBSA32}