Due to the aligned-stack (which inherits from aligned buffer), the per_thread_t is not standard layout anymore. Hence, it might be unsafe to use offsetof() on it's members. For most compilers, this should be not an issue, but we should fix that anyways.
A possible solution would be to carve out the shadow-stack and put it into it's own TLS slot.
Diagnostics (both clang and gcc-8)
drace/drace-client/src/instr/instr-mem-full.cpp:169:44: warning: offsetof within non-standard-layout type ‘drace::per_thread_t’ is conditionally-supported [-Winvalid-offsetof]
opnd2 = OPND_CREATE_MEMPTR(reg3, offsetof(per_thread_t, buf_end));
Due to the aligned-stack (which inherits from aligned buffer), the
per_thread_t
is not standard layout anymore. Hence, it might be unsafe to useoffsetof()
on it's members. For most compilers, this should be not an issue, but we should fix that anyways.A possible solution would be to carve out the shadow-stack and put it into it's own TLS slot.
Diagnostics (both clang and gcc-8)