]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dovecot.m4: Add --with-retpoline
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2020 07:42:07 +0000 (09:42 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 7 Feb 2020 09:02:15 +0000 (11:02 +0200)
Makes retpoline optional.

m4/dovecot.m4

index 286d0e65eec0d243704cf2f2bb884a29cf97ef1a..980d9bb08d76646feaadd13e89764c829bb520ef 100644 (file)
@@ -196,17 +196,22 @@ dnl Check for support for Retpoline
 dnl
 
 AC_DEFUN([AC_CC_RETPOLINE],[
+    AC_ARG_WITH(retpoline,
+       AS_HELP_STRING([--with-retpoline=<choice>], [Retpoline migitation choice (default: keep)]),
+            with_retpoline=$withval,
+            with_retpoline=keep)
+
     AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
     AS_IF([test "$enable_hardening" = yes], [
       case "$host" in
         *)
-          gl_COMPILER_OPTION_IF([-mfunction-return=thunk],
-            [CFLAGS="$CFLAGS -mfunction-return=thunk],
+          gl_COMPILER_OPTION_IF([-mfunction-return=$with_retpoline],
+            [CFLAGS="$CFLAGS -mfunction-return=$with_retpoline"],
             [],
             [AC_LANG_PROGRAM()]
           )
-          gl_COMPILER_OPTION_IF([-mindirect-branch=thunk], [
-            CFLAGS="$CFLAGS -mindirect-branch=thunk"
+          gl_COMPILER_OPTION_IF([-mindirect-branch=$with_retpoline], [
+            CFLAGS="$CFLAGS -mindirect-branch=$with_retpoline"
             ],
             [],
             [AC_LANG_PROGRAM()]