Module: wine Branch: master Commit: 59b5b79c0c9ca6589f02f707328d849b08c89a73 URL: https://gitlab.winehq.org/wine/wine/-/commit/59b5b79c0c9ca6589f02f707328d849...
Author: Martin Storsjö martin@martin.st Date: Thu Aug 11 14:26:31 2022 +0300
configure: Downgrade -Wincompatible-function-pointer-types to a warning on ARM.
Clang 16 is defaulting -Wincompatible-function-pointer-types to an error instead of a warning. This isn't an issue for most of Wine, but the error shows up in a lot of cases if doing a non-PE build for ARM (32 bit, 64 has no such issues), in particular around the integration of libxml2 and faudio.
The root cause of the issue is that some functions are specified with e.g. __attribute__((pcs("aapcs-vfp"))) - which is equal to the default calling convention when compiling with -mfloat-abi=hard - but Clang's warning doesn't treat such function pointers as equal. (This could maybe be considered a bug or limitation in Clang though.)
There's also some smaller amount of cases where our attributes actually do conflict, where we mix __attribute__((pcs("aapcs"))), i.e. arm softfloat calling convention, with the default calling convention (which is set to hardfloat), but they drown in the noise from the other ones.
Therefore, on arm, try to downgrade this diagnostic back to a warning, not an error - while keeping the warnings visible.
Signed-off-by: Martin Storsjö martin@martin.st
---
configure | 29 +++++++++++++++++++++++++++++ configure.ac | 2 ++ 2 files changed, 31 insertions(+)
diff --git a/configure b/configure index 51946122dae..9a426b619bb 100755 --- a/configure +++ b/configure @@ -19413,6 +19413,35 @@ printf "%s\n" "$ac_cv_mabi_ms" >&6; } fi MSVCRTFLAGS="$MSVCRTFLAGS -mabi=ms" ;; esac ;; + arm*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wincompatible-function-pointer-types" >&5 +printf %s "checking whether the compiler supports -Wincompatible-function-pointer-types... " >&6; } +if test ${ac_cv_cflags__Wincompatible_function_pointer_types+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_wine_try_cflags_saved=$CFLAGS +CFLAGS="$CFLAGS -Wincompatible-function-pointer-types" +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__Wincompatible_function_pointer_types=yes +else $as_nop + ac_cv_cflags__Wincompatible_function_pointer_types=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wincompatible_function_pointer_types" >&5 +printf "%s\n" "$ac_cv_cflags__Wincompatible_function_pointer_types" >&6; } +if test "x$ac_cv_cflags__Wincompatible_function_pointer_types" = xyes +then : + EXTRACFLAGS="$EXTRACFLAGS -Wno-error=incompatible-function-pointer-types" +fi ;; esac
CFLAGS=$saved_CFLAGS diff --git a/configure.ac b/configure.ac index dd4abd39e32..560d66c46de 100644 --- a/configure.ac +++ b/configure.ac @@ -1931,6 +1931,8 @@ int a(int b, ...) { __builtin_ms_va_list list; __builtin_ms_va_start(list,b); }] fi MSVCRTFLAGS="$MSVCRTFLAGS -mabi=ms" ;; esac ;; + arm*) + WINE_TRY_CFLAGS([-Wincompatible-function-pointer-types],[EXTRACFLAGS="$EXTRACFLAGS -Wno-error=incompatible-function-pointer-types"]) ;; esac
CFLAGS=$saved_CFLAGS