From 4a99c8aa2c7225a595d328e58c6fea178cb92bb7 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Fri, 30 Mar 2018 08:19:33 -0400 Subject: spectre support for clang compiler --- configure.ac | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 9a7a9d65e..1f573d50f 100644 --- a/configure.ac +++ b/configure.ac @@ -9,15 +9,21 @@ AC_PROG_INSTALL AC_PROG_RANLIB HAVE_SPECTRE="no" -AC_MSG_CHECKING(for Spectre mitigation support in gcc compiler) +AC_MSG_CHECKING(for Spectre mitigation support in gcc or clang compiler) AS_IF([test "$CC" = "gcc"], [ HAVE_SPECTRE="yes" $CC -mindirect-branch=thunk -c dummy.c || HAVE_SPECTRE="no" rm -f dummy.o + EXTRA_CFLAGS+=" -mindirect-branch=thunk " +]) +AS_IF([test "$CC" = "clang"], [ + HAVE_SPECTRE="yes" + $CC -mretpoline -c dummy.c || HAVE_SPECTRE="no" + rm -f dummy.o + EXTRA_CFLAGS+=" -mretpoline " ]) AS_IF([test "$HAVE_SPECTRE" = "yes"], [ AC_MSG_RESULT(yes) - EXTRA_CFLAGS+=" -mindirect-branch=thunk " ]) AS_IF([test "$HAVE_SPECTRE" = "no"], [ AC_MSG_RESULT(... not available) -- cgit v1.2.3-70-g09d2