Bug 914174 - Ensure JS standalone builds have the right ASan options. r=luke
☠☠ backed out by 4e8db3422a37 ☠ ☠
authorChristian Holler <choller@mozilla.com>
Tue, 10 Sep 2013 17:00:07 +0200
changeset 146424 0f7c370491bf44c2434049972ac28010d5c0a4ed
parent 146423 508a916a482a53d789477ce866e7cf2aeed0e2ae
child 146425 1a413186fb491eaf4de542356d10f45266cb7b29
push id25260
push userryanvm@gmail.com
push dateWed, 11 Sep 2013 00:29:30 +0000
treeherdermozilla-central@f73bed2856a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs914174
milestone26.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 914174 - Ensure JS standalone builds have the right ASan options. r=luke
js/src/configure.in
js/src/jit/AsmJSSignalHandlers.cpp
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -144,16 +144,17 @@ else
   JS_SHARED_LIBRARY=1
 fi
 AC_SUBST(JS_SHARED_LIBRARY)
 
 if test "$JS_STANDALONE" = no; then
   JS_STANDALONE=
 else
   JS_STANDALONE=1
+  AC_DEFINE(JS_STANDALONE)
 fi
 AC_SUBST(JS_STANDALONE)
 
 MOZ_ARG_WITH_STRING(gonk,
 [  --with-gonk=DIR
                location of gonk dir],
     gonkdir=$withval)
 
--- a/js/src/jit/AsmJSSignalHandlers.cpp
+++ b/js/src/jit/AsmJSSignalHandlers.cpp
@@ -1028,8 +1028,20 @@ js::TriggerOperationCallbackForAsmJSCode
     DWORD oldProtect;
     if (!VirtualProtect(module.functionCode(), module.functionBytes(), PAGE_NOACCESS, &oldProtect))
         MOZ_CRASH();
 #else  // assume Unix
     if (mprotect(module.functionCode(), module.functionBytes(), PROT_NONE))
         MOZ_CRASH();
 #endif
 }
+
+#ifdef MOZ_ASAN
+#ifdef JS_STANDALONE
+// Usually, this definition is found in mozglue (see mozglue/build/AsanOptions.cpp).
+// However, when doing standalone JS builds, mozglue is not used and we must ensure
+// that we still allow custom SIGSEGV handlers for asm.js and ion to work correctly.
+extern "C" MOZ_ASAN_BLACKLIST
+const char* __asan_default_options() {
+    return "allow_user_segv_handler=1";
+}
+#endif
+#endif