import("//compiler-rt/target.gni")
+if (current_cpu == "x64") {
+ hwasan_name = "hwasan_aliases"
+} else {
+ hwasan_name = "hwasan"
+}
+
action("version_script") {
script = "//compiler-rt/lib/sanitizer_common/scripts/gen_dynamic_list.py"
sources = [ "hwasan.syms.extra" ]
"--extra",
rebase_path(sources[0], root_build_dir),
rebase_path(
- "$crt_current_out_dir/libclang_rt.hwasan$crt_current_target_suffix.a",
+ "$crt_current_out_dir/libclang_rt.$hwasan_name$crt_current_target_suffix.a",
root_build_dir),
rebase_path(
- "$crt_current_out_dir/libclang_rt.hwasan_cxx$crt_current_target_suffix.a",
+ "$crt_current_out_dir/libclang_rt.${hwasan_name}_cxx$crt_current_target_suffix.a",
root_build_dir),
"--nm-executable",
"nm",
configs -= [ "//llvm/utils/gn/build:llvm_code" ]
configs += [ "//llvm/utils/gn/build:crt_code" ]
defines = [ "HWASAN_WITH_INTERCEPTORS=1" ]
+ if (current_cpu == "x64") {
+ defines += [ "HWASAN_ALIASING_MODE" ]
+ }
deps = [
"//compiler-rt/lib/interception:sources",
"//compiler-rt/lib/sanitizer_common:sources",
static_library("hwasan") {
output_dir = crt_current_out_dir
- output_name = "clang_rt.hwasan$crt_current_target_suffix"
+ output_name = "clang_rt.$hwasan_name$crt_current_target_suffix"
complete_static_lib = true
configs -= [
"//llvm/utils/gn/build:llvm_code",
static_library("hwasan_cxx") {
output_dir = crt_current_out_dir
- output_name = "clang_rt.hwasan_cxx$crt_current_target_suffix"
+ output_name = "clang_rt.${hwasan_name}_cxx$crt_current_target_suffix"
complete_static_lib = true
configs -= [
"//llvm/utils/gn/build:llvm_code",
shared_library("hwasan_shared") {
output_dir = crt_current_out_dir
- output_name = "clang_rt.hwasan$crt_current_target_suffix"
+ output_name = "clang_rt.$hwasan_name$crt_current_target_suffix"
configs -= [ "//llvm/utils/gn/build:llvm_code" ]
configs += [ "//llvm/utils/gn/build:crt_code" ]
deps = [