summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Patterson <andrewpatt7@gmail.com>2022-11-17 21:53:01 -0500
committerGuillaume Le Vaillant <glv@posteo.net>2022-11-19 12:58:12 +0100
commitcc08d374b21f1326c2d70d5af84b56c0714a0885 (patch)
tree1fb476ab5763e1daba5b6cba8c3a8f80ed2f7ff6
parent854bdb7ba9abd6392da823f723553df03077e9a7 (diff)
downloadguix-cc08d374b21f1326c2d70d5af84b56c0714a0885.tar.gz
gnu: sbcl: Fix build on aarch64.
sbcl 2.2.10 currently doesn't build on aarch64.  Upstream has fixed the
issue (https://bugs.launchpad.net/sbcl/+bug/1996942), but this patch is
needed until the next release.

* gnu/packages/patches/sbcl-fix-build-on-arm64-with-clisp-as-host.patch: New
  file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/lisp.scm (sbcl)[source]: Use it.

Signed-off-by: Guillaume Le Vaillant <glv@posteo.net>
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/lisp.scm3
-rw-r--r--gnu/packages/patches/sbcl-fix-build-on-arm64-with-clisp-as-host.patch27
3 files changed, 31 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index f543a9350d..caf2fc69e3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1832,6 +1832,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/sbcl-aserve-fix-rfe12668.patch	\
   %D%/packages/patches/sbcl-burgled-batteries3-fix-signals.patch	\
   %D%/packages/patches/sbcl-clml-fix-types.patch		\
+  %D%/packages/patches/sbcl-fix-build-on-arm64-with-clisp-as-host.patch	\
   %D%/packages/patches/sbcl-png-fix-sbcl-compatibility.patch	\
   %D%/packages/patches/scalapack-gcc-10-compilation.patch	\
   %D%/packages/patches/scheme48-tests.patch			\
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 80018f8e1a..0749a02cd7 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -429,6 +429,9 @@ an interpreter, a compiler, a debugger, and much more.")
        (method url-fetch)
        (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
                            version "-source.tar.bz2"))
+       (patches
+        ;; TODO: remove this patch when updating to sbcl > 2.2.10.
+        (search-patches "sbcl-fix-build-on-arm64-with-clisp-as-host.patch"))
        (sha256
         (base32 "0cq8x4svkawirxq5s5gs4qxkl23m4q5p722a2kpss8qjfslc7hwc"))))
     (build-system gnu-build-system)
diff --git a/gnu/packages/patches/sbcl-fix-build-on-arm64-with-clisp-as-host.patch b/gnu/packages/patches/sbcl-fix-build-on-arm64-with-clisp-as-host.patch
new file mode 100644
index 0000000000..4fe3ed16db
--- /dev/null
+++ b/gnu/packages/patches/sbcl-fix-build-on-arm64-with-clisp-as-host.patch
@@ -0,0 +1,27 @@
+From 944f53fb00794f4bc96700dd14df1e88b6cd5623 Mon Sep 17 00:00:00 2001
+From: Christophe Rhodes <csr21@cantab.net>
+Date: Thu, 17 Nov 2022 22:29:26 +0000
+Subject: [PATCH] Fix build on arm64 with clisp as host
+
+Make sure the offset constants are defined while compiling vm.lisp.
+---
+ src/compiler/arm64/vm.lisp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/compiler/arm64/vm.lisp b/src/compiler/arm64/vm.lisp
+index ae6d7c7fa..2a151be58 100644
+--- a/src/compiler/arm64/vm.lisp
++++ b/src/compiler/arm64/vm.lisp
+@@ -23,7 +23,8 @@
+ (macrolet ((defreg (name offset)
+              (let ((offset-sym (symbolicate name "-OFFSET")))
+                `(progn
+-                  (defconstant ,offset-sym ,offset)
++                  (eval-when (:compile-toplevel :load-toplevel :execute)
++                    (defconstant ,offset-sym ,offset))
+                   (setf (svref *register-names* ,offset-sym) ,(symbol-name name)))))
+ 
+            (defregset (name &rest regs)
+-- 
+2.30.2
+