public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: John David Anglin <dave.anglin@bell.net>
To: John David Anglin <dave@parisc-linux.org>, libc-alpha@sourceware.org
Cc: deller@gmx.de, Sam James <sam@gentoo.org>
Subject: Re: [committed] hppa: Drop 16-byte pthread lock alignment
Date: Thu, 6 Jul 2023 12:01:17 -0400	[thread overview]
Message-ID: <668d1c2d-1b02-bea8-d5a7-ea8a044f3f97@bell.net> (raw)
In-Reply-To: <ZCC3g2nKEtpz36nR@mx3210.localdomain>

After some discussion, I decided it would be best to revert this change for now.

Commit 500054974667be3153ed760152ea0153df33c3d0 reverts " hppa: Drop 16-byte pthread lock alignment"
(commits c4468cd3995b4236ea886901109b194641132b08 and ab991a3d1b401ded6bd4f027352da8262b021a11).

Dave

On 2023-03-26 5:22 p.m., John David Anglin wrote:
> hppa: Drop 16-byte pthread lock alignment
>
> Linux threads were removed about 12 years ago and the current
> nptl implementation only requires 4-byte alignment for pthread
> locks.
>
> The 16-byte alignment causes various issues. For example in
> building ignition-msgs, we have:
>
> /usr/include/google/protobuf/map.h:124:37: error: static assertion failed
>    124 |   static_assert(alignof(value_type) <= 8, "");
>        |                 ~~~~~~~~~~~~~~~~~~~~^~~~
>
> This is caused by the 16-byte pthread lock alignment.
>
> Signed-off-by: John David Anglin <dave.anglin@bell.net>
> ---
>
> diff --git a/sysdeps/hppa/nptl/bits/pthreadtypes-arch.h b/sysdeps/hppa/nptl/bits/pthreadtypes-arch.h
> index 999195c5b0..c1a46d66d0 100644
> --- a/sysdeps/hppa/nptl/bits/pthreadtypes-arch.h
> +++ b/sysdeps/hppa/nptl/bits/pthreadtypes-arch.h
> @@ -40,7 +40,7 @@
>   #define __SIZEOF_PTHREAD_RWLOCK_T 64
>   #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
>   
> -#define __LOCK_ALIGNMENT __attribute__ ((__aligned__(16)))
> +#define __LOCK_ALIGNMENT
>   #define __ONCE_ALIGNMENT
>   
>   #endif	/* bits/pthreadtypes.h */
> diff --git a/sysdeps/hppa/nptl/bits/struct_rwlock.h b/sysdeps/hppa/nptl/bits/struct_rwlock.h
> index e83b4aab52..59bc9fe76f 100644
> --- a/sysdeps/hppa/nptl/bits/struct_rwlock.h
> +++ b/sysdeps/hppa/nptl/bits/struct_rwlock.h
> @@ -25,8 +25,14 @@ struct __pthread_rwlock_arch_t
>     /* In the old Linuxthreads pthread_rwlock_t, this is the
>        start of the 4-word 16-byte aligned lock structure. The
>        next four words are all set to 1 by the Linuxthreads
> -     PTHREAD_RWLOCK_INITIALIZER. We ignore them in NPTL.  */
> -  int __compat_padding[4] __attribute__ ((__aligned__(16)));
> +     PTHREAD_RWLOCK_INITIALIZER. We ignore them in NPTL.
> +
> +     The 16-byte aligned lock stucture causes various pthread
> +     structures to be over aligned. This causes some builds
> +     to fail which assume a maximum alignment of 8 bytes.
> +     Linuxthreads has been removed for 12 years, so drop
> +     alignment of lock structure.  */
> +  int __compat_padding[4];
>     unsigned int __readers;
>     unsigned int __writers;
>     unsigned int __wrphase_futex;


-- 
John David Anglin  dave.anglin@bell.net


      parent reply	other threads:[~2023-07-06 16:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26 21:22 John David Anglin
2023-03-27  0:33 ` Florian Weimer
2023-03-27  0:37   ` Sam James
2023-03-27  1:58     ` John David Anglin
2023-03-27 12:42       ` Florian Weimer
2023-03-30 21:08         ` John David Anglin
2023-03-31  7:14           ` Florian Weimer
2023-03-27  0:35 ` Sam James
2023-03-27 15:24 ` Pedro Alves
2023-07-06 16:01 ` John David Anglin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=668d1c2d-1b02-bea8-d5a7-ea8a044f3f97@bell.net \
    --to=dave.anglin@bell.net \
    --cc=dave@parisc-linux.org \
    --cc=deller@gmx.de \
    --cc=libc-alpha@sourceware.org \
    --cc=sam@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).