From patchwork Sun Mar 26 21:22:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 1761321 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Pl86b0Cqzz1yYb for ; Mon, 27 Mar 2023 08:22:30 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AC701385841A for ; Sun, 26 Mar 2023 21:22:27 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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-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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" 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 --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;