Bug 914174 - Ensure JS standalone builds have the right ASan options. r=luke
authorChristian Holler <choller@mozilla.com>
Tue, 10 Sep 2013 17:00:07 +0200
changeset 146455 4f3fe05d6dc8e151680efeed99149d9fd81e3104
parent 146454 efb5dda07b745080ba814af0544e29dc9b9edb58
child 146456 3116abfc2f9578022809c2a555cd763ddbd73b7d
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 CLOSED TREE
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