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
| # -*- Python -*-
|
| import os
|
| # Setup config name.
| config.name = 'Scudo'
|
| # Setup source root.
| config.test_source_root = os.path.dirname(__file__)
|
| # Path to the static library
| base_lib = os.path.join(config.compiler_rt_libdir,
| "libclang_rt.scudo-%s.a" % config.target_arch)
| whole_archive = "-Wl,-whole-archive %s -Wl,-no-whole-archive " % base_lib
|
| # Test suffixes.
| config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.ll', '.test']
|
| # C flags.
| c_flags = ["-std=c++11",
| "-lstdc++",
| "-ldl",
| "-lrt",
| "-pthread",
| "-latomic",
| "-fPIE",
| "-pie",
| "-O0"]
|
| def build_invocation(compile_flags):
| return " " + " ".join([config.clang] + compile_flags) + " "
|
| # Add clang substitutions.
| config.substitutions.append( ("%clang_scudo ",
| build_invocation(c_flags) + whole_archive) )
|
| # Hardened Allocator tests are currently supported on Linux only.
| if config.host_os not in ['Linux']:
| config.unsupported = True
|
|