-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
executable file
·62 lines (41 loc) · 1.22 KB
/
run.py
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
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python3
import subprocess as sp
def run_compiler(compiler, inputs, output, args):
cmd = [
compiler,
*args,
"-std=c++14",
"-fPIC",
"-fvisibility=hidden",
"-fvisibility-inlines-hidden",
"-o",
output,
*inputs,
]
print("compiler:", ' '.join(cmd))
sp.run(cmd)
def run_nm(args):
cmd = [
"nm",
"-C",
*args,
]
print("symbols:", ' '.join(cmd))
sp.run(cmd)
if __name__ == "__main__":
parameters = [
("g++-9", "gcc-9", ["-g0", "-O0"]),
("g++-9", "gcc-9", ["-g0", "-O1"]),
("g++-10", "gcc-10", ["-g0", "-O0"]),
("g++-10", "gcc-10", ["-g0", "-O1"]),
("clang++-11", "clang-11", ["-g0", "-O0"]),
("clang++-11", "clang-11", ["-g0", "-O1"]),
("clang++-14", "clang-14", ["-g0", "-O0"]),
("clang++-14", "clang-14", ["-g0", "-O1"]),
]
for compiler, name, args in parameters:
print()
output = "dso.{}.so".format(name)
run_compiler(compiler, inputs=["dso.cpp", "detail.cpp"], output=output, args=["-shared", *args])
run_nm(args=["-D", output])
# vim: set et sw=4 sts=4: