Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2084)

Unified Diff: build/toolchain/mac/linker_driver.py

Issue 2188473002: [Mac/GN] Configure ASan for bundled targets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/sanitizers/sanitizers.gni ('k') | chrome/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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),
« no previous file with comments | « build/config/sanitizers/sanitizers.gni ('k') | chrome/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698