From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1118) id EFB3A3858D37; Sun, 26 Mar 2023 21:17:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFB3A3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679865426; bh=8JhK3jjWiGif8jcyk7Wx1mCpdRrLpjb/aFZO7JvJKW4=; h=From:To:Subject:Date:From; b=hVaXIDBcNQO3ThdrTOfPgzXAhXl4snBpUeIy/YpVpGN00GX9wmZWmi/Y9OVG2bxhW cK9DyQ95eHTs5+dZ5ap+lbnmWb5l+b/7JrJrTRv5zKiNTB0jw5zc8LjBsLq/Byd4j9 V9hBMxfLFdCJlN6WBbJnruo4hZRI2i7Bjpc3dqeM= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: John David Anglin To: glibc-cvs@sourceware.org Subject: [glibc] hppa: Drop 16-byte pthread lock alignment X-Act-Checkin: glibc X-Git-Author: John David Anglin X-Git-Refname: refs/heads/master X-Git-Oldrev: 1b5e65ef6a442fdccf88d43c3048f98292d85631 X-Git-Newrev: ab991a3d1b401ded6bd4f027352da8262b021a11 Message-Id: <20230326211706.EFB3A3858D37@sourceware.org> Date: Sun, 26 Mar 2023 21:17:06 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ab991a3d1b401ded6bd4f027352da8262b021a11 commit ab991a3d1b401ded6bd4f027352da8262b021a11 Author: John David Anglin Date: Sun Mar 26 21:16:22 2023 +0000 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 Diff: --- sysdeps/hppa/nptl/bits/pthreadtypes-arch.h | 2 +- sysdeps/hppa/nptl/bits/struct_rwlock.h | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) 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;