unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: deller@gmx.de, dave.anglin@bell.net, schwab@linux-m68k.org,
	45214@debbugs.gnu.org, debian@mkarcher.dialup.fu-berlin.de
Subject: bug#45214: guile segfaults on 32-bit big-endian targets
Date: Wed, 14 Apr 2021 17:18:36 +0300	[thread overview]
Message-ID: <YHb5vOs0bS+bjA5+@3900XT> (raw)
In-Reply-To: <YDfBFMiMjps6gMKe@3900XT>


[-- Attachment #1.1: Type: text/plain, Size: 1989 bytes --]

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 <wingo@pobox.com>
> > 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   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #1.2: 0002-gnu-guile-3.0-Fix-building-on-powerpc-linux.patch --]
[-- Type: text/plain, Size: 2374 bytes --]

From c11ad7faa3690b2dfef924a31137f6ced5aab23f Mon Sep 17 00:00:00 2001
Message-Id: <c11ad7faa3690b2dfef924a31137f6ced5aab23f.1617711307.git.efraim@flashner.co.il>
In-Reply-To: <cover.1617711307.git.efraim@flashner.co.il>
References: <cover.1617711307.git.efraim@flashner.co.il>
From: Efraim Flashner <efraim@flashner.co.il>
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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-04-14 14:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-12 21:26 bug#45214: guile segfaults on 32-bit big-endian targets John Paul Adrian Glaubitz
2020-12-12 22:00 ` John David Anglin
2020-12-12 22:02   ` John Paul Adrian Glaubitz
2021-02-25 15:24     ` Efraim Flashner
2021-04-14 14:18       ` Efraim Flashner [this message]
2021-04-14 19:19         ` John Paul Adrian Glaubitz
2021-04-15 11:50           ` Efraim Flashner
2021-04-15 13:23             ` John Paul Adrian Glaubitz
2021-10-03  9:38         ` John Paul Adrian Glaubitz
2021-10-04 16:08           ` John David Anglin
2021-10-04 16:11             ` John Paul Adrian Glaubitz
2020-12-12 22:21 ` John David Anglin
2020-12-12 22:30   ` John David Anglin
2020-12-12 22:44     ` John David Anglin
2020-12-12 22:47       ` John Paul Adrian Glaubitz
2020-12-12 23:22         ` John David Anglin
2020-12-13 18:06         ` John David Anglin
2020-12-13 18:08           ` John Paul Adrian Glaubitz
2021-02-08 23:24   ` John David Anglin
2021-02-09 13:03     ` John David Anglin

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://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=YHb5vOs0bS+bjA5+@3900XT \
    --to=efraim@flashner.co.il \
    --cc=45214@debbugs.gnu.org \
    --cc=dave.anglin@bell.net \
    --cc=debian@mkarcher.dialup.fu-berlin.de \
    --cc=deller@gmx.de \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=schwab@linux-m68k.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.
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).