aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure22
-rw-r--r--configure.ac8
2 files changed, 25 insertions, 5 deletions
diff --git a/configure b/configure
index 0ccaad051..9a7d91111 100755
--- a/configure
+++ b/configure
@@ -3106,20 +3106,36 @@ fi
3106 3106
3107 3107
3108HAVE_SPECTRE="no" 3108HAVE_SPECTRE="no"
3109{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Spectre mitigation support in gcc compiler" >&5 3109{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Spectre mitigation support in gcc or clang compiler" >&5
3110$as_echo_n "checking for Spectre mitigation support in gcc compiler... " >&6; } 3110$as_echo_n "checking for Spectre mitigation support in gcc or clang compiler... " >&6; }
3111if test "$CC" = "gcc"; then : 3111if test "$CC" = "gcc"; then :
3112 3112
3113 HAVE_SPECTRE="yes" 3113 HAVE_SPECTRE="yes"
3114 $CC -mindirect-branch=thunk -c dummy.c || HAVE_SPECTRE="no" 3114 $CC -mindirect-branch=thunk -c dummy.c || HAVE_SPECTRE="no"
3115 rm -f dummy.o 3115 rm -f dummy.o
3116 if test "$HAVE_SPECTRE" = "yes"; then :
3117
3118 EXTRA_CFLAGS+=" -mindirect-branch=thunk "
3119
3120fi
3121
3122fi
3123if test "$CC" = "clang"; then :
3124
3125 HAVE_SPECTRE="yes"
3126 $CC -mretpoline -c dummy.c || HAVE_SPECTRE="no"
3127 rm -f dummy.o
3128 if test "$HAVE_SPECTRE" = "yes"; then :
3129
3130 EXTRA_CFLAGS+=" -mretpoline "
3131
3132fi
3116 3133
3117fi 3134fi
3118if test "$HAVE_SPECTRE" = "yes"; then : 3135if test "$HAVE_SPECTRE" = "yes"; then :
3119 3136
3120 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 3137 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3121$as_echo "yes" >&6; } 3138$as_echo "yes" >&6; }
3122 EXTRA_CFLAGS+=" -mindirect-branch=thunk "
3123 3139
3124fi 3140fi
3125if test "$HAVE_SPECTRE" = "no"; then : 3141if test "$HAVE_SPECTRE" = "no"; then :
diff --git a/configure.ac b/configure.ac
index 1f573d50f..d3405a135 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,13 +14,17 @@ AS_IF([test "$CC" = "gcc"], [
14 HAVE_SPECTRE="yes" 14 HAVE_SPECTRE="yes"
15 $CC -mindirect-branch=thunk -c dummy.c || HAVE_SPECTRE="no" 15 $CC -mindirect-branch=thunk -c dummy.c || HAVE_SPECTRE="no"
16 rm -f dummy.o 16 rm -f dummy.o
17 EXTRA_CFLAGS+=" -mindirect-branch=thunk " 17 AS_IF([test "$HAVE_SPECTRE" = "yes"], [
18 EXTRA_CFLAGS+=" -mindirect-branch=thunk "
19 ])
18]) 20])
19AS_IF([test "$CC" = "clang"], [ 21AS_IF([test "$CC" = "clang"], [
20 HAVE_SPECTRE="yes" 22 HAVE_SPECTRE="yes"
21 $CC -mretpoline -c dummy.c || HAVE_SPECTRE="no" 23 $CC -mretpoline -c dummy.c || HAVE_SPECTRE="no"
22 rm -f dummy.o 24 rm -f dummy.o
23 EXTRA_CFLAGS+=" -mretpoline " 25 AS_IF([test "$HAVE_SPECTRE" = "yes"], [
26 EXTRA_CFLAGS+=" -mretpoline "
27 ])
24]) 28])
25AS_IF([test "$HAVE_SPECTRE" = "yes"], [ 29AS_IF([test "$HAVE_SPECTRE" = "yes"], [
26 AC_MSG_RESULT(yes) 30 AC_MSG_RESULT(yes)