From 9c5bab23ee50abcb0d824fa75e0774fe39bc598b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 22 Nov 2016 11:09:35 +0000 Subject: [PATCH] tsan: fix build after 287632 1. Mac does not have MAP_32BIT. Define it to 0 if it is not defined. 2. We are lacking nolibc stub for ListOfModules::init. Add it. llvm-svn: 287634 --- compiler-rt/lib/sanitizer_common/sanitizer_common_nolibc.cc | 4 ++++ compiler-rt/test/tsan/ignore_lib5.cc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_nolibc.cc b/compiler-rt/lib/sanitizer_common/sanitizer_common_nolibc.cc index 59edcba..ba54c73 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common_nolibc.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_nolibc.cc @@ -29,4 +29,8 @@ void Abort() { internal__exit(1); } void SleepForSeconds(int seconds) { internal_sleep(seconds); } #endif // !SANITIZER_WINDOWS +#if !SANITIZER_WINDOWS && !SANITIZER_MAC +void ListOfModules::init() {} +#endif + } // namespace __sanitizer diff --git a/compiler-rt/test/tsan/ignore_lib5.cc b/compiler-rt/test/tsan/ignore_lib5.cc index 6040435..330f110 100644 --- a/compiler-rt/test/tsan/ignore_lib5.cc +++ b/compiler-rt/test/tsan/ignore_lib5.cc @@ -23,6 +23,10 @@ #include #include "test.h" +#ifndef MAP_32BIT +# define MAP_32BIT 0 +#endif + void *thr(void *arg) { // This thread creates lots of separate mappings in /proc/self/maps before // the ignored library. -- 2.7.4