diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-05 14:44:03 -0700 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-05 14:44:03 -0700 |
commit | a233d1e39b9549f7b24937ca4de9de0719bb890c (patch) | |
tree | 3f0afeed349057daf20374a43200d7e0ade66541 | |
parent | b29ae6383a2fa61a3f1f176e506c738f250b0622 (diff) | |
parent | 0bcf35c5a815c8a53f6c73f7c2cf9b97586b3746 (diff) | |
download | servo-a233d1e39b9549f7b24937ca4de9de0719bb890c.tar.gz servo-a233d1e39b9549f7b24937ca4de9de0719bb890c.zip |
Auto merge of #10916 - mmatyas:useneon, r=aneeshusa
Use NEON build flag on ARM and AArch64
The NEON flag is already used when building for Android, this patch enables it on other ARM devices too.
Note that this patch just adds the build flag to the compilation, for actually enabling the SIMD code in Servo, we'll also need #10900 (but it's not a dependency).
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10916)
<!-- Reviewable:end -->
-rw-r--r-- | python/servo/build_commands.py | 28 | ||||
-rw-r--r-- | python/servo/command_base.py | 13 |
2 files changed, 24 insertions, 17 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index f525cee020c..40db368bfe8 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -176,21 +176,23 @@ class MachCommands(CommandBase): print("Please specify either --dev or --release.") sys.exit(1) - targets = [] + if target and android: + print("Please specify either --target or --android.") + sys.exit(1) + if release: opts += ["--release"] - if target: - opts += ["--target", target] - targets.append(target) if jobs is not None: opts += ["-j", jobs] if verbose: opts += ["-v"] if android: - opts += ["--target", self.config["android"]["target"]] - targets.append("arm-linux-androideabi") + target = self.config["android"]["target"] + + if target: + opts += ["--target", target] - self.ensure_bootstrapped(targets=targets) + self.ensure_bootstrapped(target=target) if debug_mozjs or self.config["build"]["debug-mozjs"]: features += ["script/debugmozjs"] @@ -203,9 +205,13 @@ class MachCommands(CommandBase): build_start = time() env = self.build_env() + + # Ensure Rust uses hard floats and SIMD on ARM devices + if target: + if target.startswith('arm') or target.startswith('aarch64'): + env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C target-feature=+neon" + if android: - # Ensure Rust uses hard floats on Android - env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " -C target-feature=+neon" # Build OpenSSL for android make_cmd = ["make"] if jobs is not None: @@ -331,8 +337,8 @@ class MachCommands(CommandBase): action='store_true', help='Build in release mode') def build_gonk(self, jobs=None, verbose=False, release=False): - targets = ["arm-linux-androideabi"] - self.ensure_bootstrapped(targets=targets) + target = "arm-linux-androideabi" + self.ensure_bootstrapped(target=target) opts = [] if jobs is not None: diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 9f2bf307c9d..1623c8fc41f 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -411,7 +411,7 @@ class CommandBase(object): def android_build_dir(self, dev): return path.join(self.get_target_dir(), "arm-linux-androideabi", "debug" if dev else "release") - def ensure_bootstrapped(self, targets=[]): + def ensure_bootstrapped(self, target=None): if self.context.bootstrapped: return @@ -422,13 +422,14 @@ class CommandBase(object): rustc_binary_exists = path.exists(rustc_path) base_target_path = path.join(rust_root, "rustc", "lib", "rustlib") - target_paths = [path.join(base_target_path, t) for t in targets] - all_targets_exist = all([path.exists(p) for p in target_paths]) + target_exists = True + if target is not None: + target_path = path.join(base_target_path, target) + target_exists = path.exists(target_path) - if (not self.config['tools']['system-rust'] and - (not rustc_binary_exists or not all_targets_exist)): + if not (self.config['tools']['system-rust'] or (rustc_binary_exists and target_exists)): print("looking for rustc at %s" % (rustc_path)) - Registrar.dispatch("bootstrap-rust", context=self.context, target=targets) + Registrar.dispatch("bootstrap-rust", context=self.context, target=filter(None, [target])) cargo_path = path.join(self.config["tools"]["cargo-root"], "cargo", "bin", "cargo" + BIN_SUFFIX) |