Commit 80a30625 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

configure: Simplify flag checks for Mac preloader.

Always build the Mac preloader with '-mmacosx-version-min=10.7', which works with all supported toolchains. Fixes bug when building with Xcode 9 where preloader flags would be added to EXTRACFLAGS and cause build failures on 32-bit. Signed-off-by: 's avatarBrendan Shanks <bshanks@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7f481ea0
......@@ -8781,32 +8781,7 @@ fi
$as_echo "$ac_cv_cflags__Wl__no_new_main__e__main" >&6; }
if test "x$ac_cv_cflags__Wl__no_new_main__e__main" = xyes; then :
WINEPRELOADER_LDFLAGS="-Wl,-no_new_main $WINEPRELOADER_LDFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-no_new_main -e _main -nostartfiles -nodefaultlibs" >&5
$as_echo_n "checking whether the compiler supports -Wl,-no_new_main -e _main -nostartfiles -nodefaultlibs... " >&6; }
if ${ac_cv_cflags__Wl__no_new_main__e__main__nostartfiles__nodefaultlibs+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -Wl,-no_new_main -e _main -nostartfiles -nodefaultlibs"
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__Wl__no_new_main__e__main__nostartfiles__nodefaultlibs=yes
else
ac_cv_cflags__Wl__no_new_main__e__main__nostartfiles__nodefaultlibs=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__Wl__no_new_main__e__main__nostartfiles__nodefaultlibs" >&5
$as_echo "$ac_cv_cflags__Wl__no_new_main__e__main__nostartfiles__nodefaultlibs" >&6; }
if test "x$ac_cv_cflags__Wl__no_new_main__e__main__nostartfiles__nodefaultlibs" = xyes; then :
EXTRACFLAGS="$EXTRACFLAGS -Wl,-no_new_main -e _main -nostartfiles -nodefaultlibs"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-no_new_main -e _main -mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-no_new_main -e _main -mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs" >&5
$as_echo_n "checking whether the compiler supports -Wl,-no_new_main -e _main -mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs... " >&6; }
if ${ac_cv_cflags__Wl__no_new_main__e__main__mmacosx_version_min_10_7__nostartfiles__nodefaultlibs+:} false; then :
$as_echo_n "(cached) " >&6
......@@ -8833,32 +8808,6 @@ if test "x$ac_cv_cflags__Wl__no_new_main__e__main__mmacosx_version_min_10_7__nos
else
wine_can_build_preloader=no
fi
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -nostartfiles -nodefaultlibs" >&5
$as_echo_n "checking whether the compiler supports -nostartfiles -nodefaultlibs... " >&6; }
if ${ac_cv_cflags__nostartfiles__nodefaultlibs+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -nostartfiles -nodefaultlibs"
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__nostartfiles__nodefaultlibs=yes
else
ac_cv_cflags__nostartfiles__nodefaultlibs=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__nostartfiles__nodefaultlibs" >&5
$as_echo "$ac_cv_cflags__nostartfiles__nodefaultlibs" >&6; }
if test "x$ac_cv_cflags__nostartfiles__nodefaultlibs" = xyes; then :
EXTRACFLAGS="$EXTRACFLAGS -nostartfiles -nodefaultlibs"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs" >&5
$as_echo_n "checking whether the compiler supports -mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs... " >&6; }
......@@ -8888,7 +8837,6 @@ else
wine_can_build_preloader=no
fi
fi
fi
if test "$wine_can_build_preloader" = "yes"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-no_pie" >&5
......
......@@ -739,14 +739,12 @@ case $host_os in
WINEPRELOADER_LDFLAGS="-nostartfiles -nodefaultlibs -e _start -ldylib1.o -Wl,-image_base,0x7d400000,-segalign,0x1000,-pagezero_size,0x1000,-sectcreate,__TEXT,__info_plist,loader/wine_info.plist,-segaddr,WINE_4GB_RESERVE,0x100000000"
WINE_TRY_CFLAGS([-Wl,-no_new_main -e _main],
[WINEPRELOADER_LDFLAGS="-Wl,-no_new_main $WINEPRELOADER_LDFLAGS"
WINE_TRY_CFLAGS([-Wl,-no_new_main -e _main -nostartfiles -nodefaultlibs],,
[WINE_TRY_CFLAGS([-Wl,-no_new_main -e _main -mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs],
[WINEPRELOADER_LDFLAGS="-mmacosx-version-min=10.7 $WINEPRELOADER_LDFLAGS"],
[wine_can_build_preloader=no])])],
[WINE_TRY_CFLAGS([-nostartfiles -nodefaultlibs],,
[WINE_TRY_CFLAGS([-mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs],
[WINEPRELOADER_LDFLAGS="-mmacosx-version-min=10.7 $WINEPRELOADER_LDFLAGS"],
[wine_can_build_preloader=no])])])
WINE_TRY_CFLAGS([-Wl,-no_new_main -e _main -mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs],
[WINEPRELOADER_LDFLAGS="-mmacosx-version-min=10.7 $WINEPRELOADER_LDFLAGS"],
[wine_can_build_preloader=no])],
[WINE_TRY_CFLAGS([-mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs],
[WINEPRELOADER_LDFLAGS="-mmacosx-version-min=10.7 $WINEPRELOADER_LDFLAGS"],
[wine_can_build_preloader=no])])
if test "$wine_can_build_preloader" = "yes"
then
WINE_TRY_CFLAGS([-Wl,-no_pie],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment