sbcl currently fails to build on aarch64

  • Done
  • quality assurance status badge
Details
2 participants
  • Andrew Patterson
  • Guillaume Le Vaillant
Owner
unassigned
Submitted by
Andrew Patterson
Severity
normal
A
A
Andrew Patterson wrote on 17 Nov 2022 06:06
(address . bug-guix@gnu.org)
8735aijgyb.fsf@gmail.com
The genesis subdirectory of src/runtime doesn't exist, so the
build fails. Building on x86_64 successfully gets past the point
where it fails on aarch64/arm64.

Log attached:
Attachment: file
--
Andrew Patterson

There are two types of people:
1. People who use 1-based indexing.
1. People who use 0-based indexing.
--achenx,
G
G
Guillaume Le Vaillant wrote on 17 Nov 2022 16:47
(name . Andrew Patterson)(address . andrewpatt7@gmail.com)(address . 59331@debbugs.gnu.org)
87cz9lh8u6.fsf@kitej
Andrew Patterson <andrewpatt7@gmail.com> skribis:

Toggle quote (4 lines)
> The genesis subdirectory of src/runtime doesn't exist, so the build fails.
> Building on x86_64 successfully gets past the point where it fails on
> aarch64/arm64.

From the build log, it looks like the "make-host-1" part of SBCL's build
exits prematurely because of the following error:

Toggle snippet (14 lines)
;; Compiling file /tmp/guix-build-sbcl-2.2.10.drv-0/sbcl-2.2.10/src/compiler/arm64/vm.lisp ...
*** - IF: variable NULL-OFFSET has no value
The following restarts are available:
USE-VALUE :R1 Input a value to be used instead of NULL-OFFSET.
STORE-VALUE :R2 Input a new value for NULL-OFFSET.
RECOMPILE :R3 Recompile file "src/compiler/arm64/vm.lisp"
RECOMPILE :R4 Recompile
SKIP :R5 skip (MAYBE-WITH-COMPILATION-UNIT # # ...)
RETRY :R6 retry (MAYBE-WITH-COMPILATION-UNIT # # ...)
STOP :R7 stop loading file /tmp/guix-build-sbcl-2.2.10.drv-0/sbcl-2.2.10/make-host-1.lisp
ABORT-BUILD :R8 Abort building SBCL.
ABORT :R9 Abort main loop

Have you asked upstream if they know what could cause this error?
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCY3ZaAQ8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j8qIQD/XYIIyXs2X+V8xZL7JVXVz2yq2UyDp2qZN/Rf
bwuIRB0A/jlvTtgMxngYPt+7jMEv991aMU7i3gjP4SxsdDzfqVco
=CD9y
-----END PGP SIGNATURE-----

A
A
Andrew Patterson wrote on 17 Nov 2022 20:57
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 59331@debbugs.gnu.org)
87y1s9ic5y.fsf@gmail.com
On Thu, 2022-11-17 at 15:47GMT, Guillaume Le Vaillant
<glv@posteo.net> wrote:
Toggle quote (9 lines)
> From the build log, it looks like the "make-host-1" part of
> SBCL's build
> exits prematurely because of the following error:
>
> [...NULL-OFFSET undefined...]
>
> Have you asked upstream if they know what could cause this
> error?

I'll do that and report back.

--
Andrew Patterson
A
A
Andrew Patterson wrote on 18 Nov 2022 20:37
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 59331@debbugs.gnu.org)
87cz9khwwp.fsf@gmail.com
I contacted upstream
a fix and sent me a patch. I tried to make a patch to guix that
would fix it, but the patch apparently isn't being applied just by
adding it to the patches field of the origin and I'm not sure why.

My current effort is attached.
From 29d58ab55a3c6d2e626274c6a9f2ab8cfcc57d06 Mon Sep 17 00:00:00 2001
From: Andrew Patterson <andrewpatt7@gmail.com>
Date: Thu, 17 Nov 2022 21:53:01 -0500
Subject: [PATCH] gnu: sbcl: Fix build on aarch64

sbcl 2.2.10 currently doesn't build on aarch64. Upstream has fixed the
needed until the next release.
---
gnu/packages/lisp.scm | 1 +
...ix-build-on-arm64-with-clisp-as-host.patch | 27 +++++++++++++++++++
2 files changed, 28 insertions(+)
create mode 100644 gnu/packages/patches/sbcl-fix-build-on-arm64-with-clisp-as-host.patch

Toggle diff (47 lines)
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 80018f8e1a..1b6b08d72f 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -429,6 +429,7 @@ (define-public sbcl
(method url-fetch)
(uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
version "-source.tar.bz2"))
+ (patches (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
+
--
2.38.1
--
Andrew Patterson
A
A
Andrew Patterson wrote on 19 Nov 2022 06:00
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 59331@debbugs.gnu.org)
878rk7il4l.fsf@gmail.com
...or I could just be an idiot. (I somehow thought that
pre-inst-env would work without... actually compiling the changed
guix repo, if the only changes were in a package definition, which
is in retrospect dumb.)

The previously attached patch works.

Sorry for the confusion.

--
Andrew Patterson
G
G
Guillaume Le Vaillant wrote on 19 Nov 2022 13:04
(name . Andrew Patterson)(address . andrewpatt7@gmail.com)(address . 59331-done@debbugs.gnu.org)
874juv6te2.fsf@kitej
I registered the new patch file in "gnu/local.mk" and pushed as
cc08d374b21f1326c2d70d5af84b56c0714a0885.
Thanks.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCY3jGtQ8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j8itwD+KGk2D6BD9uGqI5Tnimi99kfKzbAFt0rdzLSU
HgiEM44A/0y+VbYxqO2MugqEd3ezz+D6eJlpiY6StiRrEqrCO9id
=DdGJ
-----END PGP SIGNATURE-----

Closed
A
A
Andrew Patterson wrote on 19 Nov 2022 19:19
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 59331-done@debbugs.gnu.org)
874juuiz85.fsf@gmail.com
Thanks!

--
Andrew Patterson
Closed
?