From: Alexey Lapshin <alexey.lapshin@espressif.com>
To: "jwakely@redhat.com" <jwakely@redhat.com>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: Full disable of C++20 time zone support
Date: Thu, 29 Jun 2023 09:15:05 +0000 [thread overview]
Message-ID: <133e3d8a855c3d50ff5f9d9f198e5ae46fb97967.camel@espressif.com> (raw)
In-Reply-To: <CACb0b4=sOJu0zkBDRGX5u8wwySzwJtYgwaW9xTqi+V3pVyWABg@mail.gmail.com>
> 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 declared in this scope
gcc/libstdc++-v3/src/c++20/tzdb.cc:158:28: error: 'using std::chrono::tzdb_list::_Node::head_ptr = class std::atomic<std::shared_ptr<std::chrono::tzdb_list::_Node> >' {aka 'class std::atomic<std::shared_ptr<std::chrono::tzdb_list::_Node> >'} 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
// <http://www.gnu.org/licenses/>.
+#ifndef TZDB_DISABLED
+
// 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 <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
>
>
next prev parent reply other threads:[~2023-06-29 9:15 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
2023-06-29 9:15 ` Alexey Lapshin [this message]
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=133e3d8a855c3d50ff5f9d9f198e5ae46fb97967.camel@espressif.com \
--to=alexey.lapshin@espressif.com \
--cc=gcc-help@gcc.gnu.org \
--cc=jwakely@redhat.com \
/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).