tsan: fix darwin build after 328079
328079 introduced a weak hook without default implementation.
This broke darwin build:
Provide default impl for the hook.
@@ -48,11 +48,11 @@ bool __tsan_symbolize_external(uptr pc, char *func_buf, uptr func_siz,
// New API: call __tsan_symbolize_external_ex only when it exists.
// Once old clients are gone, provide dummy implementation.
-extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
+SANITIZER_WEAK_DEFAULT_IMPL
void __tsan_symbolize_external_ex(uptr pc,
void (*add_frame)(void *, const char *,
const char *, int, int),
- void *ctx);
+ void *ctx) {}
struct SymbolizedStackBuilder {
SymbolizedStack *head;
@@ -83,11 +83,10 @@ static void AddFrame(void *ctx, const char *function_name, const char *file,
SymbolizedStack *SymbolizeCode(uptr addr) {
// Check if PC comes from non-native land.
if (addr & kExternalPCBit) {
- if (__tsan_symbolize_external_ex) {
SymbolizedStackBuilder ssb = {nullptr, nullptr, addr};
__tsan_symbolize_external_ex(addr, AddFrame, &ssb);
- return ssb.head ? ssb.head : SymbolizedStack::New(addr);
- }
+ if (ssb.head)
+ return ssb.head;
// Legacy code: remove along with the declaration above
// once all clients using this API are gone.
// Declare static to not consume too much stack space.
