Commit 0a289a6f authored by Shinya Kawanaka's avatar Shinya Kawanaka Committed by Commit Bot

Use -filelist for libtool

"Mac Builder Goma Canary" builder is failing with "Argument list
too long". The length of command line exceeds 220K, so it's
actually long.

Though libtool on Mac does not support @rsp file, it supports
-filelist. So we can pass a file list via a file.
-filelist takes a file list separated by a new line, so we can
abuse rspfile for this purpose.

"solink", "solink_module", and "link" are doing the same thing,
so I believe this is acceptable.

Bug: 820900
Change-Id: I583d320ac96f959b1a7c3d878a882d17f63cb566
Reviewed-on: https://chromium-review.googlesource.com/964033
Commit-Queue: Shinya Kawanaka <shinyak@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543965}
parent 16a40874
...@@ -236,7 +236,18 @@ template("mac_toolchain") { ...@@ -236,7 +236,18 @@ template("mac_toolchain") {
tool("alink") { tool("alink") {
script = script =
rebase_path("//build/toolchain/mac/filter_libtool.py", root_build_dir) rebase_path("//build/toolchain/mac/filter_libtool.py", root_build_dir)
command = "$env_wrapper rm -f {{output}} && TOOL_VERSION=${tool_versions.filter_libtool} python $script libtool -static {{arflags}} -o {{output}} {{inputs}}"
# Note about -filelist: Apple's linker reads the file list file and
# interprets each newline-separated chunk of text as a file name. It
# doesn't do the things one would expect from the shell like unescaping
# or handling quotes. In contrast, when Ninja finds a file name with
# spaces, it single-quotes them in $inputs_newline as it would normally
# 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.
rspfile = "{{output}}.rsp"
rspfile_content = "{{inputs_newline}}"
command = "$env_wrapper rm -f {{output}} && TOOL_VERSION=${tool_versions.filter_libtool} python $script libtool -static {{arflags}} -o {{output}} -filelist $rspfile"
description = "LIBTOOL-STATIC {{output}}" description = "LIBTOOL-STATIC {{output}}"
outputs = [ outputs = [
"{{output_dir}}/{{target_output_name}}{{output_extension}}", "{{output_dir}}/{{target_output_name}}{{output_extension}}",
...@@ -350,7 +361,7 @@ template("mac_toolchain") { ...@@ -350,7 +361,7 @@ template("mac_toolchain") {
rspfile = "$outfile.rsp" rspfile = "$outfile.rsp"
pool = "//build/toolchain:link_pool($default_toolchain)" pool = "//build/toolchain:link_pool($default_toolchain)"
# Note about --filelist: Apple's linker reads the file list file and # Note about -filelist: Apple's linker reads the file list file and
# interprets each newline-separated chunk of text as a file name. It # interprets each newline-separated chunk of text as a file name. It
# doesn't do the things one would expect from the shell like unescaping # doesn't do the things one would expect from the shell like unescaping
# or handling quotes. In contrast, when Ninja finds a file name with # or handling quotes. In contrast, when Ninja finds a file name with
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment