Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amd64/conf Fix previous: HAVE_GCC needs to be check...



details:   https://anonhg.NetBSD.org/src/rev/4e4a68cceaa0
branches:  trunk
changeset: 831889:4e4a68cceaa0
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Apr 18 09:29:35 2018 +0000

description:
Fix previous: HAVE_GCC needs to be checked in additon to
SPECTRE_V2_GCC_MITIGATION, but SPECTRE_V2_GCC_MITIGATION being empty is
not a good enough check as it can't be overwritte on the make
command line. Now I can do: "make SPECTRE_V2_GCC_MITIGATION=0" (e.g. when
my gcc is too old for having the indirect-branch options).

diffstat:

 sys/arch/amd64/conf/Makefile.amd64 |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r 72ad38037657 -r 4e4a68cceaa0 sys/arch/amd64/conf/Makefile.amd64
--- a/sys/arch/amd64/conf/Makefile.amd64        Wed Apr 18 09:20:42 2018 +0000
+++ b/sys/arch/amd64/conf/Makefile.amd64        Wed Apr 18 09:29:35 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.amd64,v 1.68 2018/04/18 09:20:42 martin Exp $
+#      $NetBSD: Makefile.amd64,v 1.69 2018/04/18 09:29:35 martin Exp $
 
 # Makefile for NetBSD
 #
@@ -43,7 +43,8 @@
 # For gcc we might need this, but other compilers barf
 # CFLAGS+=     -mno-fp-ret-in-387
 
-.if !empty(SPECTRE_V2_GCC_MITIGATION) && ${SPECTRE_V2_GCC_MITIGATION:U0} > 0
+.if !empty(SPECTRE_V2_GCC_MITIGATION) && ${SPECTRE_V2_GCC_MITIGATION:U0} > 0 \
+       && ${HAVE_GCC:U0} > 0
 CFLAGS+=      -mindirect-branch=thunk-inline
 CFLAGS+=      -mindirect-branch-register
 .endif



Home | Main Index | Thread Index | Old Index