Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Apr 2018 20:28:37 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r332301 - in stable/11: . share/mk
Message-ID:  <201804082028.w38KSbtT020999@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Sun Apr  8 20:28:37 2018
New Revision: 332301
URL: https://svnweb.freebsd.org/changeset/base/332301

Log:
  MFC r328972: add retpoline compiler and linker feature flags
  
  These features indicate that the compiler and linker support the
  retpoline speculative execution vulnerability (CVE-2017-5715)
  mitigation.

Modified:
  stable/11/Makefile.inc1
  stable/11/share/mk/bsd.compiler.mk
  stable/11/share/mk/bsd.linker.mk
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/Makefile.inc1
==============================================================================
--- stable/11/Makefile.inc1	Sun Apr  8 20:26:50 2018	(r332300)
+++ stable/11/Makefile.inc1	Sun Apr  8 20:28:37 2018	(r332301)
@@ -166,11 +166,11 @@ test-system-compiler: .PHONY
 .if !defined(X_COMPILER_TYPE)
 CROSSENV+=	COMPILER_VERSION=${COMPILER_VERSION} \
 		COMPILER_TYPE=${COMPILER_TYPE} \
-		COMPILER_FEATURES=${COMPILER_FEATURES} \
+		COMPILER_FEATURES="${COMPILER_FEATURES}" \
 		COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION}
 .else
 CROSSENV+=	COMPILER_VERSION=${X_COMPILER_VERSION} \
-		COMPILER_FEATURES=${X_COMPILER_FEATURES} \
+		COMPILER_FEATURES="${X_COMPILER_FEATURES}" \
 		COMPILER_TYPE=${X_COMPILER_TYPE} \
 		COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION}
 .endif

Modified: stable/11/share/mk/bsd.compiler.mk
==============================================================================
--- stable/11/share/mk/bsd.compiler.mk	Sun Apr  8 20:26:50 2018	(r332300)
+++ stable/11/share/mk/bsd.compiler.mk	Sun Apr  8 20:28:37 2018	(r332301)
@@ -19,7 +19,9 @@
 # COMPILER_FEATURES will contain one or more of the following, based on
 # compiler support for that feature:
 #
-# - c++11 : supports full (or nearly full) C++11 programming environment.
+# - c++11:     supports full (or nearly full) C++11 programming environment.
+# - retpoline: supports the retpoline speculative execution vulnerability
+#              mitigation.
 #
 # These variables with an X_ prefix will also be provided if XCC is set.
 #
@@ -168,11 +170,13 @@ ${X_}COMPILER_FREEBSD_VERSION=	unknown
 .endif
 .endif
 
+${X_}COMPILER_FEATURES=
 .if ${${X_}COMPILER_TYPE} == "clang" || \
 	(${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800)
-${X_}COMPILER_FEATURES=	c++11
-.else
-${X_}COMPILER_FEATURES=
+${X_}COMPILER_FEATURES+=	c++11
+.endif
+.if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 60000
+${X_}COMPILER_FEATURES+=	retpoline
 .endif
 
 .else

Modified: stable/11/share/mk/bsd.linker.mk
==============================================================================
--- stable/11/share/mk/bsd.linker.mk	Sun Apr  8 20:26:50 2018	(r332300)
+++ stable/11/share/mk/bsd.linker.mk	Sun Apr  8 20:28:37 2018	(r332301)
@@ -12,7 +12,9 @@
 # LINKER_FEATURES may contain one or more of the following, based on
 # linker support for that feature:
 #
-# - build-id : support for generating a Build-ID note
+# - build-id:  support for generating a Build-ID note
+# - retpoline: support for generating PLT with retpoline speculative
+#              execution vulnerability mitigation
 #
 # These variables with an X_ prefix will also be provided if XLD is set.
 #
@@ -72,6 +74,9 @@ ${X_}LINKER_FEATURES+=	build-id
 .endif
 .if ${${X_}LINKER_TYPE} != "lld" || ${${X_}LINKER_VERSION} >= 50000
 ${X_}LINKER_FEATURES+=	filter
+.endif
+.if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 60000
+${X_}LINKER_FEATURES+=	retpoline
 .endif
 .endif
 .else



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