From 365bea9b07f033e38d0482f49103069df03876b1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 6 Mar 2023 17:27:39 +0100 Subject: [PATCH] Don't try using -mthreads with clang This option is useless with it and is, at best, ignored or, at worst, results in errors if it happens to be used together with -Werror, -Wunused-command-line-argument See #23314. Closes #23317. --- configure | 6 +++++- configure.in | 11 +++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/configure b/configure index ef573cf45c..a7160f9a50 100755 --- a/configure +++ b/configure @@ -37171,7 +37171,7 @@ else x86_64-*-mingw* ) ;; *-*-mingw32* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -mthreads" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -mthreads" >&5 $as_echo_n "checking if compiler supports -mthreads... " >&6; } if ${wx_cv_cflags_mthread+:} false; then : $as_echo_n "(cached) " >&6 @@ -37186,6 +37186,10 @@ int main () { +#ifdef __clang__ +#error no +#endif + ; return 0; } diff --git a/configure.in b/configure.in index be6e5b3a9e..e1f7a0c870 100644 --- a/configure.in +++ b/configure.in @@ -5251,13 +5251,20 @@ else x86_64-*-mingw* ) ;; *-*-mingw32* ) - dnl check if the compiler accepts -mthreads + dnl check if the compiler is gcc and accepts -mthreads (clang just + dnl ignores this option but it doesn't need it, so explicitly fail + dnl the test for it) AC_CACHE_CHECK([if compiler supports -mthreads], wx_cv_cflags_mthread, [ CFLAGS_OLD="$CFLAGS" CFLAGS="-mthreads $CFLAGS" - AC_TRY_COMPILE([], [], + AC_TRY_COMPILE([], + [ +#ifdef __clang__ +#error no +#endif + ], wx_cv_cflags_mthread=yes, wx_cv_cflags_mthread=no )