6 config
.name
= 'Scudo' + config
.name_suffix
9 config
.test_source_root
= os
.path
.dirname(__file__
)
11 # Path to the shared library
12 shared_libscudo
= os
.path
.join(config
.compiler_rt_libdir
, "libclang_rt.scudo%s.so" % config
.target_suffix
)
13 shared_minlibscudo
= os
.path
.join(config
.compiler_rt_libdir
, "libclang_rt.scudo_minimal%s.so" % config
.target_suffix
)
16 config
.suffixes
= ['.c', '.cpp', '.test']
19 c_flags
= ([config
.target_cflags
] +
28 # Android doesn't want -lrt.
29 if not config
.android
:
32 cxx_flags
= (c_flags
+ config
.cxx_mode_flags
+ ["-std=c++11"])
34 scudo_flags
= ["-fsanitize=scudo"]
36 def build_invocation(compile_flags
):
37 return " " + " ".join([config
.clang
] + compile_flags
) + " "
40 config
.substitutions
.append(("%clang ", build_invocation(c_flags
)))
41 config
.substitutions
.append(("%clang_scudo ", build_invocation(c_flags
+ scudo_flags
)))
42 config
.substitutions
.append(("%clangxx_scudo ", build_invocation(cxx_flags
+ scudo_flags
)))
43 config
.substitutions
.append(("%shared_libscudo", shared_libscudo
))
44 config
.substitutions
.append(("%shared_minlibscudo", shared_minlibscudo
))
46 # Platform-specific default SCUDO_OPTIONS for lit tests.
47 default_scudo_opts
= ''
49 # Android defaults to abort_on_error=1, which doesn't work for us.
50 default_scudo_opts
= 'abort_on_error=0'
52 # Disable GWP-ASan for scudo internal tests.
54 config
.environment
['GWP_ASAN_OPTIONS'] = 'Enabled=0'
56 if default_scudo_opts
:
57 config
.environment
['SCUDO_OPTIONS'] = default_scudo_opts
58 default_scudo_opts
+= ':'
59 config
.substitutions
.append(('%env_scudo_opts=',
60 'env SCUDO_OPTIONS=' + default_scudo_opts
))
62 # Hardened Allocator tests are currently supported on Linux only.
63 if config
.host_os
not in ['Linux']:
64 config
.unsupported
= True