From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp002.apm-internet.net (smtp002.apm-internet.net [85.119.248.221]) by sourceware.org (Postfix) with ESMTPS id 59FBE3858D20 for ; Thu, 29 Dec 2022 11:28:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 59FBE3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=sandoe.co.uk Received: (qmail 27218 invoked from network); 29 Dec 2022 11:28:45 -0000 X-APM-Out-ID: 16723133252721 X-APM-Authkey: 257869/1(257869/1) 2 Received: from unknown (HELO smtpclient.apple) (81.138.1.83) by smtp002.apm-internet.net with SMTP; 29 Dec 2022 11:28:45 -0000 From: Iain Sandoe Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: [RFA] choosing __platform_wait_t on targets without lock-free 64 atomics Message-Id: <6640F26B-F267-40E0-9223-2F0F45462176@sandoe.co.uk> Date: Thu, 29 Dec 2022 11:28:45 +0000 To: libstdc++ X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_COUK,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,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: Hi, The recent addition of the tz handling has pulled in a dependency on = This currently specifies __platform_wait_t as a 64bit quatity on = platforms without _GLIBCXX_HAVE_LINUX_FUTEX. PowerPC does not have a 64b atomic without library support - so that = this causes a bootstrap fail on powerpc-darwin (and I guess any other 32b powerpc non-futex = target). Rather than contrive to build and add libatomic (which is not at present = available at the point that libstdc++ is built), I wonder if there is any specific reason that = __platform_wait_t needs to be 64 bits on these platforms? (Especially since the futex case uses = an int.) Advice on the right way to fix this welcome =E2=80=94 as a work-around = to allow bootstrap to complete I applied the patch below - but that seems unlikely to be the right = thing generically . thanks Iain ---- diff --git a/libstdc++-v3/include/bits/atomic_wait.h = b/libstdc++-v3/include/bits/atomic_wait.h index bd1ed56..2f67180 100644 --- a/libstdc++-v3/include/bits/atomic_wait.h +++ b/libstdc++-v3/include/bits/atomic_wait.h @@ -64,7 +64,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // and __platform_notify() if there is a more efficient primitive = supported // by the platform (e.g. __ulock_wait()/__ulock_wake()) which is better = than // a mutex/condvar based wait. +#if __LP64__ using __platform_wait_t =3D uint64_t; +#else + using __platform_wait_t =3D uint32_t; +#endif inline constexpr size_t __platform_wait_alignment =3D __alignof__(__platform_wait_t);