| Index: build/toolchain/mac/linker_driver.py
|
| diff --git a/build/toolchain/mac/linker_driver.py b/build/toolchain/mac/linker_driver.py
|
| index 40676f6427dfb882840d2b9418ba21143633b5d5..223b352ed8ee888fcfd91b433be7783462644660 100755
|
| --- a/build/toolchain/mac/linker_driver.py
|
| +++ b/build/toolchain/mac/linker_driver.py
|
| @@ -24,6 +24,11 @@ import sys
|
| # removal of the special driver arguments, described below). Then the driver
|
| # performs additional actions, based on these arguments:
|
| #
|
| +# -Wcrl,installname,<old_intall_name>,<new_install_name>
|
| +# After invoking the linker, this will run `install_name_tool` on the
|
| +# linker's output. It will use the -change option to change a dylib's
|
| +# install name from old to new.
|
| +#
|
| # -Wcrl,dsym,<dsym_path_prefix>
|
| # After invoking the linker, this will run `dsymutil` on the linker's
|
| # output, producing a dSYM bundle, stored at dsym_path_prefix. As an
|
| @@ -114,6 +119,28 @@ def ProcessLinkerDriverArg(arg):
|
| raise ValueError('Unknown linker driver argument: %s' % (arg,))
|
|
|
|
|
| +def RunInstallNameTool(old_comma_new, full_args):
|
| + """Linker driver action for -Wcrl,installname,<old>,<new>. Invokes
|
| + `install_name_tool -change <old> <new>` on the linker's output.
|
| +
|
| + Args:
|
| + old_comma_new: string, The comma-separated old and new install names to
|
| + change.
|
| + full_args: list of string, Full argument list for the linker driver.
|
| +
|
| + Returns:
|
| + list of string, Build step outputs.
|
| + """
|
| + (old, new) = old_comma_new.split(',')
|
| + if not len(old) or not len(new):
|
| + raise ValueError('Unspecified old and new paths')
|
| +
|
| + linker_out = _FindLinkerOutput(full_args)
|
| + subprocess.check_call(
|
| + ['xcrun', 'install_name_tool', '-change', old, new, linker_out])
|
| + return []
|
| +
|
| +
|
| def RunDsymUtil(dsym_path_prefix, full_args):
|
| """Linker driver action for -Wcrl,dsym,<dsym-path-prefix>. Invokes dsymutil
|
| on the linker's output and produces a dsym file at |dsym_file| path.
|
| @@ -212,6 +239,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 = [
|
| + ('installname,', RunInstallNameTool),
|
| ('dsym,', RunDsymUtil),
|
| ('unstripped,', RunSaveUnstripped),
|
| ('strip,', RunStrip),
|
|
|