This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/63850] Building TSAN for Aarch64 results in assembler Error
- From: "dvyukov at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 13 Nov 2014 12:51:16 +0000
- Subject: [Bug sanitizer/63850] Building TSAN for Aarch64 results in assembler Error
- Auto-submitted: auto-generated
- References: <bug-63850-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63850
Dmitry Vyukov <dvyukov at google dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dvyukov at google dot com
--- Comment #1 from Dmitry Vyukov <dvyukov at google dot com> ---
Hi,
The easiest way to disable disable the assembly is to switch hacky call to
normal call:
#if TSAN_DEBUG == 0
#define HACKY_CALL(f) \
__asm__ __volatile__("sub $1024, %%rsp;" \
CFI_INL_ADJUST_CFA_OFFSET(1024) \
".hidden " #f "_thunk;" \
"call " #f "_thunk;" \
"add $1024, %%rsp;" \
CFI_INL_ADJUST_CFA_OFFSET(-1024) \
::: "memory", "cc");
#else
#define HACKY_CALL(f) f()
#endif
It should work, but just will be a bit slower.
We use this mode for Go language:
#ifndef TSAN_GO
HACKY_CALL(__tsan_trace_switch);
#else
TraceSwitch(thr);
#endif
But note that tsan is tested only on amd64 so far. So there can be other
issues. In particular, shadow memory layout and atomic operations.
Also any changes to tsan must go to llvm repo first and then be integrated into
gcc. Please refer to:
https://code.google.com/p/address-sanitizer/wiki/HowToContribute