-
Notifications
You must be signed in to change notification settings - Fork 4
/
trace-cc
executable file
·52 lines (42 loc) · 1.01 KB
/
trace-cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/python3
import sys
import os
import subprocess
if __name__ == "__main__":
args = sys.argv
env = os.environ
use64 = True
path = os.path.realpath(args[0])
path = os.path.dirname(path)
path = path+'/trace'
if not os.path.isfile(path+'/as'):
print('assembler not found')
print('path: '+path+'/as')
sys.exit(1)
if 'TRACE_CC' in env:
cc_bin = env['TRACE_CC']
else:
cc_bin = 'cc'
skip = False
cmd = list()
cmd.append(cc_bin)
for arg in args[1:]:
if arg == '-B':
skip = True
if arg == '-integrated-as':
pass
if arg == '-pipe':
pass
if arg == '-m32':
use64 = False
if not skip:
cmd.append(arg)
skip = False
# -B adds a directory to the compiler's $PATH
cmd.append('-B')
cmd.append(path)
cmd.append('-L')
cmd.append(path)
cmd.append('-legion')
code = subprocess.call(cmd)
sys.exit(code)