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

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

Issue 2160653002: [iOS/GN] Fix generation of .dSYM for fat binary builds. (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
Index: build/toolchain/mac/linker_driver.py
diff --git a/build/toolchain/mac/linker_driver.py b/build/toolchain/mac/linker_driver.py
index 50ba540c34b877ebd9f74e398013cd47ddf190cc..88f04e0423a58b72a269c1f5a4615e3fcc3dc824 100755
--- a/build/toolchain/mac/linker_driver.py
+++ b/build/toolchain/mac/linker_driver.py
@@ -158,7 +158,15 @@ def _FindLinkerOutput(full_args):
argument list. As this is a required linker argument, raises an error if it
cannot be found.
"""
- return full_args[full_args.index('-o') + 1]
+ # The linker_driver.py script may be used to wrap either the compiler linker
+ # (uses -o to configure the output) or lipo (uses -output to configure the
+ # output). Since wrapping the compiler linker is the most likely possibility
+ # use try/except and fallback to checking for -output if -o is not found.
+ try:
+ output_flag_index = full_args.index('-o')
+ except ValueError as _:
Robert Sesek 2016/07/18 20:09:43 Don't need an |as _| here if you're just catching
sdefresne 2016/07/19 09:12:13 Done.
+ output_flag_index = full_args.index('-output')
+ return full_args[output_flag_index + 1]
def _RemovePath(path):

Powered by Google App Engine
This is Rietveld 408576698