| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import argparse |
| 6 import os |
| 7 import shutil |
| 8 import subprocess |
| 9 import sys |
| 10 |
| 11 if __name__ == '__main__': |
| 12 parser = argparse.ArgumentParser( |
| 13 description='Copy the checked-in asan runtime and reset the rpath') |
| 14 parser.add_argument('input_path', nargs=1) |
| 15 parser.add_argument('output_path', nargs=1) |
| 16 args = parser.parse_args() |
| 17 |
| 18 input_file = args.input_path[0] |
| 19 output_file = args.output_path[0] |
| 20 basename = os.path.basename(input_file) |
| 21 if os.path.exists(output_file): |
| 22 os.unlink(output_file) |
| 23 shutil.copy(input_file, output_file) |
| 24 rv = subprocess.check_call([ |
| 25 'xcrun', |
| 26 'install_name_tool', |
| 27 '-add_rpath', |
| 28 '@rpath/' + basename, |
| 29 output_file]) |
| 30 if rv: |
| 31 os.unlink(output_file) |
| 32 sys.exit(rv) |
| OLD | NEW |