This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/63850] Building TSAN for Aarch64 results in assembler Error


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]