unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Enge <andreas@enge.fr>
To: guix-devel@gnu.org
Cc: Efraim Flashner <efraim@flashner.co.il>, 61879@debbugs.gnu.org
Subject: Re: Powerpc on core-updates
Date: Thu, 13 Apr 2023 11:51:51 +0200	[thread overview]
Message-ID: <ZDfQtykOvEaYc2Bh@jurong> (raw)
In-Reply-To: <ZDfMJmRxU+bf9DDa@jurong>

[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

I may as well try to provide a patch. It is untested even on x86_64,
since it requires quite a few rebuilds. If it works on powerpc, it should
probably be made conditional on the architecture to avoid a world rebuild.
I do not know whether this is possible in the patches field in an origin.

Andreas


[-- Attachment #2: 0001-gnu-gcc-11-Fix-build-on-powerpc64le.patch --]
[-- Type: text/plain, Size: 3561 bytes --]

From 5eb50bdc34759d4c917f2143e037fad62bc08ed7 Mon Sep 17 00:00:00 2001
From: Andreas Enge <andreas@enge.fr>
Date: Thu, 13 Apr 2023 11:46:47 +0200
Subject: [PATCH] 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 (gcc-11)[origin]: Use patch.
---
 gnu/local.mk                                   |  1 +
 gnu/packages/gcc.scm                           |  5 +++--
 .../patches/gcc-11-libstdc++-powerpc.patch     | 18 ++++++++++++++++++
 3 files changed, 22 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/gcc-11-libstdc++-powerpc.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index b07811f1cb..1255846462 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1184,6 +1184,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch   \
   %D%/packages/patches/gcc-12-cross-environment-variables.patch \
   %D%/packages/patches/gcc-10-tree-sra-union-handling.patch	\
+  %D%/packages/patches/gcc-11-libstdc++-powerpc.patch           \
   %D%/packages/patches/gcolor3-update-libportal-usage.patch	\
   %D%/packages/patches/gd-fix-tests-on-i686.patch		\
   %D%/packages/patches/gd-brect-bounds.patch			\
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index a511cdbc45..631e08db25 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2012-2023 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014, 2015, 2016, 2017, 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
+;;; Copyright © 2015, 2023 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2015-2018, 2020-2023 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
@@ -703,7 +703,8 @@ (define-public gcc-11
               "0fdclcwf728wbq52vphfcjywzhpsjp3kifzj3pib3xcihs0z4z5l"))
             (patches (search-patches "gcc-9-strmov-store-file-names.patch"
                                      "gcc-5.0-libvtv-runpath.patch"
-                                     "gcc-10-tree-sra-union-handling.patch"))
+                                     "gcc-10-tree-sra-union-handling.patch"
+                                     "gcc-11-libstdc++-powerpc.patch"))
             (modules '((guix build utils)))
             (snippet gcc-canadian-cross-objdump-snippet)))
    (arguments
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..aff2ef16f1
--- /dev/null
+++ b/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch
@@ -0,0 +1,18 @@
+diff -u -r gcc-11.3.0.alt/libstdc++-v3/src/c++17/floating_from_chars.cc gcc-11.3.0/libstdc++-v3/src/c++17/floating_from_chars.cc
+--- gcc-11.3.0.alt/libstdc++-v3/src/c++17/floating_from_chars.cc	2023-04-13 11:36:08.169841428 +0200
++++ gcc-11.3.0/libstdc++-v3/src/c++17/floating_from_chars.cc	2023-04-13 11:36:54.825827304 +0200
+@@ -495,8 +495,14 @@
+ from_chars(const char* first, const char* last, __ieee128& value,
+ 	   chars_format fmt) noexcept
+ {
++#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
-- 
2.39.2


  reply	other threads:[~2023-04-13  9:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87a60xcrdl.fsf@inria.fr>
2023-04-13  9:32 ` Powerpc on core-updates Andreas Enge
2023-04-13  9:51   ` Andreas Enge [this message]
2023-04-13 13:46   ` bug#61879: " Christopher Baines
2023-04-13 14:06     ` Andreas Enge

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZDfQtykOvEaYc2Bh@jurong \
    --to=andreas@enge.fr \
    --cc=61879@debbugs.gnu.org \
    --cc=efraim@flashner.co.il \
    --cc=guix-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).