From patchwork Thu Oct 20 12:56:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Arsen_Arsenovi=C4=87?= X-Patchwork-Id: 6183 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp94044wrr; Thu, 20 Oct 2022 05:58:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6/OgRcAEUld6SRowt55AGUrQykMSLmxNR4LqcVq+wogAQOmIs6Q43dtWSnPFa1VZVzsXf4 X-Received: by 2002:a17:907:25cd:b0:77b:9672:38e7 with SMTP id ae13-20020a17090725cd00b0077b967238e7mr11350468ejc.10.1666270689501; Thu, 20 Oct 2022 05:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666270689; cv=none; d=google.com; s=arc-20160816; b=JMnfRW5lb4gJVPWTPEv1w4Pt37DAX3dWzaWSVyKKAvLaP8u1Y8wY2889zMdNEt75Km qXv+rTLL4C+GWDPAbBINxZnNbxgMD9KIOgy5WkOukzamr3LibUYwuLmz1Dqchf9kUl4Q F+As+cKfDo1Omp19EeNsHHQPpChVURzq40noNv2FXYE+N9RObxy9omGyjHpIFzeuUhww /A2ZTLbBKv3EKFTcP3pdX0xK2OiYFZ9rLpZBMGpp10c8Unf6xxtTGMqACYT7GvVbyjwE JSrrz54s6jzOoAtg5rRipYOTzPn5+PzHmL4Yq1DPFkL+vK8iQNRhESuWaeetI8YEuIKG AGpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=on52WHKmxGaE20a6ndfm4H/Kk6Uhw7HmIENVr2rSD6w=; b=aXJwQdJmldl9l8MWuvR3nmGXCmaDksB8NfClUmo/ff1ywNZxPJxmhvLsUhWNxMyL05 kERGz7Pc7wqY+G4Sfo00JIqDY7F1yryoTLKxsFqPFzXMwpHFaL+eRHvx6JRhU6OO1N5W wcA4qZMkbBiUEHoHsP19QG+YNPEYOq7DF7u0Kqp3oLoQCWQ8ClP8RMKDprwuPPshzUcB 9j9ZFC0xVgmaM59fvQPUx4H0xPziliQtlKs8NWX5kUSjN5CoCm+h5EEenK2KMqk6qDLR 9elpNHVQV2eFhxmD1vMXVrcPGC4pO1t+nSf6+0D6AQKyU0nny2FizcFFzHdXTK1cty4M QCGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Eb4a69jE; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id du3-20020a17090772c300b00734be0d7167si17101623ejc.825.2022.10.20.05.58.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 05:58:09 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Eb4a69jE; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4AF93385115D for ; Thu, 20 Oct 2022 12:58:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4AF93385115D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666270688; bh=on52WHKmxGaE20a6ndfm4H/Kk6Uhw7HmIENVr2rSD6w=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Eb4a69jEa2MdxWiey/JZDHgFFyY8dUDjSNgO+GR3mNofFJ5UcmcdSl9JFs/oRYusw a1kR2h7xPQEJdzfAFzdSmDKhfbz9sPGD/fLfuamgqrQuRKOCcoBuJkMmm0f//yN/NK 1K8HPv8mXVnwp6hrpQuIqMbxTr+PN9YDTptqOufA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050:0:465::201]) by sourceware.org (Postfix) with ESMTPS id E9350386075B; Thu, 20 Oct 2022 12:56:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E9350386075B Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4MtSKC3CFNz9sQH; Thu, 20 Oct 2022 14:56:31 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] libstdc++: Don't use gstdint.h anymore Date: Thu, 20 Oct 2022 14:56:16 +0200 Message-Id: <20221020125615.2198195-1-arsen@aarsen.me> MIME-Version: 1.0 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_INFOUSMEBIZ, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Arsen_Arsenovi=C4=87_via_Gcc-patches?= From: =?utf-8?q?Arsen_Arsenovi=C4=87?= Reply-To: =?utf-8?q?Arsen_Arsenovi=C4=87?= Cc: libstdc++@gcc.gnu.org Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747211454701479539?= X-GMAIL-MSGID: =?utf-8?q?1747211454701479539?= libstdc++-v3/ChangeLog: * configure.ac: Stop generating gstdint.h. * src/c++11/compatibility-atomic-c++0x.cc: Stop using gstdint.h. --- Tested on x86_64-pc-linux-gnu. libstdc++-v3/configure.ac | 6 ------ libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc | 9 +++++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 81d914b434a..c5ec976c026 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -440,12 +440,6 @@ GCC_CHECK_UNWIND_GETIPINFO GCC_LINUX_FUTEX([AC_DEFINE(HAVE_LINUX_FUTEX, 1, [Define if futex syscall is available.])]) -if test "$is_hosted" = yes; then -# TODO: remove this and change src/c++11/compatibility-atomic-c++0x.cc to -# use instead of . -GCC_HEADER_STDINT(include/gstdint.h) -fi - GLIBCXX_ENABLE_SYMVERS([yes]) AC_SUBST(libtool_VERSION) diff --git a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc index 5a0c5459088..2065eb517db 100644 --- a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc +++ b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc @@ -22,10 +22,11 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -#include "gstdint.h" #include #include +using guintptr_t = __UINTPTR_TYPE__; + // XXX GLIBCXX_ABI Deprecated // gcc-4.7.0 @@ -119,13 +120,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_CONST __atomic_flag_base* __atomic_flag_for_address(const volatile void* __z) _GLIBCXX_NOTHROW { - uintptr_t __u = reinterpret_cast(__z); + guintptr_t __u = reinterpret_cast(__z); __u += (__u >> 2) + (__u << 4); __u += (__u >> 7) + (__u << 5); __u += (__u >> 17) + (__u << 13); - if (sizeof(uintptr_t) > 4) + if (sizeof(guintptr_t) > 4) __u += (__u >> 31); - __u &= ~((~uintptr_t(0)) << LOGSIZE); + __u &= ~((~guintptr_t(0)) << LOGSIZE); return flag_table + __u; }