summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-11-22 11:09:35 +0000
committerDmitry Vyukov <dvyukov@google.com>2016-11-22 11:09:35 +0000
commit15fb044879949da4345a70de896a5cd1deb60c31 (patch)
treed4729b4c3de9c70797ab81598d6a6ddca750f390
parent48015d4e1a1d15e38e39516815fd6f9a80dc81b3 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@287634 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/sanitizer_common/sanitizer_common_nolibc.cc4
-rw-r--r--test/tsan/ignore_lib5.cc4
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_common_nolibc.cc b/lib/sanitizer_common/sanitizer_common_nolibc.cc
index 59edcbaef..ba54c739a 100644
--- a/lib/sanitizer_common/sanitizer_common_nolibc.cc
+++ b/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/test/tsan/ignore_lib5.cc b/test/tsan/ignore_lib5.cc
index 6040435ac..330f11034 100644
--- a/test/tsan/ignore_lib5.cc
+++ b/test/tsan/ignore_lib5.cc
@@ -23,6 +23,10 @@
#include <string>
#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.