xref: /llvm-project/llvm/utils/gn/secondary/compiler-rt/lib/msan/BUILD.gn (revision 9095d5c44bf7c36ddc48edb65c6d3a7b4ea8692f)
1import("//compiler-rt/target.gni")
2
3static_library("msan") {
4  configs -= [ "//llvm/utils/gn/build:llvm_code" ]
5  configs += [ "//llvm/utils/gn/build:crt_code" ]
6
7  output_dir = crt_current_out_dir
8  assert(current_os == "linux", "MSan only works on Linux")
9  output_name = "clang_rt.msan$crt_current_target_suffix"
10
11  deps = [
12    "//compiler-rt/lib/interception:sources",
13    "//compiler-rt/lib/sanitizer_common:sources",
14    "//compiler-rt/lib/ubsan:sources",
15  ]
16
17  complete_static_lib = true
18  configs -= [ "//llvm/utils/gn/build:thin_archive" ]
19  deps += [ ":msan_cxx" ]
20
21  sources = [
22    "msan.cpp",
23    "msan.h",
24    "msan_allocator.cpp",
25    "msan_allocator.h",
26    "msan_chained_origin_depot.cpp",
27    "msan_chained_origin_depot.h",
28    "msan_dl.cpp",
29    "msan_dl.h",
30    "msan_flags.h",
31    "msan_flags.inc",
32    "msan_interceptors.cpp",
33    "msan_interface_internal.h",
34    "msan_linux.cpp",
35    "msan_origin.h",
36    "msan_poisoning.cpp",
37    "msan_poisoning.h",
38    "msan_report.cpp",
39    "msan_report.h",
40    "msan_thread.cpp",
41    "msan_thread.h",
42  ]
43
44  cflags = [ "-fPIE" ]
45
46  # Prevent clang from generating libc calls.
47  cflags += [ "-ffreestanding" ]
48
49  # FIXME: link rt dl m pthread log
50  # FIXME: need libclang_rt.msan*.a.syms?
51  # FIXME: msan_ignorelist.txt
52}
53
54static_library("msan_cxx") {
55  configs -= [ "//llvm/utils/gn/build:llvm_code" ]
56  configs += [ "//llvm/utils/gn/build:crt_code" ]
57
58  output_dir = crt_current_out_dir
59  assert(current_os == "linux", "MSan only works on Linux")
60  output_name = "clang_rt.msan_cxx$crt_current_target_suffix"
61
62  complete_static_lib = true
63  configs -= [ "//llvm/utils/gn/build:thin_archive" ]
64
65  deps = [ "//compiler-rt/lib/ubsan:cxx_sources" ]
66
67  sources = [ "msan_new_delete.cpp" ]
68}
69