Bug 1490948: Compile Cranelift on Nightlies except for Win32 static analysis builds; r=chmanchester
authorBenjamin Bouvier <benj@benj.me>
Tue, 25 Sep 2018 19:05:08 +0200
changeset 486984 4d9500ca5761edd678a109b6b5a4ac3f4aa5edb0
parent 486983 8c10309414ae573c04b690bc755859bfe8b99512
child 486985 2aec596947892a0c1aa78bba5e3a1d861140fde6
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewerschmanchester
bugs1490948
milestone64.0a1
Bug 1490948: Compile Cranelift on Nightlies except for Win32 static analysis builds; r=chmanchester ... where LLVM (32-bits toolchain) runs out of memory when compiling gkrust.
js/moz.configure
--- a/js/moz.configure
+++ b/js/moz.configure
@@ -480,18 +480,24 @@ def enable_build_binast(target, mileston
         return True
 
 set_define('JS_BUILD_BINAST', enable_build_binast)
 set_config('JS_BUILD_BINAST', enable_build_binast)
 
 
 # Experimental support for wasm code generation with Cranelift
 # ==============================================================
+
+@depends('--enable-clang-plugin', '--enable-release',
+         debug_rust, target, milestone.is_nightly, when='--enable-compile-environment')
+def default_cranelift(static_analysis, release, debug_rust, target, is_nightly):
+    # LLVM runs out of memory on win32 static analysis optimized builds when
+    # linking gkrust, so do not compile Cranelift there.
+    if static_analysis and target.kernel == 'WINNT' and target.cpu == 'x86' and release and not debug_rust:
+        return False
+    return is_nightly
+
 js_option('--enable-cranelift',
+          default=default_cranelift,
           help='Enable Cranelift code generator for wasm')
 
-@depends('--enable-cranelift')
-def enable_cranelift(value):
-    if value:
-        return True
-
-set_config('ENABLE_WASM_CRANELIFT', enable_cranelift)
-set_define('ENABLE_WASM_CRANELIFT', enable_cranelift)
+set_config('ENABLE_WASM_CRANELIFT', depends_if('--enable-cranelift')(lambda x: True))
+set_define('ENABLE_WASM_CRANELIFT', depends_if('--enable-cranelift')(lambda x: True))