diff --git a/openmp/tools/archer/ompt-tsan.cpp b/openmp/tools/archer/ompt-tsan.cpp --- a/openmp/tools/archer/ompt-tsan.cpp +++ b/openmp/tools/archer/ompt-tsan.cpp @@ -29,10 +29,7 @@ #include #include #include - -#if (defined __APPLE__ && defined __MACH__) #include -#endif #include "omp-tools.h" @@ -148,7 +145,6 @@ // See http://code.google.com/p/data-race-test/wiki/DynamicAnnotations . // tsan detects these exact functions by name. extern "C" { -#if (defined __APPLE__ && defined __MACH__) static void (*AnnotateHappensAfter)(const char *, int, const volatile void *); static void (*AnnotateHappensBefore)(const char *, int, const volatile void *); static void (*AnnotateIgnoreWritesBegin)(const char *, int); @@ -169,25 +165,6 @@ runOnTsan = 0; return 0; } -#else -void __attribute__((weak)) -AnnotateHappensAfter(const char *file, int line, const volatile void *cv) {} -void __attribute__((weak)) -AnnotateHappensBefore(const char *file, int line, const volatile void *cv) {} -void __attribute__((weak)) -AnnotateIgnoreWritesBegin(const char *file, int line) {} -void __attribute__((weak)) AnnotateIgnoreWritesEnd(const char *file, int line) { -} -void __attribute__((weak)) -AnnotateNewMemory(const char *file, int line, const volatile void *cv, - size_t size) {} -int __attribute__((weak)) RunningOnValgrind() { - runOnTsan = 0; - return 0; -} -void __attribute__((weak)) __tsan_func_entry(const void *call_pc) {} -void __attribute__((weak)) __tsan_func_exit(void) {} -#endif } // This marker is used to define a happens-before arc. The race detector will @@ -1099,7 +1076,6 @@ exit(1); } -#if (defined __APPLE__ && defined __MACH__) #define findTsanFunction(f, fSig) \ do { \ if (NULL == (f = fSig dlsym(RTLD_DEFAULT, #f))) \ @@ -1117,7 +1093,7 @@ (void (*)(const char *, int, const volatile void *, size_t))); findTsanFunction(__tsan_func_entry, (void (*)(const void *))); findTsanFunction(__tsan_func_exit, (void (*)(void))); -#endif +#undef findTsanFunction SET_CALLBACK(thread_begin); SET_CALLBACK(thread_end);