summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch
diff options
context:
space:
mode:
authorAndreas Enge <andreas@enge.fr>2023-04-13 11:46:47 +0200
committerChristopher Baines <mail@cbaines.net>2023-04-14 11:14:47 +0100
commit31dd526e1cfc3a70c72c8906bef8f26b91f39ce4 (patch)
treec4049f9c9332c9d91fbd3fe424c6992cf8131c8e /gnu/packages/patches/gcc-11-libstdc++-powerpc.patch
parent66b5d33c4ff8d146fa7f0e6e642008ac7e8cfb9d (diff)
gnu: gcc-11: Fix build on powerpc64le.
* gnu/packages/patches/gcc-11-libstdc++-powerpc.patch: New file. * gnu/local.mk (dist_patch_DATA): Register patch. * gnu/packages/gcc.scm (make-libstdc++): Apply patch for gcc versions >= 11 and < 12 on ppc64le. Co-authored-by: Christopher Baines <mail@cbaines.net> Signed-off-by: Christopher Baines <mail@cbaines.net>
Diffstat (limited to 'gnu/packages/patches/gcc-11-libstdc++-powerpc.patch')
-rw-r--r--gnu/packages/patches/gcc-11-libstdc++-powerpc.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch b/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch
new file mode 100644
index 0000000000..c0b96c3bc8
--- /dev/null
+++ b/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch
@@ -0,0 +1,20 @@
+--- a/libstdc++-v3/src/c++17/floating_from_chars.cc
++++ b/libstdc++-v3/src/c++17/floating_from_chars.cc
+@@ -495,10 +495,16 @@
+ from_chars(const char* first, const char* last, __ieee128& value,
+ chars_format fmt) noexcept
+ {
++ errc ec = errc::invalid_argument;
++#if _GLIBCXX_USE_CXX11_ABI
+ buffer_resource mr;
+ pmr::string buf(&mr);
++#else
++ string buf;
++ if (!reserve_string(buf))
++ return make_result(first, 0, {}, ec);
++#endif
+ size_t len = 0;
+- errc ec = errc::invalid_argument;
+ __try
+ {
+ if (const char* pat = pattern(first, last, fmt, buf)) [[likely]]