diff mbox

unbreak libsanitizer build on sparc-linux (PR 67899)

Message ID 22486.57366.795579.183733@gargle.gargle.HOWL
State New
Headers show

Commit Message

Mikael Pettersson Sept. 12, 2016, 5:04 p.m. UTC
PR sanitizer/67899 is a bootstrap failure on sparc-linux, caused by a
compilation error in libsanitizer.

The root cause is that `struct sigaction' has changed layout in glibc
twice recently, first an unintended ABI change in glibc-2.20, and then
the correction in glibc-2.22 (backported to the .20 and .21 branches).
(See glibc bz#18694).  Around the time of the first change, libsanitizer
was changed to match, but it wasn't updated for the correction.  The end
result is an ABI mismatch and assertion errors during compilation of
libsanitizer.  (The sa_flags field is of the wrong size and at the wrong
offset.)

Fixed by adjusting the SPARC part of libsanitizer's sigaction struct
to match glibc (except for the broken .20 and .21 initial releases).

Tested w/o regressions on sparc-linux-gnu (post-2.20 glibc), x86_64-linux-gnu,
powerpc-linux-gnu, armv7l-linux-gnueabi, and m68k-linux-gnu.

Is this Ok for trunk and 5/6 branches?

(Note: I don't have commit rights so if this is approved I would need
help to get it applied.)

Thanks,

/Mikael


libsanitizer/

2016-09-12  Mikael Pettersson  <mikpelinux@gmail.com>

	PR sanitizer/67899
	* sanitizer_common/sanitizer_platform_limits_posix.h
	(__sanitizer_sigaction): Adjust for sparc targets.

Comments

Jeff Law Sept. 16, 2016, 4:57 p.m. UTC | #1
On 09/12/2016 11:04 AM, Mikael Pettersson wrote:
> PR sanitizer/67899 is a bootstrap failure on sparc-linux, caused by a
> compilation error in libsanitizer.
>
> The root cause is that `struct sigaction' has changed layout in glibc
> twice recently, first an unintended ABI change in glibc-2.20, and then
> the correction in glibc-2.22 (backported to the .20 and .21 branches).
> (See glibc bz#18694).  Around the time of the first change, libsanitizer
> was changed to match, but it wasn't updated for the correction.  The end
> result is an ABI mismatch and assertion errors during compilation of
> libsanitizer.  (The sa_flags field is of the wrong size and at the wrong
> offset.)
>
> Fixed by adjusting the SPARC part of libsanitizer's sigaction struct
> to match glibc (except for the broken .20 and .21 initial releases).
>
> Tested w/o regressions on sparc-linux-gnu (post-2.20 glibc), x86_64-linux-gnu,
> powerpc-linux-gnu, armv7l-linux-gnueabi, and m68k-linux-gnu.
>
> Is this Ok for trunk and 5/6 branches?
>
> (Note: I don't have commit rights so if this is approved I would need
> help to get it applied.)
>
> Thanks,
>
> /Mikael
>
>
> libsanitizer/
>
> 2016-09-12  Mikael Pettersson  <mikpelinux@gmail.com>
>
> 	PR sanitizer/67899
> 	* sanitizer_common/sanitizer_platform_limits_posix.h
> 	(__sanitizer_sigaction): Adjust for sparc targets.
I believe this is part of the upstream sanitizer projects at Google.  It 
should be submitted there first and pulled in via a merge.


Jeff
diff mbox

Patch

--- gcc-7-20160911/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h.~1~	2015-11-23 10:07:18.000000000 +0100
+++ gcc-7-20160911/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h	2016-09-12 18:34:21.446379317 +0200
@@ -606,11 +606,10 @@  namespace __sanitizer {
 #else
     __sanitizer_sigset_t sa_mask;
 #ifndef __mips__
-#if defined(__sparc__)
-    unsigned long sa_flags;
-#else
-    int sa_flags;
+#if defined(__sparc__) && defined(__arch64__)
+    int __glibc_reserved0;
 #endif
+    int sa_flags;
 #endif
 #endif
 #if SANITIZER_LINUX