mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Only use a rustc wrapper script when ld.gold is available.
Fixes #7247.
This commit is contained in:
parent
fb7a53c6cf
commit
1dab9294f4
2 changed files with 5 additions and 4 deletions
|
@ -1,4 +1,2 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
EXTRA_ARGS=""
|
rustc -C link-args=-fuse-ld=gold "$@"
|
||||||
which ld.gold > /dev/null 2>&1 && EXTRA_ARGS="-C link-args=-fuse-ld=gold"
|
|
||||||
rustc $EXTRA_ARGS "$@"
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import os
|
||||||
from os import path
|
from os import path
|
||||||
import contextlib
|
import contextlib
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from subprocess import PIPE
|
||||||
import sys
|
import sys
|
||||||
import toml
|
import toml
|
||||||
|
|
||||||
|
@ -303,7 +304,9 @@ class CommandBase(object):
|
||||||
env['HOST_FILE'] = hosts_file_path
|
env['HOST_FILE'] = hosts_file_path
|
||||||
|
|
||||||
env['RUSTDOC'] = path.join(self.context.topdir, 'etc', 'rustdoc-with-private')
|
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
|
return env
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue