summaryrefslogtreecommitdiff
blob: 106ec144f8932912d4d1e6b5a1d6626e3b8a3372 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
--- a/js-1.8.5/js/src/configure.in	2011-03-31 15:08:36.000000000 -0400
+++ b/js-1.8.5/js/src/configure.in	2012-11-02 15:32:38.000000000 -0400
@@ -3550,7 +3550,7 @@
 _SAVE_CFLAGS="$CFLAGS"
 if test "$GNU_CC"; then
   # gcc needs -mfpu=neon to recognize NEON instructions
-  CFLAGS="$CFLAGS -mfpu=neon -mfloat-abi=softfp"
+  CFLAGS="$CFLAGS -mfpu=neon"
 fi
 AC_TRY_COMPILE([],
                [asm("vadd.i8 d0, d0, d0");],
@@ -4654,12 +4654,6 @@
 dnl ========================================================
 MOZ_ARG_HEADER(Individual module options)
 
-dnl Setup default CPU arch for arm target
-case "$target_cpu" in
-  arm*)
-    MOZ_ARM_ARCH=armv7
-  ;;
-esac
 dnl ========================================================
 dnl = Enable building the Thumb2 instruction set
 dnl ========================================================
@@ -4668,66 +4662,35 @@
     MOZ_THUMB2=1,
     MOZ_THUMB2=)
 if test -n "$MOZ_THUMB2"; then
-  MOZ_ARM_ARCH=armv7
+    AC_MSG_WARN([thumb2 enabled instead of autodetected -- hope you know what you are doing])
+else
+    AC_MSG_CHECKING([for thumb2 support in arm architecture])
+    AC_LANG_SAVE
+    AC_LANG_C
+    AC_TRY_LINK([int ac_test(int i) { return i; }],[asm(".syntax unified\n.thumb\nb.w ac_test\n.arm"); if (ac_test(1)) return 1;],
+      [MOZ_THUMB2=1
+        AC_MSG_RESULT([yes])],
+      [MOZ_THUMB2=
+        AC_MSG_RESULT([no])])
+    AC_LANG_RESTORE
 fi
 
 dnl ========================================================
 dnl = Enable building for ARM specific CPU features
 dnl ========================================================
-MOZ_ARG_WITH_STRING(cpu-arch,
-[  --with-cpu-arch=arch      Use specific arm architecture CPU features, default armv7],
-    MOZ_ARM_ARCH=$withval)
-
 if test -n "$MOZ_THUMB2"; then
   case "$target_cpu" in
     arm*)
-      if test "$MOZ_ARM_ARCH" != "armv7"; then
-        AC_MSG_ERROR([--enable-thumb2 is not compatible with cpu-arch=$MOZ_ARM_ARCH])
-      fi
       if test "$GNU_CC"; then
         AC_DEFINE(MOZ_THUMB2)
-        AC_DEFINE(MOZ_ARM_ARCH)
-        CFLAGS="$CFLAGS -march=armv7-a -mthumb -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
-        CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
-        ASFLAGS="$ASFLAGS -march=armv7-a -mthumb -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
       else
         AC_MSG_ERROR([--enable-thumb2 is not supported for non-GNU toolchains])
       fi
     ;;
-    *)
-      AC_MSG_ERROR([--enable-thumb2 is not supported for non-ARM CPU architectures])
-    ;;
-  esac
-elif test "$MOZ_ARM_ARCH" = "armv7"; then
-  case "$target_cpu" in
-    arm*)
-      if test "$GNU_CC"; then
-        AC_DEFINE(MOZ_ARM_ARCH)
-        CFLAGS="$CFLAGS -march=armv7-a -marm -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
-        CXXFLAGS="$CXXFLAGS -march=armv7-a -marm -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
-        ASFLAGS="$ASFLAGS -march=armv7-a -marm -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
-      else
-        AC_MSG_ERROR([--with-cpu-arch=armv7 is not supported for non-GNU toolchains])
-      fi
-    ;;
-    *)
-      AC_MSG_ERROR([--with-cpu-arch=armv7 is not supported for non-ARM CPU architectures])
-    ;;
-  esac
-else
-  case "$target_cpu" in
-    arm*)
-      if test "$GNU_CC"; then
-        CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork -msoft-float"
-        CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork -msoft-float"
-        ASFLAGS="$ASFLAGS -march=armv5te -mthumb-interwork -msoft-float"
-      fi
-      ;;
   esac
 fi
 
 AC_SUBST(MOZ_THUMB2)
-AC_SUBST(MOZ_ARM_ARCH)
 
 dnl ========================================================
 dnl =