Bug 1252041 - rust: disable sse2 code generation on win32. r=mshal
authorRalph Giles <giles@mozilla.com>
Mon, 29 Feb 2016 13:25:14 -0800
changeset 322528 a5afedbecaadff30d5469a6dfb8ec78b96df9340
parent 322527 da5dc4c5bb293ab0d25643360320d00ff9b3a614
child 322529 254be11071c8f03ee598aeae055309863103223e
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1252041
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1252041 - rust: disable sse2 code generation on win32. r=mshal By default llvm (and rustc) generate sse2 instructions on x84, but we have users on old cpus without this extension, causing crashes in the rust code. Pass a flag when building for win32 to prevent this. Export and AC_SUBST RUSTFLAGS so it's available in the build. This apparently wasn't hooked up before.
old-configure.in
--- a/old-configure.in
+++ b/old-configure.in
@@ -1499,16 +1499,28 @@ fi
 AC_SUBST(HAVE_64BIT_BUILD)
 AC_LANG_RESTORE
 fi # COMPILE_ENVIRONMENT
 
 dnl ========================================================
 dnl Special rust checks
 dnl ========================================================
 
+if test -n "$MOZ_RUST"; then
+  AC_MSG_CHECKING([rustc target sse2 support])
+  case "$OS_ARCH:$CPU_ARCH" in
+    WINNT:x86)
+      RUSTFLAGS="${RUSTFLAGS} -C target-feature=-sse2"
+      AC_MSG_RESULT([no])
+      ;;
+    *)
+      AC_MSG_RESULT([ok])
+  esac
+fi
+
 if test -n "$MACOSX_DEPLOYMENT_TARGET" -a -n "$MOZ_RUST"; then
   AC_MSG_CHECKING([if we're targeting 32-bit])
   if test -z "$HAVE_64BIT_BUILD"; then
     AC_MSG_RESULT([using $RUSTC])
   else
     AC_MSG_RESULT([no])
   fi
   AC_MSG_CHECKING([rustc compatibility with MacOS X])
@@ -8770,16 +8782,18 @@ AC_SUBST(HOST_LDFLAGS)
 AC_SUBST(HOST_OPTIMIZE_FLAGS)
 AC_SUBST(HOST_AR)
 AC_SUBST(HOST_AR_FLAGS)
 AC_SUBST(HOST_LD)
 AC_SUBST(HOST_RANLIB)
 AC_SUBST(HOST_BIN_SUFFIX)
 AC_SUBST(HOST_OS_ARCH)
 
+AC_SUBST(RUSTFLAGS)
+
 AC_SUBST(TARGET_CPU)
 AC_SUBST(TARGET_VENDOR)
 AC_SUBST(TARGET_OS)
 AC_SUBST(TARGET_XPCOM_ABI)
 AC_SUBST(OS_TARGET)
 AC_SUBST(OS_ARCH)
 AC_SUBST(OS_RELEASE)
 AC_SUBST(OS_TEST)
@@ -9155,16 +9169,17 @@ export CPP
 export CC
 export CXX
 export LD
 export ARFLAGS
 export CPPFLAGS
 export CFLAGS
 export CXXFLAGS
 export LDFLAGS
+export RUSTFLAGS
 export HOST_CC
 export HOST_CXX
 export HOST_CFLAGS
 export HOST_CXXFLAGS
 export HOST_LDFLAGS
 
 if ! test -e js; then
     mkdir js