| 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)
|
|
|