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

Unified Diff: build/config/sanitizers/copy_asan_runtime_mac.py

Issue 2180653002: Attempt to fix Mac ASAN build in GN. (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/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/sanitizers/copy_asan_runtime_mac.py
diff --git a/build/config/sanitizers/copy_asan_runtime_mac.py b/build/config/sanitizers/copy_asan_runtime_mac.py
new file mode 100644
index 0000000000000000000000000000000000000000..a97c4da7b1e62328c12d34b1f99418166067783c
--- /dev/null
+++ b/build/config/sanitizers/copy_asan_runtime_mac.py
@@ -0,0 +1,32 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import argparse
+import os
+import shutil
+import subprocess
+import sys
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(
+ description='Copy the checked-in asan runtime and reset the rpath')
+ parser.add_argument('input_path', nargs=1)
+ parser.add_argument('output_path', nargs=1)
+ args = parser.parse_args()
+
+ input_file = args.input_path[0]
+ output_file = args.output_path[0]
+ basename = os.path.basename(input_file)
+ if os.path.exists(output_file):
+ os.unlink(output_file)
+ shutil.copy(input_file, output_file)
+ rv = subprocess.check_call([
+ 'xcrun',
+ 'install_name_tool',
+ '-add_rpath',
+ '@rpath/' + basename,
+ output_file])
+ if rv:
+ os.unlink(output_file)
+ sys.exit(rv)
« no previous file with comments | « build/config/sanitizers/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698