public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Alexey Lapshin <alexey.lapshin@espressif.com>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: Full disable of C++20 time zone support
Date: Wed, 28 Jun 2023 20:40:21 +0100	[thread overview]
Message-ID: <CACb0b4=sOJu0zkBDRGX5u8wwySzwJtYgwaW9xTqi+V3pVyWABg@mail.gmail.com> (raw)
In-Reply-To: <CACb0b4km+ic-PgoxSaM6h=b9jezr7rjXcVBwdYuFBrzwgBicwA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1376 bytes --]

On Wed, 28 Jun 2023 at 20:33, Jonathan Wakely <jwakely@redhat.com> wrote:

> 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: 'constinit'
>> variable 'std::chrono::{anonymous}::list_mutex' does not have a constant
>> initializer
>> [ERROR]    gcc/libstdc++-v3/src/c++20/tzdb.cc:110:21: error: call to
>> 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=no but it does not take effect, because
>> it does not cover line with the bug.
>>
>
> Well then we should fix that. We don't want *another* configure option
> 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<shared_ptr<>>.
+#elif ! defined __GTHREAD_MUTEX_INIT
+// std::mutex cannot be constinit, so must use atomic<shared_ptr<>>.
 # define USE_ATOMIC_SHARED_PTR 1
 #elif ATOMIC_POINTER_LOCK_FREE < 2
 # define USE_ATOMIC_SHARED_PTR 0

  reply	other threads:[~2023-06-28 19:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28 18:42 Alexey Lapshin
2023-06-28 19:33 ` Jonathan Wakely
2023-06-28 19:40   ` Jonathan Wakely [this message]
2023-06-29  9:15     ` Alexey Lapshin
2023-06-29  9:23       ` Jonathan Wakely
2023-06-29  9:27         ` Alexey Lapshin
2023-06-29  9:39           ` Jonathan Wakely
2023-06-29 12:11             ` Jonathan Wakely
2023-06-29 13:51               ` Alexey Lapshin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACb0b4=sOJu0zkBDRGX5u8wwySzwJtYgwaW9xTqi+V3pVyWABg@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=alexey.lapshin@espressif.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).