https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120567
--- Comment #5 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #4)
> I assume so - I don't think we changed anything that would fix it.
>
> I should probably do this:
>
> diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
> index e4eb773144af..da5bc2b089b8 100644
> --- a/libstdc++-v3/acinclude.m4
> +++ b/libstdc++-v3/acinclude.m4
> @@ -5316,7 +5316,7 @@ EOF
>
> AC_MSG_CHECKING([for atomic builtins for libbacktrace])
> if AC_TRY_EVAL(ac_compile); then
> - if grep __atomic_ conftest.s >/dev/null 2>&1 ; then
> + if grep -E '__atomic_|__sync_' conftest.s >/dev/null 2>&1 ; then
> glibcxx_cv_libbacktrace_atomics=no
> else
> glibcxx_cv_libbacktrace_atomics=yes
> diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
> index b1e1275c47f4..8c1c12823ec8 100755
> --- a/libstdc++-v3/configure
> +++ b/libstdc++-v3/configure
> @@ -53996,7 +53996,7 @@ $as_echo_n "checking for atomic builtins for
> libbacktrace... " >&6; }
> ac_status=$?
> $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> test $ac_status = 0; }; then
> - if grep __atomic_ conftest.s >/dev/null 2>&1 ; then
> + if grep -E '__atomic_|__sync_' conftest.s >/dev/null 2>&1 ; then
> glibcxx_cv_libbacktrace_atomics=no
> else
> glibcxx_cv_libbacktrace_atomics=yes
>
>
> So that we treat extern calls to __sync_synchronize as "no native atomics".
There's an identical test earlier in those files that also wants change.
FWIW, the test 19_diagnostics/stacktrace/output.cc fails for CRIS (since 2023),
but patching just this one or both places did not help (no further analysis
except as far as I noticing I was likely mistaken that it was the same
failure).