do not enable userland retpoline if not supported by compiler/linker
Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21101
This commit is contained in:
parent
03d8a4b7d3
commit
e5c6dece98
@ -3,6 +3,8 @@
|
||||
#
|
||||
|
||||
.include <bsd.init.mk>
|
||||
.include <bsd.compiler.mk>
|
||||
.include <bsd.linker.mk>
|
||||
|
||||
.if defined(LIB_CXX) || defined(SHLIB_CXX)
|
||||
_LD= ${CXX}
|
||||
@ -74,9 +76,13 @@ TAG_ARGS= -T ${TAGS:[*]:S/ /,/g}
|
||||
LDFLAGS+= -Wl,-znow
|
||||
.endif
|
||||
.if ${MK_RETPOLINE} != "no"
|
||||
.if ${COMPILER_FEATURES:Mretpoline} && ${LINKER_FEATURES:Mretpoline}
|
||||
CFLAGS+= -mretpoline
|
||||
CXXFLAGS+= -mretpoline
|
||||
LDFLAGS+= -Wl,-zretpolineplt
|
||||
.else
|
||||
.warning Retpoline requested but not supported by compiler or linker
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
.include <bsd.init.mk>
|
||||
.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
|
||||
|
||||
@ -44,12 +45,16 @@ CXXFLAGS+= -fPIE
|
||||
LDFLAGS+= -pie
|
||||
.endif
|
||||
.if ${MK_RETPOLINE} != "no"
|
||||
.if ${COMPILER_FEATURES:Mretpoline} && ${LINKER_FEATURES:Mretpoline}
|
||||
CFLAGS+= -mretpoline
|
||||
CXXFLAGS+= -mretpoline
|
||||
# retpolineplt is broken with static linking (PR 233336)
|
||||
.if !defined(NO_SHARED) || ${NO_SHARED:tl} == "no"
|
||||
LDFLAGS+= -Wl,-zretpolineplt
|
||||
.endif
|
||||
.else
|
||||
.warning Retpoline requested but not supported by compiler or linker
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if defined(CRUNCH_CFLAGS)
|
||||
|
Loading…
Reference in New Issue
Block a user