diff options
| -rwxr-xr-x | compiler-rt/lib/tsan/go/buildgo.sh | 1 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_flags.cc | 4 | ||||
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc | 10 |
3 files changed, 12 insertions, 3 deletions
diff --git a/compiler-rt/lib/tsan/go/buildgo.sh b/compiler-rt/lib/tsan/go/buildgo.sh index 8551601bc40..92835bc7675 100755 --- a/compiler-rt/lib/tsan/go/buildgo.sh +++ b/compiler-rt/lib/tsan/go/buildgo.sh @@ -48,6 +48,7 @@ elif [ "$MAC" != "" ]; then " fi +SRCS+=$ADD_SRCS #ASMS="../rtl/tsan_rtl_amd64.S" rm -f gotsan.cc diff --git a/compiler-rt/lib/tsan/rtl/tsan_flags.cc b/compiler-rt/lib/tsan/rtl/tsan_flags.cc index 11a5ce6444f..8f91939db1d 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_flags.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_flags.cc @@ -24,9 +24,13 @@ Flags *flags() { } // Can be overriden in frontend. +#ifdef TSAN_EXTERNAL_HOOKS +void OverrideFlags(Flags *f); +#else void WEAK OverrideFlags(Flags *f) { (void)f; } +#endif void InitializeFlags(Flags *f, const char *env) { internal_memset(f, 0, sizeof(*f)); diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc index 85c84dd3a89..f66e17e4815 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc @@ -38,10 +38,14 @@ void CheckFailed(const char *file, int line, const char *cond, u64 v1, u64 v2) { namespace __tsan { // Can be overriden by an application/test to intercept reports. +#ifdef TSAN_EXTERNAL_HOOKS +bool OnReport(const ReportDesc *rep, bool suppressed); +#else bool WEAK OnReport(const ReportDesc *rep, bool suppressed) { (void)rep; return suppressed; } +#endif static void StackStripMain(ReportStack *stack) { ReportStack *last_frame = 0; @@ -50,12 +54,12 @@ static void StackStripMain(ReportStack *stack) { uptr prefix_len = internal_strlen(prefix); const char *path_prefix = flags()->strip_path_prefix; uptr path_prefix_len = internal_strlen(path_prefix); + char *pos; for (ReportStack *ent = stack; ent; ent = ent->next) { if (ent->func && 0 == internal_strncmp(ent->func, prefix, prefix_len)) ent->func += prefix_len; - if (ent->file && 0 == internal_strncmp(ent->file, path_prefix, - path_prefix_len)) - ent->file += path_prefix_len; + if (ent->file && (pos = internal_strstr(ent->file, path_prefix))) + ent->file = pos + path_prefix_len; if (ent->file && ent->file[0] == '.' && ent->file[1] == '/') ent->file += 2; last_frame2 = last_frame; |

