• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# -*- Python -*-
2
3import os
4
5# Setup config name.
6config.name = 'Scudo'
7
8# Setup source root.
9config.test_source_root = os.path.dirname(__file__)
10
11# Path to the static library
12base_lib = os.path.join(config.compiler_rt_libdir,
13                        "libclang_rt.scudo-%s.a" % config.target_arch)
14whole_archive = "-Wl,-whole-archive %s -Wl,-no-whole-archive " % base_lib
15
16# Test suffixes.
17config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.ll', '.test']
18
19# C flags.
20c_flags = ["-std=c++11",
21           "-lstdc++",
22           "-ldl",
23           "-lrt",
24           "-pthread",
25           "-latomic",
26           "-fPIE",
27           "-pie",
28           "-O0"]
29
30def build_invocation(compile_flags):
31  return " " + " ".join([config.clang] + compile_flags) + " "
32
33# Add clang substitutions.
34config.substitutions.append( ("%clang_scudo ",
35                              build_invocation(c_flags) + whole_archive) )
36
37# Hardened Allocator tests are currently supported on Linux only.
38if config.host_os not in ['Linux']:
39   config.unsupported = True
40