configure: Make Clang fail optimization arguments it doesn't care about.

Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Chip Davis 2020-04-08 23:02:25 -05:00 committed by Alexandre Julliard
parent 3d77dd1058
commit f3b9a4c826
2 changed files with 82 additions and 56 deletions

129
configure vendored
View File

@ -16869,7 +16869,83 @@ if test "x${GCC}" = "xyes"
then
EXTRACFLAGS="-Wall -pipe"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fcf-protection=none" >&5
saved_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=unknown-warning-option" >&5
$as_echo_n "checking whether the compiler supports -Werror=unknown-warning-option... " >&6; }
if ${ac_cv_cflags__Werror_unknown_warning_option+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Werror_unknown_warning_option=yes
else
ac_cv_cflags__Werror_unknown_warning_option=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror_unknown_warning_option" >&5
$as_echo "$ac_cv_cflags__Werror_unknown_warning_option" >&6; }
if test "x$ac_cv_cflags__Werror_unknown_warning_option" = xyes; then :
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=unused-command-line-argument" >&5
$as_echo_n "checking whether the compiler supports -Werror=unused-command-line-argument... " >&6; }
if ${ac_cv_cflags__Werror_unused_command_line_argument+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Werror_unused_command_line_argument=yes
else
ac_cv_cflags__Werror_unused_command_line_argument=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror_unused_command_line_argument" >&5
$as_echo "$ac_cv_cflags__Werror_unused_command_line_argument" >&6; }
if test "x$ac_cv_cflags__Werror_unused_command_line_argument" = xyes; then :
CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=ignored-optimization-argument" >&5
$as_echo_n "checking whether the compiler supports -Werror=ignored-optimization-argument... " >&6; }
if ${ac_cv_cflags__Werror_ignored_optimization_argument+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -Werror=ignored-optimization-argument"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Werror_ignored_optimization_argument=yes
else
ac_cv_cflags__Werror_ignored_optimization_argument=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror_ignored_optimization_argument" >&5
$as_echo "$ac_cv_cflags__Werror_ignored_optimization_argument" >&6; }
if test "x$ac_cv_cflags__Werror_ignored_optimization_argument" = xyes; then :
CFLAGS="$CFLAGS -Werror=ignored-optimization-argument"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fcf-protection=none" >&5
$as_echo_n "checking whether the compiler supports -fcf-protection=none... " >&6; }
if ${ac_cv_cflags__fcf_protection_none+:} false; then :
$as_echo_n "(cached) " >&6
@ -16969,57 +17045,6 @@ $as_echo "$ac_cv_cflags__fexcess_precision_standard" >&6; }
if test "x$ac_cv_cflags__fexcess_precision_standard" = xyes; then :
EXCESS_PRECISION_CFLAGS="-fexcess-precision=standard"
fi
saved_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=unknown-warning-option" >&5
$as_echo_n "checking whether the compiler supports -Werror=unknown-warning-option... " >&6; }
if ${ac_cv_cflags__Werror_unknown_warning_option+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Werror_unknown_warning_option=yes
else
ac_cv_cflags__Werror_unknown_warning_option=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror_unknown_warning_option" >&5
$as_echo "$ac_cv_cflags__Werror_unknown_warning_option" >&6; }
if test "x$ac_cv_cflags__Werror_unknown_warning_option" = xyes; then :
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=unused-command-line-argument" >&5
$as_echo_n "checking whether the compiler supports -Werror=unused-command-line-argument... " >&6; }
if ${ac_cv_cflags__Werror_unused_command_line_argument+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Werror_unused_command_line_argument=yes
else
ac_cv_cflags__Werror_unused_command_line_argument=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror_unused_command_line_argument" >&5
$as_echo "$ac_cv_cflags__Werror_unused_command_line_argument" >&6; }
if test "x$ac_cv_cflags__Werror_unused_command_line_argument" = xyes; then :
CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wdeclaration-after-statement" >&5
$as_echo_n "checking whether the compiler supports -Wdeclaration-after-statement... " >&6; }

View File

@ -2004,14 +2004,15 @@ then
EXTRACFLAGS="-Wall -pipe"
dnl Check for some compiler flags
WINE_TRY_CFLAGS([-fcf-protection=none])
WINE_TRY_CFLAGS([-fno-stack-protector])
WINE_TRY_CFLAGS([-fno-strict-aliasing])
WINE_TRY_CFLAGS([-fexcess-precision=standard],[AC_SUBST(EXCESS_PRECISION_CFLAGS,"-fexcess-precision=standard")])
dnl clang needs to be told to fail on unknown options
saved_CFLAGS=$CFLAGS
WINE_TRY_CFLAGS([-Werror=unknown-warning-option],[CFLAGS="$CFLAGS -Werror=unknown-warning-option"])
WINE_TRY_CFLAGS([-Werror=unused-command-line-argument],[CFLAGS="$CFLAGS -Werror=unused-command-line-argument"])
WINE_TRY_CFLAGS([-Werror=ignored-optimization-argument],[CFLAGS="$CFLAGS -Werror=ignored-optimization-argument"])
WINE_TRY_CFLAGS([-fcf-protection=none])
WINE_TRY_CFLAGS([-fno-stack-protector])
WINE_TRY_CFLAGS([-fno-strict-aliasing])
WINE_TRY_CFLAGS([-fexcess-precision=standard],[AC_SUBST(EXCESS_PRECISION_CFLAGS,"-fexcess-precision=standard")])
WINE_TRY_CFLAGS([-Wdeclaration-after-statement])
WINE_TRY_CFLAGS([-Wempty-body])
WINE_TRY_CFLAGS([-Wignored-qualifiers])