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.
This commit is contained in:
Ralph Giles 2016-02-29 13:25:14 -08:00
parent e63bc5609a
commit 44880922c7

View File

@ -1504,6 +1504,18 @@ 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
@ -8775,6 +8787,8 @@ 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)
@ -9160,6 +9174,7 @@ export CPPFLAGS
export CFLAGS
export CXXFLAGS
export LDFLAGS
export RUSTFLAGS
export HOST_CC
export HOST_CXX
export HOST_CFLAGS