From: Andreas Ziegler <br015@umbiko.net>
To: Gleb Mazovetskiy <glex.spb@gmail.com>
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>,
Romain Naour <romain.naour@gmail.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
buildroot <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH] package/gcc: fix gcc12 with uClibc
Date: Thu, 22 Dec 2022 10:49:33 +0000 [thread overview]
Message-ID: <85f94ed27ffc69b7cc453d5f8a5505d7@umbiko.net> (raw)
In-Reply-To: <mailman.11703.1671657429.89793.buildroot@buildroot.org>
Fixes a recursive call to __nothrow_wait_cv::wait() in
libstdc++-v3/src/c++11/compatibility-condvar.cc which occurs whenever a
C++ application (gcc12 +uClibc) calls std::condition_variable::wait()
Also observed with: mpd using liburing.
Tested-by: Andreas Ziegler <br015@umbiko.net>
On 2022-12-21 12:52, Gleb Mazovetskiy <glex.spb@gmail.com> wrote:
> GCC 12 produces broken binaries when used with uClibc.
> E.g. `gdb` crashes on startup.
>
> This adds a patch to address the issue.
> The patch is from:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105730#c8
>
> Signed-off-by: Gleb Mazovetskiy <glex.spb@gmail.com>
> ---
> .../gcc/12.2.0/0002-fix-condvar-compat.patch | 33 +++++++++++++++++++
> 1 file changed, 33 insertions(+)
> create mode 100644 package/gcc/12.2.0/0002-fix-condvar-compat.patch
>
> diff --git a/package/gcc/12.2.0/0002-fix-condvar-compat.patch
> b/package/gcc/12.2.0/0002-fix-condvar-compat.patch
> new file mode 100644
> index 0000000000..9bbd481dbe
> --- /dev/null
> +++ b/package/gcc/12.2.0/0002-fix-condvar-compat.patch
> @@ -0,0 +1,33 @@
> +--- a/libstdc++-v3/src/c++11/compatibility-condvar.cc
> ++++ b/libstdc++-v3/src/c++11/compatibility-condvar.cc
> +@@ -67,6 +67,22 @@ _GLIBCXX_END_NAMESPACE_VERSION
> + && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
> + namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
> + {
> ++namespace
> ++{
> ++ std::__condvar std::condition_variable::* __base_member;
> ++
> ++ template<std::__condvar std::condition_variable::*X>
> ++ struct cracker
> ++ {
> ++ static std::__condvar std::condition_variable::* value;
> ++ };
> ++ template<std::__condvar std::condition_variable::*X>
> ++ std::__condvar std::condition_variable::*
> ++ cracker<X>::value = __base_member = X;
> ++
> ++ template class cracker<&std::condition_variable::_M_cond>;
> ++}
> ++
> + struct __nothrow_wait_cv : std::condition_variable
> + {
> + void wait(std::unique_lock<std::mutex>&) noexcept;
> +@@ -76,7 +92,7 @@ __attribute__((used))
> + void
> + __nothrow_wait_cv::wait(std::unique_lock<std::mutex>& lock) noexcept
> + {
> +- this->condition_variable::wait(lock);
> ++ (this->*__base_member).wait(*lock.mutex());
> + }
> + } // namespace __gnu_cxx
> --
> 2.37.2
>
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next parent reply other threads:[~2022-12-22 10:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.11703.1671657429.89793.buildroot@buildroot.org>
2022-12-22 10:49 ` Andreas Ziegler [this message]
2022-12-23 17:49 [Buildroot] [PATCH] package/gcc: fix gcc12 with uClibc Gleb Mazovetskiy
2022-12-27 21:27 ` Thomas Petazzoni via buildroot
2023-01-02 12:06 ` Peter Korsgaard
-- strict thread matches above, loose matches on Subject: below --
2022-12-21 20:03 Gleb Mazovetskiy
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=85f94ed27ffc69b7cc453d5f8a5505d7@umbiko.net \
--to=br015@umbiko.net \
--cc=buildroot@buildroot.org \
--cc=giulio.benetti@benettiengineering.com \
--cc=glex.spb@gmail.com \
--cc=romain.naour@gmail.com \
--cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.