Alexandre Julliard : makefiles: Don't use -fno-builtin flag with MinGW.
Alexandre Julliard
julliard at winehq.org
Wed Apr 24 16:33:29 CDT 2019
Module: wine
Branch: master
Commit: 629f2e10b134982658070497e129f70cc8a424d8
URL: https://source.winehq.org/git/wine.git/?a=commit;h=629f2e10b134982658070497e129f70cc8a424d8
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Apr 24 11:54:14 2019 +0200
makefiles: Don't use -fno-builtin flag with MinGW.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
configure | 60 ++++++++++++++++++++++++++++++---------------------------
configure.ac | 7 ++++++-
tools/makedep.c | 1 -
3 files changed, 38 insertions(+), 30 deletions(-)
diff --git a/configure b/configure
index 158d983..1ed30b9 100755
--- a/configure
+++ b/configure
@@ -632,8 +632,8 @@ POLL_LIBS
DL_LIBS
TOOLSEXT
UNWINDFLAGS
-EXCESS_PRECISION_CFLAGS
BUILTINFLAG
+EXCESS_PRECISION_CFLAGS
EXTRACFLAGS
VKD3D_LIBS
VKD3D_CFLAGS
@@ -16568,33 +16568,7 @@ $as_echo "$ac_cv_c_gcc_strength_bug" >&6; }
EXTRACFLAGS="$EXTRACFLAGS -fno-strength-reduce"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-builtin" >&5
-$as_echo_n "checking whether the compiler supports -fno-builtin... " >&6; }
-if ${ac_cv_cflags__fno_builtin+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_wine_try_cflags_saved=$CFLAGS
-CFLAGS="$CFLAGS -fno-builtin"
-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__fno_builtin=yes
-else
- ac_cv_cflags__fno_builtin=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__fno_builtin" >&5
-$as_echo "$ac_cv_cflags__fno_builtin" >&6; }
-if test "x$ac_cv_cflags__fno_builtin" = xyes; then :
- BUILTINFLAG="-fno-builtin"
-
-fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-strict-aliasing" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-strict-aliasing" >&5
$as_echo_n "checking whether the compiler supports -fno-strict-aliasing... " >&6; }
if ${ac_cv_cflags__fno_strict_aliasing+:} false; then :
$as_echo_n "(cached) " >&6
@@ -17113,6 +17087,36 @@ fi ;;
esac
done
+ case $host_os in
+ cygwin*|mingw32*) ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-builtin" >&5
+$as_echo_n "checking whether the compiler supports -fno-builtin... " >&6; }
+if ${ac_cv_cflags__fno_builtin+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_wine_try_cflags_saved=$CFLAGS
+CFLAGS="$CFLAGS -fno-builtin"
+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__fno_builtin=yes
+else
+ ac_cv_cflags__fno_builtin=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__fno_builtin" >&5
+$as_echo "$ac_cv_cflags__fno_builtin" >&6; }
+if test "x$ac_cv_cflags__fno_builtin" = xyes; then :
+ BUILTINFLAG="-fno-builtin"
+
+fi ;;
+ esac
+
case $host_cpu in
*i[3456789]86*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fno-omit-frame-pointer" >&5
$as_echo_n "checking whether the compiler supports -fno-omit-frame-pointer... " >&6; }
diff --git a/configure.ac b/configure.ac
index c2f97e0..68d52a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1937,7 +1937,6 @@ then
fi
dnl Check for some compiler flags
- WINE_TRY_CFLAGS([-fno-builtin],[AC_SUBST(BUILTINFLAG,"-fno-builtin")])
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
@@ -1984,6 +1983,12 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy=
esac
done
+ dnl Disable gcc builtins except for Mingw
+ case $host_os in
+ cygwin*|mingw32*) ;;
+ *) WINE_TRY_CFLAGS([-fno-builtin],[AC_SUBST(BUILTINFLAG,"-fno-builtin")]) ;;
+ esac
+
dnl gcc-4.6+ omits frame pointers by default, breaking some copy protections
case $host_cpu in
*i[[3456789]]86*) WINE_TRY_CFLAGS([-fno-omit-frame-pointer]) ;;
diff --git a/tools/makedep.c b/tools/makedep.c
index 2fcb917..e4d48dd 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -2990,7 +2990,6 @@ static void output_source_default( struct makefile *make, struct incl_file *sour
output_filenames( make->include_args );
output_filenames( make->define_args );
output_filenames( extradefs );
- if (make->use_msvcrt) output_filenames( msvcrt_flags );
output_filenames( extra_cross_cflags );
output_filenames( cpp_flags );
output_filename( "$(CROSSCFLAGS)" );
More information about the wine-cvs
mailing list