The Xcode 9.3 dsymutil dies with "IO Error" when handling objects larger than
2**32 bytes; the upstream llvm one seems not to have this problem.

Bug: 780980
Change-Id: I6846383329bd28a65516c0ef3ad177e1a78d08f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1500198
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#637756}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 99453a4326a2d09990877c4516a343028bf89f29
This commit is contained in:
Elly Fong-Jones 2019-03-05 18:59:21 +00:00 коммит произвёл Commit Bot
Родитель 153b7b94a1
Коммит 7b62c8979c
2 изменённых файлов: 33 добавлений и 1 удалений

Просмотреть файл

@ -186,6 +186,12 @@ template("mac_toolchain") {
# If dSYMs are enabled, this flag will be added to the link tools.
if (_enable_dsyms) {
dsym_switch = " -Wcrl,dsym,{{root_out_dir}} "
if (is_mac) {
dsym_switch += "-Wcrl,dsymutilpath," +
rebase_path("//tools/clang/dsymutil/bin/dsymutil",
root_build_dir) + " "
}
dsym_output_dir =
"{{root_out_dir}}/{{target_output_name}}{{output_extension}}.dSYM"
dsym_output = [

Просмотреть файл

@ -10,6 +10,8 @@ import shutil
import subprocess
import sys
DSYMUTIL_INVOKE = ['xcrun', 'dsymutil']
# The linker_driver.py is responsible for forwarding a linker invocation to
# the compiler driver, while processing special arguments itself.
#
@ -31,6 +33,10 @@ import sys
# "... -o out/gn/obj/foo/libbar.dylib ... -Wcrl,dsym,out/gn ..."
# The resulting dSYM would be out/gn/libbar.dylib.dSYM/.
#
# -Wcrl,dsymutilpath,<dsymutil_path>
# Sets the path to the dsymutil to run with -Wcrl,dsym, in which case
# `xcrun` is not used to invoke it.
#
# -Wcrl,unstripped,<unstripped_path_prefix>
# After invoking the linker, and before strip, this will save a copy of
# the unstripped linker output in the directory unstripped_path_prefix.
@ -142,10 +148,29 @@ def RunDsymUtil(dsym_path_prefix, full_args):
# Remove old dSYMs before invoking dsymutil.
_RemovePath(dsym_out)
subprocess.check_call(['xcrun', 'dsymutil', '-o', dsym_out, linker_out])
subprocess.check_call(DSYMUTIL_INVOKE + ['-o', dsym_out, linker_out])
return [dsym_out]
def SetDsymutilPath(dsymutil_path, full_args):
"""Linker driver action for -Wcrl,dsymutilpath,<dsymutil_path>.
Sets the invocation command for dsymutil, which allows the caller to specify
an alternate dsymutil. This action is always processed before the RunDsymUtil
action.
Args:
dsymutil_path: string, The path to the dsymutil binary to run
full_args: list of string, Full argument list for the linker driver.
Returns:
No output - this step is run purely for its side-effect.
"""
global DSYMUTIL_INVOKE
DSYMUTIL_INVOKE = [dsymutil_path]
return []
def RunSaveUnstripped(unstripped_path_prefix, full_args):
"""Linker driver action for -Wcrl,unstripped,<unstripped_path_prefix>. Copies
the linker output to |unstripped_path_prefix| before stripping.
@ -219,6 +244,7 @@ order in which the actions are invoked. The first item in the tuple is the
argument's -Wcrl,<sub_argument> and the second is the function to invoke.
"""
_LINKER_DRIVER_ACTIONS = [
('dsymutilpath,', SetDsymutilPath),
('dsym,', RunDsymUtil),
('unstripped,', RunSaveUnstripped),
('strip,', RunStrip),