Index: build/toolchain/mac/BUILD.gn |
diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn |
index 82eacab28eba0fb0596b1ec649ae3dc20ee422c0..9a597f42d635f9fbd08ab9e4b42e57357d1301ed 100644 |
--- a/build/toolchain/mac/BUILD.gn |
+++ b/build/toolchain/mac/BUILD.gn |
@@ -138,7 +138,10 @@ template("mac_toolchain") { |
does_reexport_command = "[ ! -e \"$dylib\" -o ! -e \"$tocname\" ] || otool -l \"$dylib\" | grep -q LC_REEXPORT_DYLIB" |
- link_command = "$ld -shared " |
+ linker_driver = |
+ rebase_path("//build/toolchain/mac/linker_driver.py", root_build_dir) |
Dirk Pranke
2016/05/20 01:47:19
You should be able to hoist this up into a file-sc
Robert Sesek
2016/05/20 15:15:36
I tried doing it at the file-level but GN complain
Dirk Pranke
2016/05/20 16:43:55
Oh, yeah, usage doesn't propagate across templates
|
+ |
+ link_command = "$linker_driver $ld -shared " |
if (is_component_build) { |
link_command += " -Wl,-install_name,@rpath/\"{{target_output_name}}{{output_extension}}\" " |
} |
@@ -180,8 +183,10 @@ template("mac_toolchain") { |
sofile = "{{output_dir}}/{{target_output_name}}{{output_extension}}" # eg "./libfoo.so" |
rspfile = sofile + ".rsp" |
- link_command = |
- "$ld -bundle {{ldflags}} -o \"$sofile\" -Wl,-filelist,\"$rspfile\"" |
+ linker_driver = |
+ rebase_path("//build/toolchain/mac/linker_driver.py", root_build_dir) |
+ |
+ link_command = "$linker_driver $ld -bundle {{ldflags}} -o \"$sofile\" -Wl,-filelist,\"$rspfile\"" |
if (is_component_build) { |
link_command += " -Wl,-install_name,@rpath/{{target_output_name}}{{output_extension}}" |
} |
@@ -215,7 +220,10 @@ template("mac_toolchain") { |
# do for command-line arguments. Thus any source names with spaces, or |
# label names with spaces (which GN bases the output paths on) will be |
# corrupted by this process. Don't use spaces for source files or labels. |
- command = "$ld {{ldflags}} -o \"$outfile\" -Wl,-filelist,\"$rspfile\" {{solibs}} {{libs}}" |
+ linker_driver = |
+ rebase_path("//build/toolchain/mac/linker_driver.py", root_build_dir) |
+ |
+ command = "$linker_driver $ld {{ldflags}} -o \"$outfile\" -Wl,-filelist,\"$rspfile\" {{solibs}} {{libs}}" |
description = "LINK $outfile" |
rspfile_content = "{{inputs_newline}}" |
outputs = [ |