From: Aki Tuomi Date: Fri, 17 Jan 2020 07:42:07 +0000 (+0200) Subject: dovecot.m4: Add --with-retpoline X-Git-Tag: 2.3.10~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=090e162644b74cc49595182a1ca0d9014bd54aa8;p=thirdparty%2Fdovecot%2Fcore.git dovecot.m4: Add --with-retpoline Makes retpoline optional. --- diff --git a/m4/dovecot.m4 b/m4/dovecot.m4 index 286d0e65ee..980d9bb08d 100644 --- a/m4/dovecot.m4 +++ b/m4/dovecot.m4 @@ -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=], [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()]