diff options
author | Tulio Magno Quites Machado Filho <tuliom@redhat.com> | 2024-06-21 20:57:24 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-21 20:57:24 -0300 |
commit | b515d9ea1e4365f156dad06a91e7b0f18b1b67c7 (patch) | |
tree | 6ec5714093e38b7e924b74040a59063f2998dc83 | |
parent | 7d2c2af0453c28d0902668523099a1f46a0bc348 (diff) | |
download | llvm-b515d9ea1e4365f156dad06a91e7b0f18b1b67c7.zip llvm-b515d9ea1e4365f156dad06a91e7b0f18b1b67c7.tar.gz llvm-b515d9ea1e4365f156dad06a91e7b0f18b1b67c7.tar.bz2 |
[hwasan][aarch64] Fix missing DT_AARCH64_BTI_PLT flag (#95796)
When building hwasan on aarch64, the DT_AARCH64_BTI_PLT flag is missing
from libclang_rt.hwasan.so because some object files without
DT_AARCH64_BTI_PLT are linked in the final DSO.
These files are specific to riscv64 and x86_64, ending up with no
aarch64 code in them.
Avoid building and linking architecture-specific files unless the
architecture is listed in HWASAN_SUPPORTED_ARCH.
-rw-r--r-- | compiler-rt/lib/hwasan/CMakeLists.txt | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/compiler-rt/lib/hwasan/CMakeLists.txt b/compiler-rt/lib/hwasan/CMakeLists.txt index 6f75baa..086079c 100644 --- a/compiler-rt/lib/hwasan/CMakeLists.txt +++ b/compiler-rt/lib/hwasan/CMakeLists.txt @@ -15,16 +15,28 @@ set(HWASAN_RTL_SOURCES hwasan_memintrinsics.cpp hwasan_poisoning.cpp hwasan_report.cpp - hwasan_setjmp_aarch64.S - hwasan_setjmp_riscv64.S - hwasan_setjmp_x86_64.S - hwasan_tag_mismatch_aarch64.S - hwasan_tag_mismatch_riscv64.S hwasan_thread.cpp hwasan_thread_list.cpp hwasan_type_test.cpp ) +foreach(arch ${HWASAN_SUPPORTED_ARCH}) + if(${arch} MATCHES "aarch64") + list(APPEND HWASAN_RTL_SOURCES + hwasan_setjmp_aarch64.S + hwasan_tag_mismatch_aarch64.S) + endif() + if(${arch} MATCHES "riscv64") + list(APPEND HWASAN_RTL_SOURCES + hwasan_setjmp_riscv64.S + hwasan_tag_mismatch_riscv64.S) + endif() + if(${arch} MATCHES "x86_64") + list(APPEND HWASAN_RTL_SOURCES + hwasan_setjmp_x86_64.S) + endif() +endforeach() + set(HWASAN_RTL_CXX_SOURCES hwasan_new_delete.cpp ) |