https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82379
--- Comment #5 from Steven Noonan <steven at uplinklabs dot net> --- (In reply to H.J. Lu from comment #4) > (In reply to Steven Noonan from comment #3) > > Are you sure that patch is sufficient? __x86_64__ is defined on both the > > normal x86_64 ABI and on the x32 ABI. The combination most often used to > > identify x32 is 'defined(__x86_64__) && defined(__ILP32__)' > > > > I've currently got this patch applied locally which allows me to build > > against the x32 ABI with -fsanitize=foo: > > > > diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc > > b/libsanitizer/sanitizer_common/sanitizer_linux.cc > > index 5b6f18602e7..a11592614a4 100644 > > --- a/libsanitizer/sanitizer_common/sanitizer_linux.cc > > +++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc > > @@ -674,7 +674,7 @@ int internal_sigaction_syscall(int signum, const void > > *act, void *oldact) { > > return internal_sigaction_norestorer(signum, act, oldact); > > __sanitizer_sigaction u_adjust; > > internal_memcpy(&u_adjust, act, sizeof(u_adjust)); > > -#if !SANITIZER_ANDROID || !SANITIZER_MIPS32 > > +#if (!SANITIZER_ANDROID || !SANITIZER_MIPS32) && !defined(__ILP32__) > > if (u_adjust.sa_restorer == nullptr) { > > u_adjust.sa_restorer = internal_sigreturn; > > } > > I don't believe this is correct. If you mean the patch itself, then I agree. It was just what happened to unblock me. > Please try my patch. I gave your patch a second look and I see why it'd work now ("x$ac_cv_sizeof_void_p = x8" would be false on x32). I'm building GCC with your patch now, it'll be a while.