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: Brendan Shanks <bshanks@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7f481ea05f
commit
80a30625a7
|
@ -8781,32 +8781,7 @@ fi
|
||||||
$as_echo "$ac_cv_cflags__Wl__no_new_main__e__main" >&6; }
|
$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 :
|
if test "x$ac_cv_cflags__Wl__no_new_main__e__main" = xyes; then :
|
||||||
WINEPRELOADER_LDFLAGS="-Wl,-no_new_main $WINEPRELOADER_LDFLAGS"
|
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 "$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 -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_n "checking whether the compiler supports -Wl,-no_new_main -e _main -mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs... " >&6; }
|
$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 :
|
if ${ac_cv_cflags__Wl__no_new_main__e__main__mmacosx_version_min_10_7__nostartfiles__nodefaultlibs+:} false; then :
|
||||||
$as_echo_n "(cached) " >&6
|
$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
|
else
|
||||||
wine_can_build_preloader=no
|
wine_can_build_preloader=no
|
||||||
fi
|
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
|
else
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs" >&5
|
{ $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; }
|
$as_echo_n "checking whether the compiler supports -mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs... " >&6; }
|
||||||
|
@ -8887,7 +8836,6 @@ if test "x$ac_cv_cflags__mmacosx_version_min_10_7__nostartfiles__nodefaultlibs"
|
||||||
else
|
else
|
||||||
wine_can_build_preloader=no
|
wine_can_build_preloader=no
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
if test "$wine_can_build_preloader" = "yes"
|
if test "$wine_can_build_preloader" = "yes"
|
||||||
then
|
then
|
||||||
|
|
14
configure.ac
14
configure.ac
|
@ -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"
|
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],
|
WINE_TRY_CFLAGS([-Wl,-no_new_main -e _main],
|
||||||
[WINEPRELOADER_LDFLAGS="-Wl,-no_new_main $WINEPRELOADER_LDFLAGS"
|
[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],
|
||||||
[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"],
|
||||||
[WINEPRELOADER_LDFLAGS="-mmacosx-version-min=10.7 $WINEPRELOADER_LDFLAGS"],
|
[wine_can_build_preloader=no])],
|
||||||
[wine_can_build_preloader=no])])],
|
[WINE_TRY_CFLAGS([-mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs],
|
||||||
[WINE_TRY_CFLAGS([-nostartfiles -nodefaultlibs],,
|
[WINEPRELOADER_LDFLAGS="-mmacosx-version-min=10.7 $WINEPRELOADER_LDFLAGS"],
|
||||||
[WINE_TRY_CFLAGS([-mmacosx-version-min=10.7 -nostartfiles -nodefaultlibs],
|
[wine_can_build_preloader=no])])
|
||||||
[WINEPRELOADER_LDFLAGS="-mmacosx-version-min=10.7 $WINEPRELOADER_LDFLAGS"],
|
|
||||||
[wine_can_build_preloader=no])])])
|
|
||||||
if test "$wine_can_build_preloader" = "yes"
|
if test "$wine_can_build_preloader" = "yes"
|
||||||
then
|
then
|
||||||
WINE_TRY_CFLAGS([-Wl,-no_pie],
|
WINE_TRY_CFLAGS([-Wl,-no_pie],
|
||||||
|
|
Loading…
Reference in New Issue