bug#45214: guile segfaults on 32-bit big-endian targets

Efraim Flashner <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <YHb5vOs0bS+bjA5+@3900XT>
On Thu, Feb 25, 2021 at 05:24:04PM +0200, Efraim Flashner wrote:
> On Sat, Dec 12, 2020 at 11:02:47PM +0100, John Paul Adrian Glaubitz wrote:
> > Hi!
> > 
> > On 12/12/20 11:00 PM, John David Anglin wrote:
> > > Trying to bisect.
> > 
> > Bisecting lead me to this which I guess is just painting over the real
> > problem:
> > 
> > (sid_powerpc-dchroot)glaubitz@perotto:~/guile-git$ git bisect good
> > a68c80c747a2a8ec92fa84684ebd60b4ecb7ffa0 is the first bad commit
> > commit a68c80c747a2a8ec92fa84684ebd60b4ecb7ffa0
> > Author: Andy Wingo <[email protected]>
> > Date:   Mon May 11 15:22:29 2020 +0200
> > 
> >     Switch to baseline compiler for bootstrap/
> > 
> >     * bootstrap/Makefile.am (GUILE_OPTIMIZATIONS): Add -Ono-cps so that we
> >       use the baseline compiler when bootstrapping.
> > 
> >  bootstrap/Makefile.am | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > (sid_powerpc-dchroot)glaubitz@perotto:~/guile-git$
> > 
> 
> I came to the same conclusion when I tried to bisect the git repo
> between 3.0.2 and 3.0.3 on my powerpc machine. By reverting that commit
> I was able to build 44ad8fbde55df452ac1c88427662403e7af5b9bb (3.0.2-70,
> 6 commit later) but wasn't able to build 3.0.3. I started the build
> without any precompiled bootstrap .go files.
> 

I spent some more time bisecting guile so I could create a diff against
3.0.5 and then spent another two weeks or so bootstrapping Guix from my
custom bootstrap binaries out to mesa.

I've attached the patch that's likely to go into Guix to add powerpc
support. Other than the mysterious failing test I've changed the
GUILE_OPTIMIZATIONS in bootstrap/Makefile.in to '-O1
-Oresolve-primitives -Ocps' on powerpc and it seems to be working fine.


-- 
Efraim Flashner   <[email protected]>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
0002-gnu-guile-3.0-Fix-building-on-powerpc-linux.patch (text/plain, 2.3 KB)
From c11ad7faa3690b2dfef924a31137f6ced5aab23f Mon Sep 17 00:00:00 2001
Message-Id: <c11ad7faa3690b2dfef924a31137f6ced5aab23f.1617711307.git.efraim@flashner.co.il>
In-Reply-To: <[email protected]>
References: <[email protected]>
From: Efraim Flashner <[email protected]>
Date: Mon, 8 Mar 2021 22:13:56 +0200
Subject: [PATCH 2/9] gnu: guile-3.0: Fix building on powerpc-linux.

* gnu/packages/guile.scm (guile-3.0)[arguments]: On powerpc add two
phases to adjust for 32-bit big-endian systems.
---
 gnu/packages/guile.scm | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index f63322794d..dca1b1c16f 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -305,7 +305,26 @@ without requiring the source code to be rewritten.")
          (substitute-keyword-arguments (package-arguments guile-2.2)
            ((#:configure-flags flags ''())
             `(cons "--disable-jit" ,flags)))
-         (package-arguments guile-2.2)))
+         (if (string-prefix? "powerpc-" (%current-system))
+           (substitute-keyword-arguments (package-arguments guile-2.2)
+             ((#:phases phases)
+              `(modify-phases ,phases
+                 (add-after 'unpack 'adjust-bootstrap-flags
+                   (lambda _
+                     ;; Upstream not yet notified about suggested solution.
+                     ;; See existing bug reports:
+                     ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45214
+                     ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=977223
+                     (substitute* "bootstrap/Makefile.in"
+                       (("^GUILE_OPTIMIZATIONS.*")
+                        "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n"))
+                     #t))
+                 (add-after 'unpack 'remove-failing-tests
+                   (lambda _
+                     ;; TODO: Discover why this test fails on powerpc-linux
+                     (delete-file "test-suite/standalone/test-out-of-memory")
+                     #t)))))
+           (package-arguments guile-2.2))))
     (native-search-paths
      (list (search-path-specification
             (variable "GUILE_LOAD_PATH")
-- 
2.31.1
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmB2+bwACgkQQarn3Mo9
g1FljQ//Y+wGjBmpvPGRkCQ3o0o+ql5TLyyvhMd0nj4ZEpM0iRvo4Bc/2xZzwMFl
Wu1+4BFqEffFPVLF2VH/NQS2/4Tugn39AtIlnyTBdpnEBYgVTLuUeIBD/mlNR8ip
wYAtXARpcXvReWDkq7IswsDQHuZGsyJYQgEASs4WtvWe1UZKylqDxsw7uniE713j
N4mbsK9rQOGmgdrJ68WYaLe+8R+Jbn1zx5FlczPUWKl858YT0BfZgrrXslJMV8lJ
erU81mkM3C77VkSoL89CdKECe9+i7E3b0f6IFi0k0c7STz6kAXFuCOEA91raQDBk
SRgvqtYbIMlEoIM4K6w4ITenR64yeQRgHzjqzm6NAv2S2UusmxDoMLM99KET2A0W
5TQXi3pXwp4mFFnkMVVN8T4EpXQNR3RBU7tiisfXH0pG1EQIfea/4QrQdccAOMhb
VGjd5gnTg1Z6UzHTMqUFCErebbiTZ4ZPhLsnT0QoFRGiCNK/xE52X5K4xdQRTGQb
8+rZWUCQIAqDfctR/XT14PEGFiNlHXNQC3utd2NP0BfgrUhvrWrtWbsofGU3M0gW
Ven+Ddq9ylinQWiqXYSHmLnPlqCv4wlD7KX2jzgKK2Ak1cMBAYsS9QrixsdfEDC+
2vE9mXoAsKh8GUxOYLfG17Sn/+iFR676bdrxBo6qitn6Q485n7k=
=KxII
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.