On Tue, Oct 13, 2015 at 02:20:06PM +0300, Maxim Ostapenko wrote:
> This patch removes UBSan stubs from ASan and TSan code. We don't embed UBSan
> to ASan and UBSan because that would lead to undefined references to C++
> stuff when linking with -static-libasan. AFAIK, sanitizer developers use
> different libraries for C and CXX runtimes, but I think this is out of scope
> of this merge.
Where is CAN_SANITIZE_UB defined? I don't see it anywhere in the current
libsanitizer and in the patch only:
grep CAN_SANITIZE_UB libsanitizer-249633-2.diff
+#if CAN_SANITIZE_UB
+# define TSAN_CONTAINS_UBSAN (CAN_SANITIZE_UB && !defined(SANITIZER_GO))
+#if CAN_SANITIZE_UB
+#endif // CAN_SANITIZE_UB
+#if CAN_SANITIZE_UB
+#endif // CAN_SANITIZE_UB
+#if CAN_SANITIZE_UB
+#endif // CAN_SANITIZE_UB
+#if CAN_SANITIZE_UB
+#endif // CAN_SANITIZE_UB
+#if CAN_SANITIZE_UB
+#endif // CAN_SANITIZE_UB
+#if CAN_SANITIZE_UB
+#endif // CAN_SANITIZE_UB
+#if CAN_SANITIZE_UB
+#endif // CAN_SANITIZE_UB
So, unless I'm missing something, it would be best to arrange for
-DCAN_SANITIZE_UB=1 to be in CXXFLAGS for ubsan/ source files and
-DCAN_SANITIZE_UB=0 to be in CXXFLAGS for {a,t}san/ source files?
Are there any other defines that are supposedly set from cmake or wherever
upstream and are left undefined?
> 2015-10-13 Maxim Ostapenko <[email protected]>
>
> * tsan/tsan_defs.h: Define TSAN_CONTAINS_UBSAN to 0.
> * asan/asan_flags.cc (InitializeFlags): Do not initialize UBSan flags.
> * asan/asan_rtl.cc (AsanInitInternal): Do not init UBSan.
Jakub