Alexandre Julliard : configure: Default to Thumb-2 mode for ARM.
Alexandre Julliard
julliard at winehq.org
Tue Jan 19 15:44:00 CST 2021
Module: wine
Branch: master
Commit: 405e128b0b3a9661bd3db59608cd9a44f4ff9810
URL: https://source.winehq.org/git/wine.git/?a=commit;h=405e128b0b3a9661bd3db59608cd9a44f4ff9810
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Jan 18 11:44:46 2021 +0100
configure: Default to Thumb-2 mode for ARM.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
configure | 39 ++++++++++++++++++++++-----------------
configure.ac | 28 ++++++++++++++++++----------
2 files changed, 40 insertions(+), 27 deletions(-)
diff --git a/configure b/configure
index 6a0f0ad92c2..ef09f65f11e 100755
--- a/configure
+++ b/configure
@@ -5623,6 +5623,8 @@ case $host in
;;
esac
+TARGETFLAGS=""
+
case $host in
x86_64*|amd64*)
if test "x$enable_win64" != "xyes" -a "$cross_compiling" != "yes"
@@ -5660,7 +5662,6 @@ $as_echo "$wine_cv_cc_m32" >&6; }
host_cpu="i386"
notice_platform="32-bit "
TARGETFLAGS="-m32"
-
PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib32/pkgconfig:/usr/lib/pkgconfig}
export PKG_CONFIG_PATH
enable_win16=${enable_win16:-yes}
@@ -5700,37 +5701,43 @@ $as_echo "$wine_cv_builtin_ms_va_list" >&6; }
host_cpu="x86_64"
notice_platform="64-bit "
TARGETFLAGS="-m64"
-
fi
;;
arm*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports Thumb" >&5
-$as_echo_n "checking whether $CC supports Thumb... " >&6; }
-if ${wine_cv_thumb+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports Thumb-2" >&5
+$as_echo_n "checking whether $CC supports Thumb-2... " >&6; }
+if ${wine_cv_thumb2+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-int ac_test(int i) { return i; }
+
int
main ()
{
-asm(".thumb\nblx ac_test\n.arm"); if (ac_test(1)) return 1
+asm(".syntax unified\n\t.thumb\n\tldm r0,{r0-r8}");
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- wine_cv_thumb=yes
+ wine_cv_thumb2=yes
else
- wine_cv_thumb=no
+ wine_cv_thumb2=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_thumb" >&5
-$as_echo "$wine_cv_thumb" >&6; }
- test $wine_cv_thumb != no || as_fn_error $? "You need a target with Thumb support to build Wine for ARM." "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_thumb2" >&5
+$as_echo "$wine_cv_thumb2" >&6; }
+ if test x"$wine_cv_thumb2" = xyes
+ then
+ CFLAGS="$CFLAGS -mthumb"
+ TARGETFLAGS="-mthumb"
+ else
+ CFLAGS="$CFLAGS -marm"
+ TARGETFLAGS="-marm"
+ fi
case $with_float_abi in
soft|softfp|hard)
float_abi=$with_float_abi ;;
@@ -5741,7 +5748,7 @@ $as_echo "$wine_cv_thumb" >&6; }
*)
float_abi=softfp
saved_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi"
+ CFLAGS="$CFLAGS -mfloat-abi=$float_abi"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mfloat-abi=$float_abi" >&5
$as_echo_n "checking whether $CC supports -mfloat-abi=$float_abi... " >&6; }
if ${wine_cv_float_abi+:} false; then :
@@ -5777,9 +5784,8 @@ $as_echo "$wine_cv_float_abi" >&6; }
esac
;;
esac
- CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi"
- TARGETFLAGS="-marm -mfloat-abi=$float_abi"
-
+ CFLAGS="$CFLAGS -mfloat-abi=$float_abi"
+ TARGETFLAGS="$TARGETFLAGS -mfloat-abi=$float_abi"
;;
aarch64*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports __builtin_ms_va_list" >&5
@@ -5859,7 +5865,6 @@ fi
if test -n "$host_alias" -a "$host_alias" != "$build_alias"
then
TARGETFLAGS="-b $host_alias $TARGETFLAGS"
-
fi
for ac_prog in flex
diff --git a/configure.ac b/configure.ac
index 2c4bd667e8f..1921307da31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,6 +138,7 @@ case $host in
;;
esac
+AC_SUBST(TARGETFLAGS,"")
case $host in
x86_64*|amd64*)
if test "x$enable_win64" != "xyes" -a "$cross_compiling" != "yes"
@@ -149,7 +150,7 @@ case $host in
test $wine_cv_cc_m32 != no || AC_MSG_ERROR([Cannot build a 32-bit program, you need to install 32-bit development libraries.])
host_cpu="i386"
notice_platform="32-bit "
- AC_SUBST(TARGETFLAGS,"-m32")
+ TARGETFLAGS="-m32"
PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib32/pkgconfig:/usr/lib/pkgconfig}
export PKG_CONFIG_PATH
enable_win16=${enable_win16:-yes}
@@ -166,14 +167,21 @@ case $host in
CXX="$CXX -m64"
host_cpu="x86_64"
notice_platform="64-bit "
- AC_SUBST(TARGETFLAGS,"-m64")
+ TARGETFLAGS="-m64"
fi
;;
arm*)
- AC_CACHE_CHECK([whether $CC supports Thumb],wine_cv_thumb,
- [WINE_TRY_ASM_LINK([".thumb\nblx ac_test\n.arm"],[int ac_test(int i) { return i; }], [if (ac_test(1)) return 1],
- [wine_cv_thumb=yes],[wine_cv_thumb=no])])
- test $wine_cv_thumb != no || AC_MSG_ERROR([You need a target with Thumb support to build Wine for ARM.])
+ AC_CACHE_CHECK([whether $CC supports Thumb-2],wine_cv_thumb2,
+ [WINE_TRY_ASM_LINK([".syntax unified\n\t.thumb\n\tldm r0,{r0-r8}"],,,
+ [wine_cv_thumb2=yes],[wine_cv_thumb2=no])])
+ if test x"$wine_cv_thumb2" = xyes
+ then
+ CFLAGS="$CFLAGS -mthumb"
+ TARGETFLAGS="-mthumb"
+ else
+ CFLAGS="$CFLAGS -marm"
+ TARGETFLAGS="-marm"
+ fi
case $with_float_abi in
soft|softfp|hard)
float_abi=$with_float_abi ;;
@@ -184,7 +192,7 @@ case $host in
*)
float_abi=softfp
saved_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi"
+ CFLAGS="$CFLAGS -mfloat-abi=$float_abi"
AC_CACHE_CHECK([whether $CC supports -mfloat-abi=$float_abi],wine_cv_float_abi,
[WINE_TRY_ASM_LINK(["vmrs r2,fpscr"],,,[wine_cv_float_abi=yes],[wine_cv_float_abi=no])])
if test $wine_cv_float_abi = no
@@ -196,8 +204,8 @@ case $host in
esac
;;
esac
- CFLAGS="$CFLAGS -marm -mfloat-abi=$float_abi"
- AC_SUBST(TARGETFLAGS,"-marm -mfloat-abi=$float_abi")
+ CFLAGS="$CFLAGS -mfloat-abi=$float_abi"
+ TARGETFLAGS="$TARGETFLAGS -mfloat-abi=$float_abi"
;;
aarch64*)
AC_CACHE_CHECK([whether $CC supports __builtin_ms_va_list],wine_cv_builtin_ms_va_list,
@@ -248,7 +256,7 @@ else
fi
if test -n "$host_alias" -a "$host_alias" != "$build_alias"
then
- AC_SUBST(TARGETFLAGS,"-b $host_alias $TARGETFLAGS")
+ TARGETFLAGS="-b $host_alias $TARGETFLAGS"
fi
dnl Check for flex
More information about the wine-cvs
mailing list