GNU bug report logs -
#63940
[PATCH] gnu: sbcl: fix build on riscv64-linux.
Previous Next
Reported by: Z572 <873216071 <at> qq.com>
Date: Wed, 7 Jun 2023 05:44:02 UTC
Severity: normal
Tags: patch
Done: Efraim Flashner <efraim <at> flashner.co.il>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63940 in the body.
You can then email your comments to 63940 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#63940
; Package
guix-patches
.
(Wed, 07 Jun 2023 05:44:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Z572 <873216071 <at> qq.com>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Wed, 07 Jun 2023 05:44:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch: new file.
* gnu/local.mk(dist_patch_DATA): register it.
* gnu/packages/lisp.scm (sbcl): [source]<patches>: Use it here.
---
gnu/local.mk | 1 +
gnu/packages/lisp.scm | 3 +
...sbcl-riscv-Make-contribs-build-again.patch | 71 +++++++++++++++++++
3 files changed, 75 insertions(+)
create mode 100644 gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index f9afb433e6..254037a3af 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1895,6 +1895,7 @@ dist_patch_DATA = \
%D%/packages/patches/sbcl-clml-fix-types.patch \
%D%/packages/patches/sbcl-eazy-gnuplot-skip-path-check.patch \
%D%/packages/patches/sbcl-png-fix-sbcl-compatibility.patch \
+ %D%/packages/patches/sbcl-riscv-Make-contribs-build-again.patch \
%D%/packages/patches/scalapack-gcc-10-compilation.patch \
%D%/packages/patches/scheme48-tests.patch \
%D%/packages/patches/scons-test-environment.patch \
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 9e896cc8a5..296ed6b5f2 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -23,6 +23,7 @@
;;; Copyright © 2022 Joeke de Graaf <joeke <at> posteo.net>
;;; Copyright © 2021, 2022 jgart <jgart <at> dismail.de>
;;; Copyright © 2022 ( <paren <at> disroot.org>
+;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -440,6 +441,8 @@ (define-public sbcl
(sha256
(base32 "11ji5n65l31249r0v7hm0wc0yk2ila0y746nj36xn1cxrwh0gjc9"))
(modules '((guix build utils)))
+ ;; backport from upstream.
+ (patches (search-patches "sbcl-riscv-Make-contribs-build-again.patch"))
(snippet
'(begin
;; Don't force ARMv5.
diff --git a/gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch b/gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch
new file mode 100644
index 0000000000..85b96e1b20
--- /dev/null
+++ b/gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch
@@ -0,0 +1,71 @@
+From 8704f528f227f587d0e06dfd2f807aeca7a69a71 Mon Sep 17 00:00:00 2001
+From: Charles Zhang <charleszhang99 <at> yahoo.com>
+Date: Thu, 1 Jun 2023 16:39:26 +0200
+Subject: [PATCH] riscv: Make contribs build again.
+
+The issue was that the LINKAGE_TEMP_REG being NL3 was a C argument
+register, so of course that caused clashing on C call-out, causing
+problems with run-program. Going back to NL7 didn't work either
+because it wasn't getting saved before entry into the trampoline. The
+code here used to have NL7 before the trampoline code was gutted and
+then restored, so I'm wondering how this ever worked before, because
+it definitely did. Pick LIP as the TEMP_REG now because not only does
+it get saved, it's also the least likely thing to get disturbed by
+clobbering.
+
+Fixes #lp2002930.
+
+Also remove assembly routine printing because it doesn't need to be
+part of the build script (unlike the other files in output/ which
+can't trivially be recovered from a built image), and because not all
+disassembler printers have been written on riscv yet.
+---
+ NEWS | 3 +++
+ make-target-2-load.lisp | 4 ----
+ src/runtime/riscv-arch.c | 2 +-
+ 3 files changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 17537ff92..5c0f7777b 100644
+--- a/NEWS
++++ b/NEWS
+@@ -1,5 +1,8 @@
+ ;;;; -*- coding: utf-8; fill-column: 78 -*-
+
++changes relative to sbcl-2.3.5:
++ * bug fix: riscv can build contribs again.
++
+ changes in sbcl-2.3.5 relative to sbcl-2.3.4:
+ * enhancement: Unicode support has been updated to support version 15.0.0 of
+ the Unicode standard, including addition of characters and their collation
+diff --git a/make-target-2-load.lisp b/make-target-2-load.lisp
+index 885ebda74..b9a1a1e36 100644
+--- a/make-target-2-load.lisp
++++ b/make-target-2-load.lisp
+@@ -6,10 +6,6 @@
+ (defvar *compile-files-p* nil)
+ (load (merge-pathnames "src/cold/warm.lisp" *load-pathname*))
+
+-(with-open-file (stream "output/asm-routines.txt" :direction :output
+- :if-does-not-exist :create :if-exists :supersede)
+- (sb-c:dis sb-fasl:*assembler-routines* stream))
+-
+ ;; sb-xref-for-internals is actively harmful to tree-shaking.
+ ;; Remove some symbols to make the hide-packages test pass.
+ #+sb-xref-for-internals
+diff --git a/src/runtime/riscv-arch.c b/src/runtime/riscv-arch.c
+index 6c1994829..062623899 100644
+--- a/src/runtime/riscv-arch.c
++++ b/src/runtime/riscv-arch.c
+@@ -159,7 +159,7 @@ arch_install_interrupt_handlers(void)
+ * Linkage entry size is 8 or 20, because we need 2 instructions for the 32-bit case and we need 3 instructions and an 8 byte address in the 64-bit case.
+ */
+
+-#define LINKAGE_TEMP_REG reg_NL3
++#define LINKAGE_TEMP_REG reg_LIP // Lisp needs to save before entry.
+
+ void arch_write_linkage_table_entry(int index, void *target_addr, int datap)
+ {
+--
+2.40.1
+
--
2.40.1
Reply sent
to
Efraim Flashner <efraim <at> flashner.co.il>
:
You have taken responsibility.
(Wed, 07 Jun 2023 09:57:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Z572 <873216071 <at> qq.com>
:
bug acknowledged by developer.
(Wed, 07 Jun 2023 09:57:03 GMT)
Full text and
rfc822 format available.
Message #10 received at 63940-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Thanks. I wasn't looking forward to having to fix this one myself.
Patch pushed!
--
Efraim Flashner <efraim <at> 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
[signature.asc (application/pgp-signature, inline)]
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 05 Jul 2023 11:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 354 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.