1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

gn build: Only build the hwasan runtime in aliasing mode on x86.

The LAM mode is currently untested by check-hwasan, so we only need
to build the runtime in aliasing mode. Because LAM mode will always
need to be conditional (because only certain hardware will support
it) we can always just disable the LAM lit tests if it ever starts
being tested.
This commit is contained in:
Peter Collingbourne 2021-05-17 11:44:06 -07:00
parent 76874c8e3b
commit 6ff12b1f0b

View File

@ -1,5 +1,11 @@
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" ]
@ -13,10 +19,10 @@ action("version_script") {
"--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",
@ -29,6 +35,9 @@ source_set("sources") {
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",
@ -76,7 +85,7 @@ source_set("cxx_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",
@ -88,7 +97,7 @@ static_library("hwasan") {
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",
@ -100,7 +109,7 @@ static_library("hwasan_cxx") {
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 = [