public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] unbreak libsanitizer build on sparc-linux (PR 67899)
@ 2016-09-12 17:16 Mikael Pettersson
  2016-09-16 17:04 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Pettersson @ 2016-09-12 17:16 UTC (permalink / raw)
  To: gcc-patches

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.

--- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] unbreak libsanitizer build on sparc-linux (PR 67899)
  2016-09-12 17:16 [PATCH] unbreak libsanitizer build on sparc-linux (PR 67899) Mikael Pettersson
@ 2016-09-16 17:04 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2016-09-16 17:04 UTC (permalink / raw)
  To: Mikael Pettersson, gcc-patches

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-16 16:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12 17:16 [PATCH] unbreak libsanitizer build on sparc-linux (PR 67899) Mikael Pettersson
2016-09-16 17:04 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).