]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dovecot.m4: Split retpoline check into parts
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2020 07:35:44 +0000 (09:35 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 7 Feb 2020 09:02:15 +0000 (11:02 +0200)
m4/dovecot.m4

index 2a157d3490442daa6332995712e81d1f3de38b47..286d0e65eec0d243704cf2f2bb884a29cf97ef1a 100644 (file)
@@ -200,8 +200,13 @@ AC_DEFUN([AC_CC_RETPOLINE],[
     AS_IF([test "$enable_hardening" = yes], [
       case "$host" in
         *)
-          gl_COMPILER_OPTION_IF([-mfunction-return=thunk -mindirect-branch=thunk], [
-            CFLAGS="$CFLAGS -mfunction-return=thunk -mindirect-branch=thunk"
+          gl_COMPILER_OPTION_IF([-mfunction-return=thunk],
+            [CFLAGS="$CFLAGS -mfunction-return=thunk],
+            [],
+            [AC_LANG_PROGRAM()]
+          )
+          gl_COMPILER_OPTION_IF([-mindirect-branch=thunk], [
+            CFLAGS="$CFLAGS -mindirect-branch=thunk"
             ],
             [],
             [AC_LANG_PROGRAM()]