diff --git a/etc/rustc-with-gold b/etc/rustc-with-gold new file mode 100755 index 00000000000..7d2a05bb47c --- /dev/null +++ b/etc/rustc-with-gold @@ -0,0 +1,4 @@ +#!/bin/sh +EXTRA_ARGS="" +which ld.gold > /dev/null 2>&1 && EXTRA_ARGS="-C link-args=-fuse-ld=gold" +rustc $EXTRA_ARGS "$@" diff --git a/python/servo/command_base.py b/python/servo/command_base.py index b712a1d87b3..15f3d28ef0a 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -302,6 +302,9 @@ class CommandBase(object): if hosts_file_path: 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') + return env def servo_crate(self): diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index fbeec5a6193..efa315158f8 100644 --- a/python/servo/post_build_commands.py +++ b/python/servo/post_build_commands.py @@ -156,10 +156,8 @@ class MachCommands(CommandBase): else: copy2(full_name, destination) - env = self.build_env() - env['RUSTDOC'] = '../../etc/rustdoc-with-private' return subprocess.call(["cargo", "doc"] + params, - env=env, cwd=self.servo_crate()) + env=self.build_env(), cwd=self.servo_crate()) @Command('browse-doc', description='Generate documentation and open it in a web browser',