From d76885d554d1caaedae0a50a72f32023893e549d Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 4 Jan 2018 18:04:39 +0100 Subject: [PATCH] Check for -mretpoline / -zretpolineplt support --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 6e5a113f..b6e282c8 100644 --- a/configure.ac +++ b/configure.ac @@ -202,6 +202,9 @@ AC_CHECK_DEFINE([_FORTIFY_SOURCE], [], [ AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [CFLAGS="$CFLAGS -fvisibility=hidden"]) +AX_CHECK_COMPILE_FLAG([-mretpoline], + [CFLAGS="$CFLAGS -mretpoline"]) + AS_CASE([$host_os], [cygwin*|mingw*|msys|pw32*|cegcc*], [ ], [ AX_CHECK_COMPILE_FLAG([-fPIC], [CFLAGS="$CFLAGS -fPIC"]) ]) @@ -323,6 +326,7 @@ AX_CHECK_COMPILE_FLAG([$CWFLAGS -Wwrite-strings], [CWFLAGS="$CWFLAGS -Wwrite-str AX_CHECK_LINK_FLAG([-Wl,-z,relro], [LDFLAGS="$LDFLAGS -Wl,-z,relro"]) AX_CHECK_LINK_FLAG([-Wl,-z,now], [LDFLAGS="$LDFLAGS -Wl,-z,now"]) AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"]) +AX_CHECK_LINK_FLAG([-Wl,-z,retpolineplt], [LDFLAGS="$LDFLAGS -Wl,-z,retpolineplt"]) AC_MSG_CHECKING(for a broken clang + AVX512 combination) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[