[MIPS GlobalISel] Select MSA vector generic and builtin add
[llvm-complete.git] / utils / gn / secondary / compiler-rt / lib / hwasan / BUILD.gn
blobc2a4817c3fac5a4409dbae8d946061da94231487
1 import("//compiler-rt/target.gni")
3 action("version_script") {
4   script = "//compiler-rt/lib/sanitizer_common/scripts/gen_dynamic_list.py"
5   sources = [
6     "hwasan.syms.extra",
7   ]
8   deps = [
9     ":hwasan",
10     ":hwasan_cxx",
11   ]
12   outputs = [
13     "$target_gen_dir/hwasan.vers",
14   ]
15   args = [
16     "--version-list",
17     "--extra",
18     rebase_path(sources[0], root_build_dir),
19     rebase_path(
20         "$crt_current_out_dir/libclang_rt.hwasan$crt_current_target_suffix.a",
21         root_build_dir),
22     rebase_path(
23         "$crt_current_out_dir/libclang_rt.hwasan_cxx$crt_current_target_suffix.a",
24         root_build_dir),
25     "--nm-executable",
26     "nm",
27     "-o",
28     rebase_path(outputs[0], root_build_dir),
29   ]
32 source_set("sources") {
33   configs -= [ "//llvm/utils/gn/build:llvm_code" ]
34   configs += [ "//llvm/utils/gn/build:crt_code" ]
35   defines = [ "HWASAN_WITH_INTERCEPTORS=1" ]
36   deps = [
37     "//compiler-rt/lib/interception:sources",
38     "//compiler-rt/lib/sanitizer_common:sources",
39     "//compiler-rt/lib/ubsan:sources",
40   ]
41   sources = [
42     "hwasan.cpp",
43     "hwasan.h",
44     "hwasan_allocator.cpp",
45     "hwasan_allocator.h",
46     "hwasan_dynamic_shadow.cpp",
47     "hwasan_dynamic_shadow.h",
48     "hwasan_exceptions.cpp",
49     "hwasan_flags.h",
50     "hwasan_interceptors.cpp",
51     "hwasan_interceptors_vfork.S",
52     "hwasan_interface_internal.h",
53     "hwasan_linux.cpp",
54     "hwasan_malloc_bisect.h",
55     "hwasan_mapping.h",
56     "hwasan_memintrinsics.cpp",
57     "hwasan_poisoning.cpp",
58     "hwasan_poisoning.h",
59     "hwasan_report.cpp",
60     "hwasan_report.h",
61     "hwasan_tag_mismatch_aarch64.S",
62     "hwasan_thread.cpp",
63     "hwasan_thread.h",
64     "hwasan_thread_list.cpp",
65     "hwasan_thread_list.h",
66   ]
69 source_set("cxx_sources") {
70   configs -= [ "//llvm/utils/gn/build:llvm_code" ]
71   configs += [ "//llvm/utils/gn/build:crt_code" ]
72   deps = [
73     "//compiler-rt/lib/ubsan:cxx_sources",
74   ]
75   sources = [
76     "hwasan_new_delete.cpp",
77   ]
80 static_library("hwasan") {
81   output_dir = crt_current_out_dir
82   output_name = "clang_rt.hwasan$crt_current_target_suffix"
83   complete_static_lib = true
84   configs -= [
85     "//llvm/utils/gn/build:llvm_code",
86     "//llvm/utils/gn/build:thin_archive",
87   ]
88   configs += [ "//llvm/utils/gn/build:crt_code" ]
89   deps = [
90     ":sources",
91   ]
94 static_library("hwasan_cxx") {
95   output_dir = crt_current_out_dir
96   output_name = "clang_rt.hwasan_cxx$crt_current_target_suffix"
97   complete_static_lib = true
98   configs -= [
99     "//llvm/utils/gn/build:llvm_code",
100     "//llvm/utils/gn/build:thin_archive",
101   ]
102   configs += [ "//llvm/utils/gn/build:crt_code" ]
103   deps = [
104     ":cxx_sources",
105   ]
108 shared_library("hwasan_shared") {
109   output_dir = crt_current_out_dir
110   output_name = "clang_rt.hwasan$crt_current_target_suffix"
111   configs -= [ "//llvm/utils/gn/build:llvm_code" ]
112   configs += [ "//llvm/utils/gn/build:crt_code" ]
113   deps = [
114     ":cxx_sources",
115     ":sources",
116     ":version_script",
117   ]
118   inputs = [
119     "$target_gen_dir/hwasan.vers",
120   ]
121   ldflags = [
122     "-Wl,--version-script," + rebase_path(inputs[0], root_build_dir),
123     "-Wl,-z,global",
124   ]