From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 20E153858D35 for ; Thu, 29 Jun 2023 09:23:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 20E153858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-98e0c1d5289so56338166b.2 for ; Thu, 29 Jun 2023 02:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688030609; x=1690622609; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Lpogz0IAiW1SYlI/hheRgF/xmSiHNfLyznAtaWyMcLk=; b=lAOD0jRIqWGT1Ea8ZUty8vA1buCR+qFMVA/xFzVlLvFooqOdexEiPG2mv9bjaW1t/7 jCNZWq2+D1l0yq4rDtCTUKpQ65o+TvWzkgU4aSN2Wh89IjnXE2LRUEshU6lF0izQPnIn EdltFRIj1y24a9KqpwIf42pAUmybgJsoFh+6un9TfZaSqXPQQg14Wp1hxLfWOmWODzfk 4tbc75zMBqxYY/NcRrO9w3Yul1bqfyvKjz0YSVnwAFpANt2hivGVrYmdF85WlNJHi5D1 DxUmUK3fVxpDiF5uY4kmSY+53XjcYJ0XyKVx5JFtuk3IVkkuUls5MgNWugpYmyjE+Jr/ 7EYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688030609; x=1690622609; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lpogz0IAiW1SYlI/hheRgF/xmSiHNfLyznAtaWyMcLk=; b=Qed67BUWmk7rZ+HZ6QfuyS5x3OlQvlnS77U4OoUVsesIxUCBg4UD8fe2Os6lThGR2k IY5eXBg/DUHx2+Yck77+Kt9sB18V/QNOpxzax719OQhJ13vrK4RB15tNxiOsPKf8uKmn 6iIEemZNkW0tNE0sIoqKDg8DaZOCoh4uFj0e21PXd3rndkw3rWcyiZmGdVBDvtEyoQqY skRhMObSvPx/KrylQdhLkn+UNQ0RuDuJ1PiNkqCgz1Pz20Rg8E/3bAyuijtciRP7fwrb /hlKTrQ5scz+ddf9XomyeXXbsAnoUuR+GB30VgMwWEwqFLDYO2RyDOmt0JxCaV6iuxo1 JwhA== X-Gm-Message-State: AC+VfDyMX5NDErjba4A2dSjX2dYu8wkL9vPKaHb8ONJQCXqCk/SrPZ5Y GabrpRmtS3Eg0y8aRAU1/mts3qSlKJQpA/5Hwo72V15Y X-Google-Smtp-Source: ACHHUZ6pTWLhGLBAZt1Ad9etceqKCNGkW1K0vfT2nmYTqC73OWY81KYqEhzFaWqZA6+x1x6aEM9/Ogna5HWWxAUqptA= X-Received: by 2002:a17:907:628c:b0:96a:63d4:24c5 with SMTP id nd12-20020a170907628c00b0096a63d424c5mr31016832ejc.77.1688030608583; Thu, 29 Jun 2023 02:23:28 -0700 (PDT) MIME-Version: 1.0 References: <26f9444a85691ae9bdc2acea0d76e27a5b2c1aed.camel@espressif.com> <133e3d8a855c3d50ff5f9d9f198e5ae46fb97967.camel@espressif.com> In-Reply-To: <133e3d8a855c3d50ff5f9d9f198e5ae46fb97967.camel@espressif.com> From: Jonathan Wakely Date: Thu, 29 Jun 2023 10:23:17 +0100 Message-ID: Subject: Re: Full disable of C++20 time zone support To: Alexey Lapshin Cc: "jwakely@redhat.com" , "gcc-help@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: On Thu, 29 Jun 2023 at 10:16, Alexey Lapshin via Gcc-help wrote: > > > Which target are you building for? > > riscv32-esp-elf > > build with gcc v4.9.2 > > > I think this should fix it: > > This brings next errors: > > > gcc/libstdc++-v3/src/c++20/tzdb.cc:157:27: error: 'list_mutex' was not de= clared in this scope > gcc/libstdc++-v3/src/c++20/tzdb.cc:158:28: error: 'using std::chrono::tzd= b_list::_Node::head_ptr =3D class std::atomic >' {aka 'class std::atomic >'} has no member named 'get' > > > > Why it could not be disabled at all? like this: > > > --- a/libstdc++-v3/src/c++20/tzdb.cc > +++ b/libstdc++-v3/src/c++20/tzdb.cc > @@ -22,6 +22,8 @@ > // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see > // . > > +#ifndef TZDB_DISABLED That macro isn't even defined until later in the file, so would never be defined at this point. But more importantly, that would give linker errors when including . The point of that macro is to disable trying to process tzdata, not to create a broken libstdc++ with missing parts of the C++20 library. It should always be possible to call std::chrono::get_tzdb() even if the tzdb only contains the UTC time zone. > + > // The -Wabi warnings in this file are all for non-exported symbols. > #pragma GCC diagnostic ignored "-Wabi" > > @@ -2037,3 +2039,5 @@ namespace std::chrono > } // namespace > #endif // TZDB_DISABLED > } // namespace std::chrono > + > +#endif > > > > On Wed, 2023-06-28 at 20:40 +0100, Jonathan Wakely wrote: > > [External: This email originated outside Espressif] > > > > > > On Wed, 28 Jun 2023 at 20:33, Jonathan Wakely wrot= e: > > > On Wed, 28 Jun 2023 at 19:42, Alexey Lapshin wrote: > > > > Hi! > > > > > > > > I faced an issue with compiling libstdc++-v3/src/c++20/tzdb.cc: > > > > > > > > > > > > [ERROR] gcc/libstdc++-v3/src/c++20/tzdb.cc:110:21: error: 'const= init' variable 'std::chrono::{anonymous}::list_mutex' does not have a const= ant initializer > > > > [ERROR] gcc/libstdc++-v3/src/c++20/tzdb.cc:110:21: error: call t= o non-'constexpr' function 'std::mutex::mutex()' > > > > > > > > > > > > > > > > > Which target are you building for? > > > > > > > > > > > > > > Any plans to create a configure option to disable tzdb from build? = Or at least make it compilable? > > > > > > > > Tried --with-libstdcxx-zoneinfo=3Dno but it does not take effect, b= ecause it does not cover line with the bug. > > > > > > > > > > > > > Well then we should fix that. We don't want *another* configure optio= n when we already have two for tzdb. > > > > > > > > > I think this should fix it: > > > > --- a/libstdc++-v3/src/c++20/tzdb.cc > > +++ b/libstdc++-v3/src/c++20/tzdb.cc > > @@ -43,8 +43,8 @@ > > > > #ifndef __GTHREADS > > # define USE_ATOMIC_SHARED_PTR 0 > > -#elif _WIN32 > > -// std::mutex cannot be constinit, so Windows must use atomic>. > > +#elif ! defined __GTHREAD_MUTEX_INIT > > +// std::mutex cannot be constinit, so must use atomic>. > > # define USE_ATOMIC_SHARED_PTR 1 > > #elif ATOMIC_POINTER_LOCK_FREE < 2 > > # define USE_ATOMIC_SHARED_PTR 0 > > > > >