diff mbox series

libsanitizer: cherry-pick commit 05551c658269 from upstream

Message ID 20230427023243.1481560-1-hjl.tools@gmail.com
State New
Headers show
Series libsanitizer: cherry-pick commit 05551c658269 from upstream | expand

Commit Message

H.J. Lu April 27, 2023, 2:32 a.m. UTC
cherry-pick:

05551c658269 [sanitizer] Correct alignment of x32 __sanitizer_siginfo

	* sanitizer_common/sanitizer_platform_limits_posix.h
	(__sanitizer_siginfo_pad): Use u64 to align x32
	__sanitizer_siginfo to 8 bytes.
---
 .../sanitizer_common/sanitizer_platform_limits_posix.h       | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Martin Liška April 27, 2023, 7:03 a.m. UTC | #1
On 4/27/23 04:32, H.J. Lu via Gcc-patches wrote:
> cherry-pick:

Can you please wait a few days before it? I'm going to merge again
in the near future after https://reviews.llvm.org/D144073 got handled.

Martin

> 
> 05551c658269 [sanitizer] Correct alignment of x32 __sanitizer_siginfo
> 
> 	* sanitizer_common/sanitizer_platform_limits_posix.h
> 	(__sanitizer_siginfo_pad): Use u64 to align x32
> 	__sanitizer_siginfo to 8 bytes.
> ---
>  .../sanitizer_common/sanitizer_platform_limits_posix.h       | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
> index cfca7bdedbe..e6f298c26e1 100644
> --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
> +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
> @@ -578,8 +578,13 @@ struct __sanitizer_sigset_t {
>  #endif
>  
>  struct __sanitizer_siginfo_pad {
> +#if SANITIZER_X32
> +  // x32 siginfo_t is aligned to 8 bytes.
> +  u64 pad[128 / sizeof(u64)];
> +#else
>    // Require uptr, because siginfo_t is always pointer-size aligned on Linux.
>    uptr pad[128 / sizeof(uptr)];
> +#endif
>  };
>  
>  #if SANITIZER_LINUX
H.J. Lu April 27, 2023, 4:25 p.m. UTC | #2
On Thu, Apr 27, 2023 at 12:03 AM Martin Liška <mliska@suse.cz> wrote:
>
> On 4/27/23 04:32, H.J. Lu via Gcc-patches wrote:
> > cherry-pick:
>
> Can you please wait a few days before it? I'm going to merge again
> in the near future after https://reviews.llvm.org/D144073 got handled.

Sure.

> Martin
>
> >
> > 05551c658269 [sanitizer] Correct alignment of x32 __sanitizer_siginfo
> >
> >       * sanitizer_common/sanitizer_platform_limits_posix.h
> >       (__sanitizer_siginfo_pad): Use u64 to align x32
> >       __sanitizer_siginfo to 8 bytes.
> > ---
> >  .../sanitizer_common/sanitizer_platform_limits_posix.h       | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
> > index cfca7bdedbe..e6f298c26e1 100644
> > --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
> > +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
> > @@ -578,8 +578,13 @@ struct __sanitizer_sigset_t {
> >  #endif
> >
> >  struct __sanitizer_siginfo_pad {
> > +#if SANITIZER_X32
> > +  // x32 siginfo_t is aligned to 8 bytes.
> > +  u64 pad[128 / sizeof(u64)];
> > +#else
> >    // Require uptr, because siginfo_t is always pointer-size aligned on Linux.
> >    uptr pad[128 / sizeof(uptr)];
> > +#endif
> >  };
> >
> >  #if SANITIZER_LINUX
>
diff mbox series

Patch

diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
index cfca7bdedbe..e6f298c26e1 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -578,8 +578,13 @@  struct __sanitizer_sigset_t {
 #endif
 
 struct __sanitizer_siginfo_pad {
+#if SANITIZER_X32
+  // x32 siginfo_t is aligned to 8 bytes.
+  u64 pad[128 / sizeof(u64)];
+#else
   // Require uptr, because siginfo_t is always pointer-size aligned on Linux.
   uptr pad[128 / sizeof(uptr)];
+#endif
 };
 
 #if SANITIZER_LINUX