Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Aug 2019 12:48:18 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351069 - head/share/mk
Message-ID:  <201908151248.x7FCmIoV056409@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Thu Aug 15 12:48:17 2019
New Revision: 351069
URL: https://svnweb.freebsd.org/changeset/base/351069

Log:
  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

Modified:
  head/share/mk/bsd.lib.mk
  head/share/mk/bsd.prog.mk

Modified: head/share/mk/bsd.lib.mk
==============================================================================
--- head/share/mk/bsd.lib.mk	Thu Aug 15 12:00:59 2019	(r351068)
+++ head/share/mk/bsd.lib.mk	Thu Aug 15 12:48:17 2019	(r351069)
@@ -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) && \

Modified: head/share/mk/bsd.prog.mk
==============================================================================
--- head/share/mk/bsd.prog.mk	Thu Aug 15 12:00:59 2019	(r351068)
+++ head/share/mk/bsd.prog.mk	Thu Aug 15 12:48:17 2019	(r351069)
@@ -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,11 +45,15 @@ 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
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908151248.x7FCmIoV056409>