Commit a4b4d828 authored by Tommy Martino's avatar Tommy Martino Committed by Commit Bot

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

This reverts commit 5e46febb.

Reason for revert: Speculative revert based on Mac Builder clang segfaults
Sample bad build: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8864006321936062752/+/steps/compile/0/stdout

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}

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

Change-Id: I128e1fd1d69c56374629202935e6a12614fdc03e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1147447
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2529609
Commit-Queue: Tommy Martino <tmartino@chromium.org>
Reviewed-by: default avatarTommy Martino <tmartino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825819}
parent 5dec0310
...@@ -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