http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59410
--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> --- What I mean, unlike asan where the shadow memory shift and base is part of the ABI, in tsan, while performance sensitive, the MemToShadow is still library implementation detail. So, I think it shouldn't be that difficult to support it. Perhaps have a compilation mode, one most performant where you'd hardcode what you do right now and just give up if it can't be made to work, and another slightly slower one where some of the components (I guess the shift can remain hardcoded, but ored in constant can be variable, and perhaps some other operation can be added to the function too). Then during libtsan initialization it can just see if the default memory layout is viable and otherwise try some other one. I thought we've discussed it to some extent already, but don't remember where exactly.