re PR sanitizer/78532 (libsanitizer fails to build on sparc64-linux-gnu)
authorMaxim Ostapenko <m.ostapenko@samsung.com>
Wed, 30 Nov 2016 12:31:07 +0000 (12:31 +0000)
committerMaxim Ostapenko <chefmax@gcc.gnu.org>
Wed, 30 Nov 2016 12:31:07 +0000 (14:31 +0200)
PR sanitizer/78532
* sanitizer_common/sanitizer_platform_limits_posix.h
(__sanitizer_sigaction): Adjust for sparc targets and various Glibc
versions.

From-SVN: r243014

libsanitizer/ChangeLog
libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h

index 5fe324af3b125c256c03662f80faa96c5cc09519..e691f67b483e6f5809f0a0711cc25266a078c4e5 100644 (file)
@@ -1,3 +1,10 @@
+2016-11-30  Maxim Ostapenko  <m.ostapenko@samsung.com>
+
+       PR sanitizer/78532
+       * sanitizer_common/sanitizer_platform_limits_posix.h
+       (__sanitizer_sigaction): Adjust for sparc targets and various Glibc
+       versions.
+
 2016-11-29  Markus Trippelsdorf  <markus@trippelsdorf.de>
 
        * LOCAL_PATCHES: Remove r242480.
index d1a305169973455f425af8ebcc35ee823a306c85..066bf41ffef7979111732da137253874b91de6c2 100644 (file)
 # define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) ((link_map*)(handle))
 #endif  // !SANITIZER_FREEBSD
 
+#ifndef __GLIBC_PREREQ
+#define __GLIBC_PREREQ(x, y) 0
+#endif
+
 namespace __sanitizer {
   extern unsigned struct_utsname_sz;
   extern unsigned struct_stat_sz;
@@ -628,7 +632,14 @@ namespace __sanitizer {
 #endif
 #ifndef __mips__
 #if defined(__sparc__)
+#if __GLIBC_PREREQ (2, 20)
+    // On sparc glibc 2.19 and earlier sa_flags was unsigned long, and
+    // __glibc_reserved0 didn't exist.
+    int __glibc_reserved0;
+    int sa_flags;
+#else
     unsigned long sa_flags;
+#endif
 #else
     int sa_flags;
 #endif