]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | # -*- Python -*- |
2 | ||
3 | import os | |
4 | ||
5 | # Setup config name. | |
5bcae85e | 6 | config.name = 'MemorySanitizer' + getattr(config, 'name_suffix', 'default') |
1a4d82fc JJ |
7 | |
8 | # Setup source root. | |
9 | config.test_source_root = os.path.dirname(__file__) | |
10 | ||
11 | # Setup default compiler flags used with -fsanitize=memory option. | |
5bcae85e SL |
12 | clang_msan_cflags = (["-fsanitize=memory", |
13 | "-mno-omit-leaf-frame-pointer", | |
14 | "-fno-omit-frame-pointer", | |
15 | "-fno-optimize-sibling-calls"] + | |
16 | [config.target_cflags] + | |
17 | config.debug_info_flags) | |
92a42be0 SL |
18 | # Some Msan tests leverage backtrace() which requires libexecinfo on FreeBSD. |
19 | if config.host_os == 'FreeBSD': | |
20 | clang_msan_cflags += ["-lexecinfo"] | |
1a4d82fc JJ |
21 | clang_msan_cxxflags = config.cxx_mode_flags + clang_msan_cflags |
22 | ||
23 | def build_invocation(compile_flags): | |
24 | return " " + " ".join([config.clang] + compile_flags) + " " | |
25 | ||
26 | config.substitutions.append( ("%clang_msan ", build_invocation(clang_msan_cflags)) ) | |
27 | config.substitutions.append( ("%clangxx_msan ", build_invocation(clang_msan_cxxflags)) ) | |
28 | ||
29 | # Default test suffixes. | |
30 | config.suffixes = ['.c', '.cc', '.cpp'] | |
31 | ||
2c00a5a8 | 32 | if config.host_os not in ['Linux', 'NetBSD']: |
1a4d82fc | 33 | config.unsupported = True |
5bcae85e | 34 | |
7cac9316 XL |
35 | # For mips64, mips64el we have forced store_context_size to 1 because these |
36 | # archs use slow unwinder which is not async signal safe. Therefore we only | |
37 | # check the first frame since store_context size is 1. | |
38 | if config.host_arch in ['mips64', 'mips64el']: | |
39 | config.substitutions.append( ('CHECK-%short-stack', 'CHECK-SHORT-STACK')) | |
40 | else: | |
41 | config.substitutions.append( ('CHECK-%short-stack', 'CHECK-FULL-STACK')) |