Bug 1261841 part 6 - Make --enable-rust-simd a no-op on CPU architectures other than aarch64, x86 and x86_64. r=froydnj. draft
authorHenri Sivonen <hsivonen@hsivonen.fi>
Mon, 12 Jun 2017 14:55:29 +0300
changeset 593179 58279ef3e1a5c970c9dbf67d26345403bb612958
parent 593178 de0f0fa6f19d116db5e6d05ade564b3e990814da
child 633041 149134c78f24c641caa754741d17bf3ed13d661b
push id63619
push userbmo:hsivonen@hsivonen.fi
push dateTue, 13 Jun 2017 09:01:19 +0000
reviewersfroydnj
bugs1261841
milestone56.0a1
Bug 1261841 part 6 - Make --enable-rust-simd a no-op on CPU architectures other than aarch64, x86 and x86_64. r=froydnj. MozReview-Commit-ID: JZ2iwvJXUB7
toolkit/moz.configure
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -795,19 +795,22 @@ set_config('MOZ_BUILD_WEBRENDER', webren
 set_define('MOZ_BUILD_WEBRENDER', webrender.build)
 set_config('MOZ_ENABLE_WEBRENDER', webrender.enable)
 
 # SIMD acceleration for Rust code (currently just encoding_rs)
 
 option('--enable-rust-simd', env='MOZ_RUST_SIMD',
        help='Enable explicit SIMD in Rust code.')
 
-@depends('--enable-rust-simd')
-def rust_simd(value):
-    if value:
+@depends('--enable-rust-simd', target)
+def rust_simd(value, target):
+    # As of 2017-06-13, the simd crate only works on aarch64,
+    # x86 and x86_64. It's meant to work on 32-bit ARM, too,
+    # but currently does not.
+    if target.cpu in ('aarch64', 'x86', 'x86_64') and value:
         return True
 
 set_config('MOZ_RUST_SIMD', rust_simd)
 set_define('MOZ_RUST_SIMD', rust_simd)
 
 # Printing
 # ==============================================================
 @depends(target)