xref: /OK3568_Linux_fs/buildroot/package/libmpeg2/0003-fix-arm-detection.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunImprove the ARM detection to work on Thumb-only architecture
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunThe ARM-specific assembly code doesn't build on Thumb-only
4*4882a593Smuzhiyunarchitectures such as ARMv7-M, but the configure script assumes that
5*4882a593Smuzhiyunif the host tuple is arm*, then it can build and use the ARM optimized
6*4882a593Smuzhiyuncode.
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunThis patch improves the configure.ac detection logic, by building one
9*4882a593Smuzhiyunof the instruction of the optimized assembly code, and using this to
10*4882a593Smuzhiyundecide whether or not the optimizations should be enabled.
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunSigned-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunIndex: b/configure.ac
15*4882a593Smuzhiyun===================================================================
16*4882a593Smuzhiyun--- a/configure.ac
17*4882a593Smuzhiyun+++ b/configure.ac
18*4882a593Smuzhiyun@@ -101,8 +101,10 @@
19*4882a593Smuzhiyun     alpha*)
20*4882a593Smuzhiyun 	AC_DEFINE([ARCH_ALPHA],,[alpha architecture]);;
21*4882a593Smuzhiyun     arm*)
22*4882a593Smuzhiyun-	arm_conditional=:
23*4882a593Smuzhiyun-	AC_DEFINE([ARCH_ARM],,[ARM architecture]);;
24*4882a593Smuzhiyun+	AC_TRY_LINK([], [asm(".syntax divided\nstmfd sp!,{r4-r11,lr}")],
25*4882a593Smuzhiyun+	     [AC_DEFINE([ARCH_ARM],,[ARM architecture])
26*4882a593Smuzhiyun+	      use_arm_optimization=yes],
27*4882a593Smuzhiyun+	     [use_arm_optimization=no])
28*4882a593Smuzhiyun     esac
29*4882a593Smuzhiyun elif test x"$CC" = x"tendracc"; then
30*4882a593Smuzhiyun     dnl TenDRA portability checking compiler
31*4882a593Smuzhiyun@@ -122,7 +124,7 @@
32*4882a593Smuzhiyun     esac
33*4882a593Smuzhiyun fi
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun-AM_CONDITIONAL(ARCH_ARM, ${arm_conditional})
36*4882a593Smuzhiyun+AM_CONDITIONAL(ARCH_ARM, test "${use_arm_optimization}" = "yes")
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun dnl Checks for libtool - this must be done after we set cflags
39*4882a593Smuzhiyun AC_LIBTOOL_WIN32_DLL
40