Commit 784b03de authored by James MacLean's avatar James MacLean Committed by Commit Bot

Revert "Reland "mac/ios: Use real response files instead of -filelist.""

This reverts commit 3aed6673.

Reason for revert: suspected in build failures on ios-simulator, ios-simulator-noncq

E.g. https://ci.chromium.org/p/chromium/builders/ci/ios-simulator/59564 and https://ci.chromium.org/p/chromium/builders/ci/ios-simulator-noncq/13473

Original change's description:
> Reland "mac/ios: Use real response files instead of -filelist."
>
> This is a reland of 5e46febb
>
> Original change's description:
> > mac/ios: Use real response files instead of -filelist.
> >
> > Xcode 12 added support for real response files, so let's use them.
> > Allows making response file contents more like on other systems
> > (libs, solibs, frameworks, swiftmodules now go in the rsp file too),
> > and makes it theoretically possible to have object files with spaces
> > in their name.
> >
> > No intentional behavior change.
> >
> > Bug: none
> > Change-Id: I8c2d6ff1abd47261bf7674dc7bf4506814681ad4
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527621
> > Auto-Submit: Nico Weber <thakis@chromium.org>
> > Commit-Queue: Brett Wilson <brettw@chromium.org>
> > Reviewed-by: Brett Wilson <brettw@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#825480}
>
> Bug: none
> Change-Id: Ib355508d2d45ab3ddf9ece76b6e95106c784fde9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2530350
> Auto-Submit: Nico Weber <thakis@chromium.org>
> Reviewed-by: Tommy Martino <tmartino@chromium.org>
> Reviewed-by: Mark Mentovai <mark@chromium.org>
> Commit-Queue: Nico Weber <thakis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#826282}

TBR=thakis@chromium.org,tmartino@chromium.org,mark@chromium.org

Change-Id: Ie98fc38610c34711ce14d4e76582c78d4e3280bb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533176Reviewed-by: default avatarJames MacLean <wjmaclean@chromium.org>
Commit-Queue: James MacLean <wjmaclean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826353}
parent 7b7811dc
...@@ -266,12 +266,20 @@ template("mac_toolchain") { ...@@ -266,12 +266,20 @@ template("mac_toolchain") {
script = script =
rebase_path("//build/toolchain/mac/filter_libtool.py", root_build_dir) rebase_path("//build/toolchain/mac/filter_libtool.py", root_build_dir)
# 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 = "{{output}}.rsp"
rspfile_content = "{{inputs}}" rspfile_content = "{{inputs_newline}}"
# Specify explicit path for libtool. # Specify explicit path for libtool.
libtool = mac_bin_path + "libtool" libtool = mac_bin_path + "libtool"
command = "rm -f {{output}} && TOOL_VERSION=${tool_versions.filter_libtool} python $script $libtool -static -D {{arflags}} -o {{output}} \"@$rspfile\"" command = "rm -f {{output}} && TOOL_VERSION=${tool_versions.filter_libtool} python $script $libtool -static -D {{arflags}} -o {{output}} -filelist $rspfile"
description = "LIBTOOL-STATIC {{output}}" description = "LIBTOOL-STATIC {{output}}"
outputs = [ "{{output_dir}}/{{target_output_name}}{{output_extension}}" ] outputs = [ "{{output_dir}}/{{target_output_name}}{{output_extension}}" ]
default_output_dir = "{{target_out_dir}}" default_output_dir = "{{target_out_dir}}"
...@@ -310,15 +318,14 @@ template("mac_toolchain") { ...@@ -310,15 +318,14 @@ template("mac_toolchain") {
link_command += " -Wl,-install_name,@rpath/\"{{target_output_name}}{{output_extension}}\" " link_command += " -Wl,-install_name,@rpath/\"{{target_output_name}}{{output_extension}}\" "
} }
link_command += dsym_switch link_command += dsym_switch
link_command += "{{ldflags}} -o \"$dylib\" @\"$rspfile\"" link_command += "{{ldflags}} -o \"$dylib\" -Wl,-filelist,\"$rspfile\" {{frameworks}} {{swiftmodules}} {{solibs}} {{libs}}"
replace_command = "if ! cmp -s \"$temporary_tocname\" \"$tocname\"; then mv \"$temporary_tocname\" \"$tocname\"" replace_command = "if ! cmp -s \"$temporary_tocname\" \"$tocname\"; then mv \"$temporary_tocname\" \"$tocname\""
extract_toc_command = "{ $otool -l \"$dylib\" | grep LC_ID_DYLIB -A 5; $nm -gPp \"$dylib\" | cut -f1-2 -d' ' | grep -v U\$\$; true; }" extract_toc_command = "{ $otool -l \"$dylib\" | grep LC_ID_DYLIB -A 5; $nm -gPp \"$dylib\" | cut -f1-2 -d' ' | grep -v U\$\$; true; }"
command = "if $does_reexport_command ; then $link_command && $extract_toc_command > \"$tocname\"; else $link_command && $extract_toc_command > \"$temporary_tocname\" && $replace_command ; fi; fi" command = "if $does_reexport_command ; then $link_command && $extract_toc_command > \"$tocname\"; else $link_command && $extract_toc_command > \"$temporary_tocname\" && $replace_command ; fi; fi"
rspfile_content = rspfile_content = "{{inputs_newline}}"
"{{inputs}} {{frameworks}} {{swiftmodules}} {{solibs}} {{libs}}"
description = "SOLINK {{output}}" description = "SOLINK {{output}}"
...@@ -358,16 +365,15 @@ template("mac_toolchain") { ...@@ -358,16 +365,15 @@ template("mac_toolchain") {
rspfile = sofile + ".rsp" rspfile = sofile + ".rsp"
pool = "//build/toolchain:link_pool($default_toolchain)" pool = "//build/toolchain:link_pool($default_toolchain)"
link_command = link_command = "$linker_driver $ld -bundle {{ldflags}} -o \"$sofile\" -Wl,-filelist,\"$rspfile\""
"$linker_driver $ld -bundle {{ldflags}} -o \"$sofile\" @\"$rspfile\""
if (is_component_build) { if (is_component_build) {
link_command += " -Wl,-install_name,@rpath/{{target_output_name}}{{output_extension}}" link_command += " -Wl,-install_name,@rpath/{{target_output_name}}{{output_extension}}"
} }
link_command += dsym_switch link_command += dsym_switch
link_command += " {{frameworks}} {{swiftmodules}} {{solibs}} {{libs}}"
command = link_command command = link_command
rspfile_content = rspfile_content = "{{inputs_newline}}"
"{{inputs}} {{frameworks}} {{swiftmodules}} {{solibs}} {{libs}}"
description = "SOLINK_MODULE {{output}}" description = "SOLINK_MODULE {{output}}"
...@@ -392,10 +398,17 @@ template("mac_toolchain") { ...@@ -392,10 +398,17 @@ template("mac_toolchain") {
rspfile = "$outfile.rsp" rspfile = "$outfile.rsp"
pool = "//build/toolchain:link_pool($default_toolchain)" pool = "//build/toolchain:link_pool($default_toolchain)"
command = "$linker_driver $ld $dsym_switch {{ldflags}} -o \"$outfile\" @\"$rspfile\"" # 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.
command = "$linker_driver $ld $dsym_switch {{ldflags}} -o \"$outfile\" -Wl,-filelist,\"$rspfile\" {{frameworks}} {{swiftmodules}} {{solibs}} {{libs}}"
description = "LINK $outfile" description = "LINK $outfile"
rspfile_content = rspfile_content = "{{inputs_newline}}"
"{{inputs}} {{frameworks}} {{swiftmodules}} {{solibs}} {{libs}}"
outputs = [ outfile ] outputs = [ outfile ]
if (_enable_dsyms) { if (_enable_dsyms) {
......
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