[compiler-rt] [llvm] [ubsan] Remove UBSAN_CAN_USE_CXXABI (PR #121082)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 24 20:09:45 PST 2024
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/121082
>From 4979f2fd952745643b1cc6fd71578b2cacd963bf Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Tue, 24 Dec 2024 20:04:57 -0800
Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?=
=?UTF-8?q?itial=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.4
---
compiler-rt/lib/ubsan/CMakeLists.txt | 3 ---
compiler-rt/lib/ubsan/ubsan_handlers.cpp | 13 ++-----------
.../gn/secondary/compiler-rt/lib/lsan/BUILD.gn | 2 --
.../gn/secondary/compiler-rt/lib/ubsan/BUILD.gn | 3 ---
4 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/compiler-rt/lib/ubsan/CMakeLists.txt b/compiler-rt/lib/ubsan/CMakeLists.txt
index 5d45a53d02dbd3..a6c98c40ec7720 100644
--- a/compiler-rt/lib/ubsan/CMakeLists.txt
+++ b/compiler-rt/lib/ubsan/CMakeLists.txt
@@ -43,18 +43,15 @@ include_directories(..)
set(UBSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
append_list_if(MSVC /Zl UBSAN_CFLAGS)
append_rtti_flag(OFF UBSAN_CFLAGS)
-append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CFLAGS)
# Too many existing bugs, needs cleanup.
append_list_if(COMPILER_RT_HAS_WNO_FORMAT -Wno-format UBSAN_CFLAGS)
set(UBSAN_STANDALONE_CFLAGS ${SANITIZER_COMMON_CFLAGS})
append_rtti_flag(OFF UBSAN_STANDALONE_CFLAGS)
-append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_STANDALONE_CFLAGS)
set(UBSAN_CXXFLAGS ${SANITIZER_COMMON_CFLAGS})
append_rtti_flag(ON UBSAN_CXXFLAGS)
-append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CXXFLAGS)
# Silence warnings in system headers with MSVC.
if(NOT CLANG_CL)
diff --git a/compiler-rt/lib/ubsan/ubsan_handlers.cpp b/compiler-rt/lib/ubsan/ubsan_handlers.cpp
index ac7001c74afb50..ace910444d82aa 100644
--- a/compiler-rt/lib/ubsan/ubsan_handlers.cpp
+++ b/compiler-rt/lib/ubsan/ubsan_handlers.cpp
@@ -899,10 +899,7 @@ static void handleCFIBadIcall(CFICheckFailData *Data, ValueHandle Function,
namespace __ubsan {
-#ifdef UBSAN_CAN_USE_CXXABI
-
#ifdef _WIN32
-
extern "C" void __ubsan_handle_cfi_bad_type_default(CFICheckFailData *Data,
ValueHandle Vtable,
bool ValidVtable,
@@ -911,18 +908,12 @@ extern "C" void __ubsan_handle_cfi_bad_type_default(CFICheckFailData *Data,
}
WIN_WEAK_ALIAS(__ubsan_handle_cfi_bad_type, __ubsan_handle_cfi_bad_type_default)
-#else
-SANITIZER_WEAK_ATTRIBUTE
#endif
+SANITIZER_WEAK_ATTRIBUTE
void __ubsan_handle_cfi_bad_type(CFICheckFailData *Data, ValueHandle Vtable,
- bool ValidVtable, ReportOptions Opts);
-
-#else
-void __ubsan_handle_cfi_bad_type(CFICheckFailData *Data, ValueHandle Vtable,
- bool ValidVtable, ReportOptions Opts) {
+ bool ValidVtable, ReportOptions Opts){
Die();
}
-#endif
} // namespace __ubsan
diff --git a/llvm/utils/gn/secondary/compiler-rt/lib/lsan/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/lsan/BUILD.gn
index 77b251030c671b..2ac06c4e6c75fa 100644
--- a/llvm/utils/gn/secondary/compiler-rt/lib/lsan/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/lib/lsan/BUILD.gn
@@ -1,7 +1,6 @@
source_set("common_sources") {
configs -= [ "//llvm/utils/gn/build:llvm_code" ]
configs += [ "//llvm/utils/gn/build:crt_code" ]
- defines = [ "UBSAN_CAN_USE_CXXABI" ]
deps = [
"//compiler-rt/lib/interception:sources",
"//compiler-rt/lib/sanitizer_common:sources",
@@ -18,7 +17,6 @@ source_set("common_sources") {
source_set("sources") {
configs -= [ "//llvm/utils/gn/build:llvm_code" ]
configs += [ "//llvm/utils/gn/build:crt_code" ]
- defines = [ "UBSAN_CAN_USE_CXXABI" ]
deps = [
"//compiler-rt/lib/interception:sources",
"//compiler-rt/lib/sanitizer_common:sources",
diff --git a/llvm/utils/gn/secondary/compiler-rt/lib/ubsan/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/ubsan/BUILD.gn
index d3b4a406f8b50d..c331193ca94c96 100644
--- a/llvm/utils/gn/secondary/compiler-rt/lib/ubsan/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/lib/ubsan/BUILD.gn
@@ -27,7 +27,6 @@ gen_version_script("version_script") {
source_set("sources") {
configs -= [ "//llvm/utils/gn/build:llvm_code" ]
configs += [ "//llvm/utils/gn/build:crt_code" ]
- defines = [ "UBSAN_CAN_USE_CXXABI" ]
deps = [
"//compiler-rt/lib/interception:sources",
"//compiler-rt/lib/sanitizer_common:sources",
@@ -65,7 +64,6 @@ source_set("standalone_sources") {
configs -= [ "//llvm/utils/gn/build:llvm_code" ]
configs -= [ "//llvm/utils/gn/build:no_rtti" ]
configs += [ "//llvm/utils/gn/build:crt_code" ]
- defines = [ "UBSAN_CAN_USE_CXXABI" ]
sources = [
"ubsan_diag_standalone.cpp",
"ubsan_init_standalone.cpp",
@@ -77,7 +75,6 @@ source_set("cxx_sources") {
configs -= [ "//llvm/utils/gn/build:llvm_code" ]
configs -= [ "//llvm/utils/gn/build:no_rtti" ]
configs += [ "//llvm/utils/gn/build:crt_code" ]
- defines = [ "UBSAN_CAN_USE_CXXABI" ]
sources = [
"ubsan_handlers_cxx.cpp",
"ubsan_handlers_cxx.h",
>From b1d0a75148e409516078dae7257c56468be0c996 Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Tue, 24 Dec 2024 20:09:35 -0800
Subject: [PATCH 2/2] format
Created using spr 1.3.4
---
compiler-rt/lib/ubsan/ubsan_handlers.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compiler-rt/lib/ubsan/ubsan_handlers.cpp b/compiler-rt/lib/ubsan/ubsan_handlers.cpp
index ace910444d82aa..ee9e3ccd0b1f61 100644
--- a/compiler-rt/lib/ubsan/ubsan_handlers.cpp
+++ b/compiler-rt/lib/ubsan/ubsan_handlers.cpp
@@ -911,7 +911,7 @@ WIN_WEAK_ALIAS(__ubsan_handle_cfi_bad_type, __ubsan_handle_cfi_bad_type_default)
#endif
SANITIZER_WEAK_ATTRIBUTE
void __ubsan_handle_cfi_bad_type(CFICheckFailData *Data, ValueHandle Vtable,
- bool ValidVtable, ReportOptions Opts){
+ bool ValidVtable, ReportOptions Opts) {
Die();
}
More information about the llvm-commits
mailing list