From owner-svn-src-all@freebsd.org Wed Feb 7 14:50:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1EE8F0B786; Wed, 7 Feb 2018 14:50:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 875BA6C72B; Wed, 7 Feb 2018 14:50:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8226B372; Wed, 7 Feb 2018 14:50:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17Eo6xI033429; Wed, 7 Feb 2018 14:50:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Eo6sc033426; Wed, 7 Feb 2018 14:50:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802071450.w17Eo6sc033426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 7 Feb 2018 14:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328972 - in head: . share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . share/mk X-SVN-Commit-Revision: 328972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2018 14:50:07 -0000 Author: emaste Date: Wed Feb 7 14:50:06 2018 New Revision: 328972 URL: https://svnweb.freebsd.org/changeset/base/328972 Log: 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. Reviewed by: dim, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14228 Modified: head/Makefile.inc1 head/share/mk/bsd.compiler.mk head/share/mk/bsd.linker.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Feb 7 12:12:06 2018 (r328971) +++ head/Makefile.inc1 Wed Feb 7 14:50:06 2018 (r328972) @@ -165,11 +165,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: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Wed Feb 7 12:12:06 2018 (r328971) +++ head/share/mk/bsd.compiler.mk Wed Feb 7 14:50:06 2018 (r328972) @@ -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. # @@ -178,11 +180,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: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Wed Feb 7 12:12:06 2018 (r328971) +++ head/share/mk/bsd.linker.mk Wed Feb 7 14:50:06 2018 (r328972) @@ -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