Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115460137
D49966.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
D49966.diff
View Options
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -4,7 +4,7 @@
.include <bsd.compiler.mk>
.include <bsd.linker.mk>
-.SUFFIXES: .out .o .bc .c .cc .cpp .cxx .C .m .y .l .ll .ln .s .S .asm
+.include <bsd.suffixes-extra.mk>
# XXX The use of COPTS in modern makefiles is discouraged.
.if defined(COPTS)
@@ -47,13 +47,14 @@
LDFLAGS+= -Wl,-zrelro
.endif
.endif
-.if ${MK_PIE} != "no"
# Static PIE is not yet supported/tested.
-.if !defined(NO_SHARED) || ${NO_SHARED:tl} == "no"
+.if ${MK_PIE} != "no" && (!defined(NO_SHARED) || ${NO_SHARED:tl} == "no")
CFLAGS+= -fPIE
CXXFLAGS+= -fPIE
LDFLAGS+= -pie
-.endif
+OBJ_EXT=pieo
+.else
+OBJ_EXT=o
.endif
.if ${MK_RETPOLINE} != "no"
.if ${COMPILER_FEATURES:Mretpoline} && ${LINKER_FEATURES:Mretpoline}
@@ -161,7 +162,7 @@
.if defined(SRCS)
-OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/g}
+OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.${OBJ_EXT}/g}
# LLVM bitcode / textual IR representations of the program
BCOBJS+=${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g}
@@ -197,10 +198,10 @@
# - the name of the object gets put into the executable symbol table instead of
# the name of a variable temporary object.
# - it's useful to keep objects around for crunching.
-OBJS+= ${PROG}.o
+OBJS+= ${PROG}.${OBJ_EXT}
BCOBJS+= ${PROG}.bc
LLOBJS+= ${PROG}.ll
-CLEANFILES+= ${PROG}.o ${PROG}.bc ${PROG}.ll
+CLEANFILES+= ${PROG}.${OBJ_EXT} ${PROG}.bc ${PROG}.ll
.if target(beforelinking)
beforelinking: ${OBJS}
diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk
--- a/share/mk/bsd.progs.mk
+++ b/share/mk/bsd.progs.mk
@@ -110,7 +110,7 @@
.if !empty(_PROGS_COMMON_SRCS)
_PROGS_COMMON_OBJS= ${_PROGS_COMMON_SRCS:M*.[dhly]}
.if !empty(_PROGS_COMMON_SRCS:N*.[dhly])
-_PROGS_COMMON_OBJS+= ${_PROGS_COMMON_SRCS:N*.[dhly]:${OBJS_SRCS_FILTER:ts:}:S/$/.o/g}
+_PROGS_COMMON_OBJS+= ${_PROGS_COMMON_SRCS:N*.[dhly]:${OBJS_SRCS_FILTER:ts:}:S/$/.${OBJ_EXT}/g}
.endif
.endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 25, 2:09 AM (18 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17772786
Default Alt Text
D49966.diff (1 KB)
Attached To
Mode
D49966: Use .pieo extension for WITH_PIE bsd.prog.mk output
Attached
Detach File
Event Timeline
Log In to Comment