• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import("//compiler-rt/target.gni")
2
3scudo_cflags = [
4  "-Werror=conversion",
5  "-nostdinc++",
6]
7
8source_set("sources") {
9  configs -= [ "//llvm/utils/gn/build:llvm_code" ]
10  configs += [ "//llvm/utils/gn/build:crt_code" ]
11  cflags = scudo_cflags
12  sources = [
13    "allocator_config.h",
14    "atomic_helpers.h",
15    "bytemap.h",
16    "checksum.cpp",
17    "checksum.h",
18    "chunk.h",
19    "combined.h",
20    "common.cpp",
21    "crc32_hw.cpp",
22    "flags.cpp",
23    "flags.h",
24    "flags_parser.cpp",
25    "flags_parser.h",
26    "fuchsia.cpp",
27    "fuchsia.h",
28    "include/scudo/interface.h",
29    "internal_defs.h",
30    "linux.cpp",
31    "linux.h",
32    "list.h",
33    "local_cache.h",
34    "mutex.h",
35    "platform.h",
36    "primary32.h",
37    "primary64.h",
38    "quarantine.h",
39    "release.cpp",
40    "release.h",
41    "report.cpp",
42    "report.h",
43    "secondary.h",
44    "size_class_map.h",
45    "stats.h",
46    "string_utils.cpp",
47    "string_utils.h",
48    "tsd.h",
49    "tsd_exclusive.h",
50    "tsd_shared.h",
51    "vector.h",
52    "wrappers_c.h",
53    "wrappers_c_checks.h",
54  ]
55
56  if (current_cpu == "arm" || current_cpu == "arm64") {
57    cflags += [ "-mcrc" ]
58  }
59  if (current_cpu == "x64") {
60    cflags += [ "-msse4.2" ]
61  }
62
63  public_configs = [ ":scudo_config" ]
64}
65
66source_set("c_wrapper_sources") {
67  configs -= [ "//llvm/utils/gn/build:llvm_code" ]
68  configs += [ "//llvm/utils/gn/build:crt_code" ]
69  cflags = scudo_cflags
70  sources = [ "wrappers_c.cpp" ]
71
72  public_configs = [ ":scudo_config" ]
73}
74
75source_set("cxx_wrapper_sources") {
76  configs -= [ "//llvm/utils/gn/build:llvm_code" ]
77  configs += [ "//llvm/utils/gn/build:crt_code" ]
78  cflags = scudo_cflags
79  sources = [ "wrappers_cpp.cpp" ]
80
81  public_configs = [ ":scudo_config" ]
82}
83
84config("scudo_config") {
85  include_dirs = [
86    ".",
87    "include",
88  ]
89  if (current_os == "android") {
90    cflags = [ "-fno-emulated-tls" ]
91  }
92}
93