--- lib/asan/asan_interceptors.h.orig 2016-04-21 08:45:23.000000000 +1000 +++ lib/asan/asan_interceptors.h 2020-05-26 10:05:58.097437000 +1000 @@ -34,7 +34,7 @@ # define ASAN_INTERCEPT_FORK 0 #endif -#if SANITIZER_FREEBSD || SANITIZER_LINUX +#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_BSDSUNIX # define ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX 1 #else # define ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX 0 --- lib/asan/asan_linux.cc.orig 2016-07-12 07:40:59.000000000 +1000 +++ lib/asan/asan_linux.cc 2020-05-26 10:08:35.232484000 +1000 @@ -13,13 +13,14 @@ //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" -#if SANITIZER_FREEBSD || SANITIZER_LINUX +#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_BSDSUNIX #include "asan_interceptors.h" #include "asan_internal.h" #include "asan_thread.h" #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_freebsd.h" +#include "sanitizer_common/sanitizer_bsdsunix.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_procmaps.h" @@ -35,11 +36,11 @@ #include #include -#if SANITIZER_FREEBSD +#if SANITIZER_FREEBSD || SANITIZER_BSDSUNIX #include #endif -#if SANITIZER_ANDROID || SANITIZER_FREEBSD +#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_BSDSUNIX #include extern "C" void* _DYNAMIC; #else @@ -173,4 +174,4 @@ } // namespace __asan -#endif // SANITIZER_FREEBSD || SANITIZER_LINUX +#endif // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_BSDSUNIX --- lib/asan/asan_malloc_linux.cc.orig 2017-02-03 05:28:41.000000000 +1100 +++ lib/asan/asan_malloc_linux.cc 2020-05-26 10:10:13.000534000 +1000 @@ -15,7 +15,7 @@ //===----------------------------------------------------------------------===// #include "sanitizer_common/sanitizer_platform.h" -#if SANITIZER_FREEBSD || SANITIZER_LINUX +#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_BSDSUNIX #include "sanitizer_common/sanitizer_tls_get_addr.h" #include "asan_allocator.h" @@ -220,4 +220,4 @@ } // namespace __asan #endif // SANITIZER_ANDROID -#endif // SANITIZER_FREEBSD || SANITIZER_LINUX +#endif // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_BSDSUNIX --- lib/asan/asan_mapping.h.orig 2016-10-06 07:33:59.000000000 +1100 +++ lib/asan/asan_mapping.h 2020-05-26 10:12:59.871411000 +1000 @@ -138,6 +138,8 @@ static const u64 kMIPS64_ShadowOffset64 = 1ULL << 37; static const u64 kPPC64_ShadowOffset64 = 1ULL << 41; static const u64 kSystemZ_ShadowOffset64 = 1ULL << 52; +static const u64 kBSDSUniX_ShadowOffset32 = 1ULL << 30; // 0x40000000 +static const u64 kBSDSUniX_ShadowOffset64 = 1ULL << 46; // 0x400000000000 static const u64 kFreeBSD_ShadowOffset32 = 1ULL << 30; // 0x40000000 static const u64 kFreeBSD_ShadowOffset64 = 1ULL << 46; // 0x400000000000 static const u64 kWindowsShadowOffset32 = 3ULL << 28; // 0x30000000 @@ -152,6 +154,8 @@ # define SHADOW_OFFSET kMIPS32_ShadowOffset32 # elif SANITIZER_FREEBSD # define SHADOW_OFFSET kFreeBSD_ShadowOffset32 +# elif SANITIZER_BSDSUNIX +# define SHADOW_OFFSET kBSDSUniX_ShadowOffset32 # elif SANITIZER_WINDOWS # define SHADOW_OFFSET kWindowsShadowOffset32 # elif SANITIZER_IOS @@ -176,6 +180,8 @@ # define SHADOW_OFFSET kPPC64_ShadowOffset64 # elif defined(__s390x__) # define SHADOW_OFFSET kSystemZ_ShadowOffset64 +# elif SANITIZER_BSDSUNIX +# define SHADOW_OFFSET kBSDSUniX_ShadowOffset64 # elif SANITIZER_FREEBSD # define SHADOW_OFFSET kFreeBSD_ShadowOffset64 # elif SANITIZER_MAC --- lib/asan/asan_new_delete.cc.orig 2016-09-21 07:27:10.000000000 +1000 +++ lib/asan/asan_new_delete.cc 2020-05-26 10:16:20.041150000 +1000 @@ -47,9 +47,9 @@ // FreeBSD prior v9.2 have wrong definition of 'size_t'. // http://svnweb.freebsd.org/base?view=revision&revision=232261 -#if SANITIZER_FREEBSD && SANITIZER_WORDSIZE == 32 +#if (SANITIZER_FREEBSD || SANITIZER_BSDSUNIX) && SANITIZER_WORDSIZE == 32 #include -#if __FreeBSD_version <= 902001 // v9.2 +#if defined(__FreeBSD__) && __FreeBSD_version <= 902001 // v9.2 #define size_t unsigned #endif // __FreeBSD_version #endif // SANITIZER_FREEBSD && SANITIZER_WORDSIZE == 32 --- lib/asan/asan_stack.h.orig 2016-05-18 16:09:26.000000000 +1000 +++ lib/asan/asan_stack.h 2020-05-26 10:18:45.522350000 +1000 @@ -41,10 +41,10 @@ stack->size = 0; if (LIKELY(asan_inited)) { if ((t = GetCurrentThread()) && !t->isUnwinding()) { - // On FreeBSD the slow unwinding that leverages _Unwind_Backtrace() + // On FreeBSD && BSDSUniX the slow unwinding that leverages _Unwind_Backtrace() // yields the call stack of the signal's handler and not of the code // that raised the signal (as it does on Linux). - if (SANITIZER_FREEBSD && t->isInDeadlySignal()) fast = true; + if ((SANITIZER_BSDSUNIX || SANITIZER_FREEBSD) && t->isInDeadlySignal()) fast = true; uptr stack_top = t->stack_top(); uptr stack_bottom = t->stack_bottom(); ScopedUnwinding unwind_scope(t); --- lib/asan/scripts/asan_symbolize.py.orig 2017-01-07 08:02:50.000000000 +1100 +++ lib/asan/scripts/asan_symbolize.py 2020-05-26 14:52:33.330521000 +1000 @@ -276,7 +276,7 @@ def SystemSymbolizerFactory(system, addr, binary, arch): if system == 'Darwin': return DarwinSymbolizer(addr, binary, arch) - elif system == 'Linux' or system == 'FreeBSD': + elif system == 'Linux' or system == 'FreeBSD' or system == 'BSDSUniX': return Addr2LineSymbolizer(binary) @@ -366,7 +366,7 @@ self.binary_name_filter = binary_name_filter self.dsym_hint_producer = dsym_hint_producer self.system = os.uname()[0] - if self.system not in ['Linux', 'Darwin', 'FreeBSD']: + if self.system not in ['Linux', 'Darwin', 'FreeBSD', 'BSDSUniX']: raise Exception('Unknown system') self.llvm_symbolizers = {} self.last_llvm_symbolizer = None --- lib/asan/tests/asan_test_utils.h.orig 2016-12-29 08:57:51.000000000 +1100 +++ lib/asan/tests/asan_test_utils.h 2020-05-26 14:57:14.032335000 +1000 @@ -45,7 +45,7 @@ #include #endif -#if !defined(__APPLE__) && !defined(__FreeBSD__) +#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__BSDSUniX__) #include #endif