[compiler-rt] r328082 - tsan: fix darwin build after 328079
Dmitry Vyukov via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 21 02:26:29 PDT 2018
Author: dvyukov
Date: Wed Mar 21 02:26:29 2018
New Revision: 328082
URL: http://llvm.org/viewvc/llvm-project?rev=328082&view=rev
Log:
tsan: fix darwin build after 328079
328079 introduced a weak hook without default implementation.
This broke darwin build:
http://green.lab.llvm.org/green//job/clang-stage1-configure-RA/43731/consoleFull#-119213188149ba4694-19c4-4d7e-bec5-911270d8a58c
Provide default impl for the hook.
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_symbolize.cc
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_symbolize.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_symbolize.cc?rev=328082&r1=328081&r2=328082&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_symbolize.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_symbolize.cc Wed Mar 21 02:26:29 2018
@@ -48,11 +48,11 @@ bool __tsan_symbolize_external(uptr pc,
// 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 ch
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);
- }
+ SymbolizedStackBuilder ssb = {nullptr, nullptr, addr};
+ __tsan_symbolize_external_ex(addr, AddFrame, &ssb);
+ 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.
More information about the llvm-commits
mailing list