Commit 8c0f97be authored by Oleg Romashin's avatar Oleg Romashin
Browse files

Bug 618789 - Allow ARMv7 builds for ARM code (rather than Thumb-2 code)....

Bug 618789 - Allow ARMv7 builds for ARM code (rather than Thumb-2 code). r=mitchell.field a=approval2.0
parent e4f91b36
Loading
Loading
Loading
Loading
+43 −2
Original line number Diff line number Diff line
@@ -7132,18 +7132,39 @@ if test $MOZ_PLATFORM_MAEMO; then
   AC_SUBST(MOZ_PLATFORM_MAEMO_CFLAGS)
fi

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 ========================================================
MOZ_ARG_ENABLE_BOOL(thumb2,
 [  --enable-thumb2         Enable Thumb2 instruction set],
 [  --enable-thumb2         Enable Thumb2 instruction set (implies ARMv7)],
    MOZ_THUMB2=1,
    MOZ_THUMB2=)
if test -n "$MOZ_THUMB2"; then
  MOZ_ARM_ARCH=armv7
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 -Wa, -march=armv7-a -Wa, -mthumb"
        CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
        ASFLAGS="$ASFLAGS -march=armv7-a -mthumb"
@@ -7155,6 +7176,22 @@ if test -n "$MOZ_THUMB2"; then
      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 -Wa, -march=armv7-a -Wa, -marm"
        CXXFLAGS="$CXXFLAGS -march=armv7-a -marm -Wa, -march=armv7-a -Wa, -marm"
        ASFLAGS="$ASFLAGS -march=armv7-a -marm"
      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*)
@@ -7168,6 +7205,7 @@ else
fi

AC_SUBST(MOZ_THUMB2)
AC_SUBST(MOZ_ARM_ARCH)

dnl ========================================================
dnl = faststripe theme
@@ -9478,6 +9516,9 @@ if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
if test -n "$MOZ_THUMB2"; then
  _SUBDIR_CONFIG_ARGS="$_SUBDIR_CONFIG_ARGS --enable-thumb2"
fi
if test -n "$MOZ_ARM_ARCH"; then
  _SUBDIR_CONFIG_ARGS="$_SUBDIR_CONFIG_ARGS --with-cpu-arch=$MOZ_ARM_ARCH"
fi
if test -n "$_WRAP_MALLOC"; then
  _SUBDIR_CONFIG_ARGS="$_SUBDIR_CONFIG_ARGS --enable-wrap-malloc"
fi
+42 −2
Original line number Diff line number Diff line
@@ -4647,19 +4647,39 @@ dnl =
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 ========================================================
MOZ_ARG_ENABLE_BOOL(thumb2,
 [  --enable-thumb2         Enable Thumb2 instruction set],
 [  --enable-thumb2         Enable Thumb2 instruction set (implies ARMv7)],
    MOZ_THUMB2=1,
    MOZ_THUMB2=)
if test -n "$MOZ_THUMB2"; then
  MOZ_ARM_ARCH=armv7
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 -Wa, -march=armv7-a -Wa, -mthumb"
        CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
        ASFLAGS="$ASFLAGS -march=armv7-a -mthumb"
@@ -4671,6 +4691,22 @@ if test -n "$MOZ_THUMB2"; then
      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 -Wa, -march=armv7-a -Wa, -marm"
        CXXFLAGS="$CXXFLAGS -march=armv7-a -marm -Wa, -march=armv7-a -Wa, -marm"
        ASFLAGS="$ASFLAGS -march=armv7-a -marm"
      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*)
@@ -4684,6 +4720,7 @@ else
fi

AC_SUBST(MOZ_THUMB2)
AC_SUBST(MOZ_ARM_ARCH)

dnl ========================================================
dnl =
@@ -6078,6 +6115,9 @@ if test "$JS_HAS_CTYPES"; then
  if test -n "$MOZ_THUMB2"; then
    ac_configure_args="$ac_configure_args --enable-thumb2"
  fi
  if test -n "$MOZ_ARM_ARCH"; then
    ac_configure_args="$ac_configure_args --with-cpu-arch=$MOZ_ARM_ARCH"
  fi

  # Use a separate cache file for libffi, since it does things differently
  # from our configure.
+36 −2
Original line number Diff line number Diff line
@@ -912,18 +912,37 @@ AC_ARG_ENABLE(os2-high-mem,
        MOZ_OS2_HIGH_MEMORY=1
      fi ])

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 ========================================================
AC_ARG_ENABLE(thumb2,
 [  --enable-thumb2              Enable Thumb2 instruction set],
 [  --enable-thumb2              Enable Thumb2 instruction set (implies ARMv7)],
 [ if test "$enableval" = "yes"; then
     MOZ_THUMB2=1,
   fi ])
if test -n "$MOZ_THUMB2"; then
  MOZ_ARM_ARCH=armv7
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
        CFLAGS="$CFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
        CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
@@ -936,6 +955,21 @@ if test -n "$MOZ_THUMB2"; then
      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
        CFLAGS="$CFLAGS -march=armv7-a -marm -Wa, -march=armv7-a -Wa, -marm"
        CXXFLAGS="$CXXFLAGS -march=armv7-a -marm -Wa, -march=armv7-a -Wa, -marm"
        ASFLAGS="$ASFLAGS -march=armv7-a -marm"
      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*)