summaryrefslogtreecommitdiff
path: root/test/scudo/lit.cfg
blob: adf16f57bbbd848270b71be19eb9bd2f0f58d53f (plain)
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
# -*- Python -*-

import os

# Setup config name.
config.name = 'Scudo' + config.name_suffix

# 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']

# C flags.
c_flags = ([config.target_cflags] +
           ["-std=c++11",
           "-pthread",
           "-fPIE",
           "-pie",
           "-O0",
           "-UNDEBUG",
           "-ldl",
           "-lrt",
           "-Wl,--gc-sections"])

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