mirror of
https://github.com/servo/servo.git
synced 2025-06-20 15:18:58 +01:00
Make the use of gold linker configurable
Currently, ld.gold is always used for linking if found on the system. There are some cases however when one may want to opt out from using it. This patch adds the boolean field `rustc-with-gold` to the `[tools]` section of `.servobuild`, which if set false, disables the use of ld.gold.
This commit is contained in:
parent
ef8a145233
commit
9afa930728
2 changed files with 8 additions and 2 deletions
|
@ -101,6 +101,7 @@ class CommandBase(object):
|
|||
if not self.config["tools"]["system-cargo"]:
|
||||
self.config["tools"]["cargo-root"] = path.join(
|
||||
context.sharedir, "cargo", self.cargo_build_id())
|
||||
self.config["tools"].setdefault("rustc-with-gold", True)
|
||||
|
||||
self.config.setdefault("build", {})
|
||||
self.config["build"].setdefault("android", False)
|
||||
|
@ -308,8 +309,9 @@ class CommandBase(object):
|
|||
|
||||
env['RUSTDOC'] = path.join(self.context.topdir, 'etc', 'rustdoc-with-private')
|
||||
|
||||
if subprocess.call(['which', 'ld.gold'], stdout=PIPE, stderr=PIPE) == 0:
|
||||
env['RUSTC'] = path.join(self.context.topdir, 'etc', 'rustc-with-gold')
|
||||
if self.config["tools"]["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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue