From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dellerweb.de (dellerweb.de [173.249.48.176]) by sourceware.org (Postfix) with ESMTPS id EBC113858D37 for ; Sun, 26 Mar 2023 21:22:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EBC113858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=parisc-linux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=parisc-linux.org Received: from mx3210.localdomain (bras-base-otwaon0925w-grc-09-174-95-58-126.dsl.bell.ca [174.95.58.126]) by dellerweb.de (Postfix) with ESMTPSA id 1B9D316000CD; Sun, 26 Mar 2023 23:22:14 +0200 (CEST) Received: by mx3210.localdomain (Postfix, from userid 1000) id 14F4A22012C; Sun, 26 Mar 2023 21:22:11 +0000 (UTC) Date: Sun, 26 Mar 2023 21:22:11 +0000 From: John David Anglin To: libc-alpha@sourceware.org Cc: deller@gmx.de Subject: [committed] hppa: Drop 16-byte pthread lock alignment Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DqNubvwHrYMwNYXu" Content-Disposition: inline X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --DqNubvwHrYMwNYXu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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) <=3D 8, ""); | ~~~~~~~~~~~~~~~~~~~~^~~~ This is caused by the 16-byte pthread lock alignment. Signed-off-by: John David Anglin --- 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 =20 -#define __LOCK_ALIGNMENT __attribute__ ((__aligned__(16))) +#define __LOCK_ALIGNMENT #define __ONCE_ALIGNMENT =20 #endif /* bits/pthreadtypes.h */ diff --git a/sysdeps/hppa/nptl/bits/struct_rwlock.h b/sysdeps/hppa/nptl/bit= s/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; --DqNubvwHrYMwNYXu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEnRzl+6e9+DTrEhyEXb/Nrl8ZTfEFAmQgt3wACgkQXb/Nrl8Z TfEjPA/+NHIw4orEheIdxFLisR8M4qVZ4yW/AE/9jI4+5sGwZZW5ftw9pthsUFdr ySDr4+l482kvbBp/uUZj/5ri37xxMVsKMDJMnieS4CRc0T/hB+5Aue2efe00xbOx WGBnWE/eG3crMh4OWjbgPwVpFvyaRCcrZqgUZ9QvLeT6o0ShTtZ+NvsVqCS27e5N uGwHhEzYRJcKTAChru1PRB/sMtYrdVXPmIQYW8rsTOkM6yUKuBwTrqhcpmd0EUuu mmVX2UytboM0H9bEAXkzGQkZhcBE/I+0XF+rfuihpdLo8JKBQM7RlQctci+py2Xg qYYYRMe8ocZxEeuszAQpioefKsSfJ9RJKQ4erMoa13g+y2Y+RxhKz+CLDPunusOt Sn4wzfAMkzvnnR6YGL7m97TRGmbFelc2SD//fKaCQmDJs6M5VRxMR8wN2tTyYTKr XBJ+FQS7CPbp/udznHQ3IhrnKjYZZETPurDrjAnfT0qB8Fd6N3fE27cdUUkKeJdS J3W7dDRFBNRUI9OnnBIFOwIhwdZSmn5GroB07N1lnef+jMuZ+4B+hMBQclRZnChQ I/2p+U5WIg+2NNTd0tmlcK+/oW42sUSOz3cxNvetcZnzgAHJQXDDxWro63WThGkk Ai61hHlsfZZL5OCBXCr5houq3ujwhjPgJIbrrSxLAY528DEvrMo= =Z9GZ -----END PGP SIGNATURE----- --DqNubvwHrYMwNYXu--