Re: Full disable of C++20 time zone support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 28 Jun 2023 at 20:33, Jonathan Wakely <jwakely@xxxxxxxxxx> 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



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux