Commit 2923377e authored by Nico Weber's avatar Nico Weber

mac/ios: Use real response files instead of -filelist when calling libtool

This is a reland of 3aed6673
The change seems to make ld64 segfault sometimes. It's not clear why,
but I'm guessing it's related to how we passed the filelist to ld64
previously, but now we hand the rspfile to clang which reads it and
then re-writes it as rspfile internally. This reland only relands the
bit for "alink", which calls libtool directly and doesn't involve either
clang nor ld64. This part is hopefully safe to land.

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}

Bug: 1147968
Change-Id: I0d077355924569ef537da7e66c4d346ec5fc6eea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533546
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826901}
parent 40e2e9ee
......@@ -266,20 +266,12 @@ template("mac_toolchain") {
script =
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_content = "{{inputs_newline}}"
rspfile_content = "{{inputs}}"
# Specify explicit path for libtool.
libtool = mac_bin_path + "libtool"
command = "rm -f {{output}} && TOOL_VERSION=${tool_versions.filter_libtool} python $script $libtool -static -D {{arflags}} -o {{output}} -filelist $rspfile"
command = "rm -f {{output}} && TOOL_VERSION=${tool_versions.filter_libtool} python $script $libtool -static -D {{arflags}} -o {{output}} \"@$rspfile\""
description = "LIBTOOL-STATIC {{output}}"
outputs = [ "{{output_dir}}/{{target_output_name}}{{output_extension}}" ]
default_output_dir = "{{target_out_dir}}"
......
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