This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/82379] [7/8 Regression] internal_sigreturn not defined in libasan.so or libubsan.so with -mx32
- From: "steven at uplinklabs dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 01 Oct 2017 02:37:47 +0000
- Subject: [Bug sanitizer/82379] [7/8 Regression] internal_sigreturn not defined in libasan.so or libubsan.so with -mx32
- Auto-submitted: auto-generated
- References: <bug-82379-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82379
--- Comment #3 from Steven Noonan <steven at uplinklabs dot net> ---
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;
}