[PATCH 0/1] MR5586: configure: Test PE compilers after setting their target argument.
clang will default to the host if no target is specified, which causes compile test failures if arch-specific CFLAGS are used for a non-host arch. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5586
From: Billy Laws <blaws05(a)gmail.com> clang will default to the host if no target is specified, which causes compile test failures if arch-specific CFLAGS are used for a non-host arch. --- configure.ac | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 31c2fa2588e..6903f3267a0 100644 --- a/configure.ac +++ b/configure.ac @@ -836,14 +836,9 @@ do AS_VAR_COPY([${wine_arch}_LDFLAGS],[LDFLAGS]) AS_VAR_SET([${wine_arch}_EXTRACFLAGS],["-D__WINE_PE_BUILD -Wall"]) - target="" - AS_VAR_PUSHDEF([wine_cv_crosscc],[ac_cv_${wine_arch}_crosscc]) AS_VAR_IF([${wine_arch}_CC],[false],[], - [AC_CACHE_CHECK([whether $CC works],[wine_cv_crosscc], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], - [AS_VAR_SET([wine_cv_crosscc],[yes])],[AS_VAR_SET([wine_cv_crosscc],[no])])])]) - AS_VAR_IF([wine_cv_crosscc],[yes], - [set x $CC + [target="" + set x $CC shift while test $# -ge 1 do @@ -868,6 +863,7 @@ do fi llvm_extra_cflags="-target $llvm_target -fuse-ld=lld" llvm_extra_ldflags="" + llvm_cflags="" case $llvm_target in *windows) llvm_cflags="-Wl,-subsystem:console -Wl,-WX" ;; esac @@ -884,8 +880,9 @@ do AS_VAR_APPEND([${wine_arch}_LDFLAGS],[" $llvm_extra_ldflags"]) CFLAGS="$llvm_extra_cflags $llvm_cflags" fi - AS_VAR_SET([${wine_arch}_TARGET],[$target])]) - AS_VAR_POPDEF([wine_cv_crosscc]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [],[AS_VAR_SET([target],[""])]) + ]) if test -z "$target" then @@ -895,6 +892,7 @@ This is an error since --enable-archs=$wine_arch was requested.])]) continue fi + AS_VAR_SET([${wine_arch}_TARGET],[$target]) AS_VAR_PUSHDEF([wine_cv_crosscc_c99],[ac_cv_${wine_arch}_crosscc_c99]) AC_MSG_CHECKING([for $CC option to enable C99 features]) AC_CACHE_VAL([wine_cv_crosscc_c99], -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5586
Alexandre Julliard (@julliard) commented about configure.ac:
AS_VAR_APPEND([${wine_arch}_LDFLAGS],[" $llvm_extra_ldflags"]) CFLAGS="$llvm_extra_cflags $llvm_cflags" fi - AS_VAR_SET([${wine_arch}_TARGET],[$target])]) - AS_VAR_POPDEF([wine_cv_crosscc]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [],[AS_VAR_SET([target],[""])]) + ])
This still needs an AC_CACHE_CHECK. Also it's redundant if the -target tests succeeded. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5586#note_69809
participants (3)
-
Alexandre Julliard (@julliard) -
Billy Laws -
Billy Laws (@bylaws)