Skip to content

Commit 1de228f

Browse files
authored
[ubsan] Remove UBSAN_CAN_USE_CXXABI (#121082)
It's should be enough to provide weak implementation. Fixes solaris and android linking after #121006.
1 parent d3846ec commit 1de228f

File tree

4 files changed

+1
-18
lines changed

4 files changed

+1
-18
lines changed

compiler-rt/lib/ubsan/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,15 @@ include_directories(..)
4343
set(UBSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
4444
append_list_if(MSVC /Zl UBSAN_CFLAGS)
4545
append_rtti_flag(OFF UBSAN_CFLAGS)
46-
append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CFLAGS)
4746

4847
# Too many existing bugs, needs cleanup.
4948
append_list_if(COMPILER_RT_HAS_WNO_FORMAT -Wno-format UBSAN_CFLAGS)
5049

5150
set(UBSAN_STANDALONE_CFLAGS ${SANITIZER_COMMON_CFLAGS})
5251
append_rtti_flag(OFF UBSAN_STANDALONE_CFLAGS)
53-
append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_STANDALONE_CFLAGS)
5452

5553
set(UBSAN_CXXFLAGS ${SANITIZER_COMMON_CFLAGS})
5654
append_rtti_flag(ON UBSAN_CXXFLAGS)
57-
append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CXXFLAGS)
5855

5956
# Silence warnings in system headers with MSVC.
6057
if(NOT CLANG_CL)

compiler-rt/lib/ubsan/ubsan_handlers.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -899,10 +899,7 @@ static void handleCFIBadIcall(CFICheckFailData *Data, ValueHandle Function,
899899

900900
namespace __ubsan {
901901

902-
#ifdef UBSAN_CAN_USE_CXXABI
903-
904902
#ifdef _WIN32
905-
906903
extern "C" void __ubsan_handle_cfi_bad_type_default(CFICheckFailData *Data,
907904
ValueHandle Vtable,
908905
bool ValidVtable,
@@ -911,18 +908,12 @@ extern "C" void __ubsan_handle_cfi_bad_type_default(CFICheckFailData *Data,
911908
}
912909

913910
WIN_WEAK_ALIAS(__ubsan_handle_cfi_bad_type, __ubsan_handle_cfi_bad_type_default)
914-
#else
915-
SANITIZER_WEAK_ATTRIBUTE
916911
#endif
917-
void __ubsan_handle_cfi_bad_type(CFICheckFailData *Data, ValueHandle Vtable,
918-
bool ValidVtable, ReportOptions Opts);
919-
920-
#else
912+
SANITIZER_WEAK_ATTRIBUTE
921913
void __ubsan_handle_cfi_bad_type(CFICheckFailData *Data, ValueHandle Vtable,
922914
bool ValidVtable, ReportOptions Opts) {
923915
Die();
924916
}
925-
#endif
926917

927918
} // namespace __ubsan
928919

llvm/utils/gn/secondary/compiler-rt/lib/lsan/BUILD.gn

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
source_set("common_sources") {
22
configs -= [ "//llvm/utils/gn/build:llvm_code" ]
33
configs += [ "//llvm/utils/gn/build:crt_code" ]
4-
defines = [ "UBSAN_CAN_USE_CXXABI" ]
54
deps = [
65
"//compiler-rt/lib/interception:sources",
76
"//compiler-rt/lib/sanitizer_common:sources",
@@ -18,7 +17,6 @@ source_set("common_sources") {
1817
source_set("sources") {
1918
configs -= [ "//llvm/utils/gn/build:llvm_code" ]
2019
configs += [ "//llvm/utils/gn/build:crt_code" ]
21-
defines = [ "UBSAN_CAN_USE_CXXABI" ]
2220
deps = [
2321
"//compiler-rt/lib/interception:sources",
2422
"//compiler-rt/lib/sanitizer_common:sources",

llvm/utils/gn/secondary/compiler-rt/lib/ubsan/BUILD.gn

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ gen_version_script("version_script") {
2727
source_set("sources") {
2828
configs -= [ "//llvm/utils/gn/build:llvm_code" ]
2929
configs += [ "//llvm/utils/gn/build:crt_code" ]
30-
defines = [ "UBSAN_CAN_USE_CXXABI" ]
3130
deps = [
3231
"//compiler-rt/lib/interception:sources",
3332
"//compiler-rt/lib/sanitizer_common:sources",
@@ -65,7 +64,6 @@ source_set("standalone_sources") {
6564
configs -= [ "//llvm/utils/gn/build:llvm_code" ]
6665
configs -= [ "//llvm/utils/gn/build:no_rtti" ]
6766
configs += [ "//llvm/utils/gn/build:crt_code" ]
68-
defines = [ "UBSAN_CAN_USE_CXXABI" ]
6967
sources = [
7068
"ubsan_diag_standalone.cpp",
7169
"ubsan_init_standalone.cpp",
@@ -77,7 +75,6 @@ source_set("cxx_sources") {
7775
configs -= [ "//llvm/utils/gn/build:llvm_code" ]
7876
configs -= [ "//llvm/utils/gn/build:no_rtti" ]
7977
configs += [ "//llvm/utils/gn/build:crt_code" ]
80-
defines = [ "UBSAN_CAN_USE_CXXABI" ]
8178
sources = [
8279
"ubsan_handlers_cxx.cpp",
8380
"ubsan_handlers_cxx.h",

0 commit comments

Comments
 (0)