This is an archive of the discontinued LLVM Phabricator instance.

[tsan]: rename RunningOnValgrind to __tsan_RunningOnValgrind
AbandonedPublic

Authored by sugak on Jun 6 2016, 3:06 PM.

Details

Summary

RunningOnValgrind is a common name, used in several projects (gperftools for instance).
Add the namespace __tsan_ prefix to avoid errors when linking with
other libraries that define a symbol with this name.

The change is mechanical, induced by the following command:

git grep -lw RunningOnValgrind | \
xargs perl -pi -e 's/\b(RunningOnValgrind)\b/__tsan_$1/g'

Diff Detail

Event Timeline

sugak updated this revision to Diff 59793.Jun 6 2016, 3:06 PM
sugak retitled this revision from to [tsan]: rename RunningOnValgrind to __tsan_RunningOnValgrind.
sugak added reviewers: kcc, kubamracek.
sugak updated this object.
sugak added a subscriber: llvm-commits.
sugak updated this object.Jun 6 2016, 3:08 PM
kcc added a reviewer: dvyukov.Jun 6 2016, 6:36 PM

I am not sure we still need this, let Dmitry comment.
But if we do, it clearly should remain as is -- that's the whole purpose :)

dvyukov edited edge metadata.Jun 7 2016, 12:44 AM

We still use it and it must be named RunningOnValgrind to override definitions in projects. Other projects are meant to disable their definitions when building for tsan.

What do you use from gperftools? tcmalloc/heapchecker/heapprofiler are not compatible with sanitizers. What's left is cpuprofiler, but it does not use RunningOnValgrind as far as I see.

sugak abandoned this revision.Jun 7 2016, 9:05 AM

Thank you for the explanation @dvyukov! I don't remember exactly how gperftools was used in a project where I noticed the symbol name conflict. I'll try to reproduce it, and will post here for the record.
Abandoning this.