[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / compiler-rt / test / sanitizer_common / android_commands / android_compile.py
blobe9c6738a09a3fdf90e84bd63fae14c7b65fba9f9
1 #!/usr/bin/env python
3 import os, sys, subprocess
4 from android_common import *
7 here = os.path.abspath(os.path.dirname(sys.argv[0]))
8 android_run = os.path.join(here, "android_run.py")
10 output = None
11 output_type = "executable"
13 args = sys.argv[1:]
14 while args:
15 arg = args.pop(0)
16 if arg == "-shared":
17 output_type = "shared"
18 elif arg == "-c":
19 output_type = "object"
20 elif arg == "-o":
21 output = args.pop(0)
23 if output is None:
24 print("No output file name!")
25 sys.exit(1)
27 ret = subprocess.call(sys.argv[1:])
28 if ret != 0:
29 sys.exit(ret)
31 if output_type in ["executable", "shared"]:
32 push_to_device(output)
34 if output_type == "executable":
35 os.rename(output, output + ".real")
36 os.symlink(android_run, output)