Commit 20d6c1df authored by Nathan Bronson's avatar Nathan Bronson Committed by Facebook Github Bot

allow TSAN hook linkage override at compile time

Summary:
This diff allows you to override the function attributes for TSAN
hooks at compile time using -DFOLLY_ATTR_FOR_SANITIZE_THREAD_HOOKS=xyz.
This is useful for builds that statically link with a library like abseil
that has its own declarations for the hooks.

Reviewed By: yfeldblum, kennyyu

Differential Revision: D12866286

fbshipit-source-id: 10d2921df998d5dc11f86a5383111d650d31dd8e
parent 05975ce4
...@@ -174,19 +174,23 @@ ...@@ -174,19 +174,23 @@
#endif #endif
#endif #endif
#ifndef FOLLY_ATTR_FOR_SANITIZE_THREAD_HOOKS
#define FOLLY_ATTR_FOR_SANITIZE_THREAD_HOOKS FOLLY_ATTR_WEAK
#endif
// These functions are defined by the TSAN runtime library and enable // These functions are defined by the TSAN runtime library and enable
// annotating mutexes for TSAN. // annotating mutexes for TSAN.
extern "C" FOLLY_ATTR_WEAK void extern "C" FOLLY_ATTR_FOR_SANITIZE_THREAD_HOOKS void
AnnotateRWLockCreate(const char* f, int l, const volatile void* addr); AnnotateRWLockCreate(const char* f, int l, const volatile void* addr);
extern "C" FOLLY_ATTR_WEAK void extern "C" FOLLY_ATTR_FOR_SANITIZE_THREAD_HOOKS void
AnnotateRWLockCreateStatic(const char* f, int l, const volatile void* addr); AnnotateRWLockCreateStatic(const char* f, int l, const volatile void* addr);
extern "C" FOLLY_ATTR_WEAK void extern "C" FOLLY_ATTR_FOR_SANITIZE_THREAD_HOOKS void
AnnotateRWLockDestroy(const char* f, int l, const volatile void* addr); AnnotateRWLockDestroy(const char* f, int l, const volatile void* addr);
extern "C" FOLLY_ATTR_WEAK void extern "C" FOLLY_ATTR_FOR_SANITIZE_THREAD_HOOKS void
AnnotateRWLockAcquired(const char* f, int l, const volatile void* addr, long w); AnnotateRWLockAcquired(const char* f, int l, const volatile void* addr, long w);
extern "C" FOLLY_ATTR_WEAK void extern "C" FOLLY_ATTR_FOR_SANITIZE_THREAD_HOOKS void
AnnotateRWLockReleased(const char* f, int l, const volatile void* addr, long w); AnnotateRWLockReleased(const char* f, int l, const volatile void* addr, long w);
extern "C" FOLLY_ATTR_WEAK void AnnotateBenignRaceSized( extern "C" FOLLY_ATTR_FOR_SANITIZE_THREAD_HOOKS void AnnotateBenignRaceSized(
const char* f, const char* f,
int l, int l,
const volatile void* addr, const volatile void* addr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment