[compiler-rt] r258988 - [cfi] Disable vtable diagnostics when no cxxabi.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 13:15:11 PST 2016


Author: eugenis
Date: Wed Jan 27 15:15:10 2016
New Revision: 258988

URL: http://llvm.org/viewvc/llvm-project?rev=258988&view=rev
Log:
[cfi] Disable vtable diagnostics when no cxxabi.

This should fix the build on Mac 10.8 and earlier.

Modified:
    compiler-rt/trunk/lib/ubsan/CMakeLists.txt
    compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc
    compiler-rt/trunk/test/cfi/cross-dso/icall/diag.cpp

Modified: compiler-rt/trunk/lib/ubsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/CMakeLists.txt?rev=258988&r1=258987&r2=258988&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/ubsan/CMakeLists.txt Wed Jan 27 15:15:10 2016
@@ -23,9 +23,14 @@ include_directories(..)
 
 set(UBSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 append_no_rtti_flag(UBSAN_CFLAGS)
+append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CFLAGS)
+
 set(UBSAN_STANDALONE_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 append_no_rtti_flag(UBSAN_STANDALONE_CFLAGS)
+append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_STANDALONE_CFLAGS)
+
 set(UBSAN_CXXFLAGS ${SANITIZER_COMMON_CFLAGS})
+append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CXXFLAGS)
 
 add_custom_target(ubsan)
 

Modified: compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc?rev=258988&r1=258987&r2=258988&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc (original)
+++ compiler-rt/trunk/lib/ubsan/ubsan_handlers.cc Wed Jan 27 15:15:10 2016
@@ -548,9 +548,16 @@ static void handleCFIBadIcall(CFICheckFa
 }
 
 namespace __ubsan {
+#ifdef UBSAN_CAN_USE_CXXABI
 SANITIZER_WEAK_ATTRIBUTE
 void HandleCFIBadType(CFICheckFailData *Data, ValueHandle Vtable,
                       ReportOptions Opts);
+#else
+static void HandleCFIBadType(CFICheckFailData *Data, ValueHandle Vtable,
+                             ReportOptions Opts) {
+  Die();
+}
+#endif
 }  // namespace __ubsan
 
 void __ubsan::__ubsan_handle_cfi_check_fail(CFICheckFailData *Data,

Modified: compiler-rt/trunk/test/cfi/cross-dso/icall/diag.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/cfi/cross-dso/icall/diag.cpp?rev=258988&r1=258987&r2=258988&view=diff
==============================================================================
--- compiler-rt/trunk/test/cfi/cross-dso/icall/diag.cpp (original)
+++ compiler-rt/trunk/test/cfi/cross-dso/icall/diag.cpp Wed Jan 27 15:15:10 2016
@@ -70,6 +70,8 @@
 // RUN: %expect_crash %t __v 2>&1 | FileCheck %s --check-prefix=ICALL-NODIAG --check-prefix=CAST-NODIAG \
 // RUN:                                          --check-prefix=VCALL-NODIAG --check-prefix=VCALL-FATAL
 
+// REQUIRES: cxxabi
+
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>




More information about the llvm-commits mailing list