Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Fix GCC flags for Spectre mitigation to really only...



details:   https://anonhg.NetBSD.org/src/rev/3aa2ea83dcea
branches:  trunk
changeset: 932565:3aa2ea83dcea
user:      joerg <joerg%NetBSD.org@localhost>
date:      Mon May 11 15:15:15 2020 +0000

description:
Fix GCC flags for Spectre mitigation to really only apply to GCC.

diffstat:

 sys/arch/amd64/conf/Makefile.amd64 |  8 ++++----
 sys/arch/i386/conf/Makefile.i386   |  8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (44 lines):

diff -r 2ecc0bb3bf61 -r 3aa2ea83dcea sys/arch/amd64/conf/Makefile.amd64
--- a/sys/arch/amd64/conf/Makefile.amd64        Mon May 11 14:55:20 2020 +0000
+++ b/sys/arch/amd64/conf/Makefile.amd64        Mon May 11 15:15:15 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.amd64,v 1.84 2020/04/25 15:26:16 bouyer Exp $
+#      $NetBSD: Makefile.amd64,v 1.85 2020/05/11 15:15:15 joerg Exp $
 
 # Makefile for NetBSD
 #
@@ -44,9 +44,9 @@
 # For gcc we might need this, but other compilers barf
 # CFLAGS+=     -mno-fp-ret-in-387
 
-.if ${SPECTRE_V2_GCC_MITIGATION:U0} > 0 && ${HAVE_GCC:U0} > 0
-CFLAGS+=      -mindirect-branch=thunk-inline
-CFLAGS+=      -mindirect-branch-register
+.if ${SPECTRE_V2_GCC_MITIGATION:U0} > 0
+CFLAGS+=       ${${ACTIVE_CC} == "gcc" :? -mindirect-branch=thunk :}
+CFLAGS+=       ${${ACTIVE_CC} == "gcc" :? -mindirect-branch-register :}
 .endif
 
 .if ${KASAN:U0} > 0
diff -r 2ecc0bb3bf61 -r 3aa2ea83dcea sys/arch/i386/conf/Makefile.i386
--- a/sys/arch/i386/conf/Makefile.i386  Mon May 11 14:55:20 2020 +0000
+++ b/sys/arch/i386/conf/Makefile.i386  Mon May 11 15:15:15 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.i386,v 1.195 2020/04/25 15:26:16 bouyer Exp $
+#      $NetBSD: Makefile.i386,v 1.196 2020/05/11 15:15:15 joerg Exp $
 
 # Makefile for NetBSD
 #
@@ -40,9 +40,9 @@
 ## no-sse implies no-sse2 but not no-avx
 CFLAGS+=       -mno-mmx -mno-sse -mno-avx
 
-.if ${SPECTRE_V2_GCC_MITIGATION:U0} > 0 && ${HAVE_GCC:U0} > 0
-CFLAGS+=       -mindirect-branch=thunk
-CFLAGS+=       -mindirect-branch-register
+.if ${SPECTRE_V2_GCC_MITIGATION:U0} > 0
+CFLAGS+=       ${${ACTIVE_CC} == "gcc" :? -mindirect-branch=thunk :}
+CFLAGS+=       ${${ACTIVE_CC} == "gcc" :? -mindirect-branch-register :}
 .endif
 EXTRA_INCLUDES= -I$S/external/mit/xen-include-public/dist/
 



Home | Main Index | Thread Index | Old Index