diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2015-08-17 09:19:29 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2015-08-17 09:20:07 +0200 |
commit | 1dab9294f481ac94d95a24c69553aa0738aaf2db (patch) | |
tree | 418a497cb97c83aa47646266d7e3a55f6b95bf6c | |
parent | fb7a53c6cfc8bc2985423a55834507c930537bfc (diff) | |
download | servo-1dab9294f481ac94d95a24c69553aa0738aaf2db.tar.gz servo-1dab9294f481ac94d95a24c69553aa0738aaf2db.zip |
Only use a rustc wrapper script when ld.gold is available.
Fixes #7247.
-rwxr-xr-x | etc/rustc-with-gold | 4 | ||||
-rw-r--r-- | python/servo/command_base.py | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/etc/rustc-with-gold b/etc/rustc-with-gold index 7d2a05bb47c..077aa7f0d0b 100755 --- a/etc/rustc-with-gold +++ b/etc/rustc-with-gold @@ -1,4 +1,2 @@ #!/bin/sh -EXTRA_ARGS="" -which ld.gold > /dev/null 2>&1 && EXTRA_ARGS="-C link-args=-fuse-ld=gold" -rustc $EXTRA_ARGS "$@" +rustc -C link-args=-fuse-ld=gold "$@" diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 15f3d28ef0a..5beff5d4111 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -11,6 +11,7 @@ import os from os import path import contextlib import subprocess +from subprocess import PIPE import sys import toml @@ -303,7 +304,9 @@ class CommandBase(object): env['HOST_FILE'] = hosts_file_path env['RUSTDOC'] = path.join(self.context.topdir, 'etc', 'rustdoc-with-private') - env['RUSTC'] = path.join(self.context.topdir, 'etc', 'rustc-with-gold') + + if subprocess.call(['which', 'ld.gold'], stdout=PIPE, stderr=PIPE) == 0: + env['RUSTC'] = path.join(self.context.topdir, 'etc', 'rustc-with-gold') return env |