Re: freeze for sbcl-2.6.3

Andreas Franke via Sbcl-devel <[email protected]> Thu, 26 Mar 2026 02:51:11 +0000
Newsgroups gmane.lisp.steel-bank.devel
Message-ID <trinity-3c6794f5-8c93-4490-a637-9c2b222e9e9a-1774493471784@trinity-msg-rest-gmx-gmx-live-6779b97d68-28n8h>
Thanks Christophe, btw magnolia blossoms taste delicious :-)

Regarding fixes: certainly neither regression nor critical, and I'm not saying we should add it now, but if we wanted to support cross-compile with known-broken ECL as distributed by current Ubuntu LTS, we could do so with the attached patch. Build passes all tests on arm64 and x86_64.

From Claude's summary:
> ECL 21.2.1's compiler emits  4294967295U  for  #xFFFFFFFF . In C,  4294967295U + 1  wraps to  0U . This caused  bignum-length  type to expand as  (mod 0) , crashing make-host-1.
> 
> ECL bug: 1aeb7823e (2020-03-07) introduced, f3d4cf4b6 (2022-01-15) fixed.  Ships in ECL 23.9.9+.  21.2.1 (current Debian/Ubuntu) affected.
>
> SBCL trigger:  2fd7b44f8  (2021-12-08) set  maximum-bignum-length to exactly  #xFFFFFFFF .
> 
> Fix:  src/compiler/generic/vm-type.lisp — 2 sites, avoid  (1+ #xFFFFFFFF) :
> -  bignum-length :  (mod ,(1+ N))  →  (integer 0 ,N) 
> -  bit-index :  (* (1+ N) W) - 1  →  (* N W) + (W - 1)

_______________________________________________
Sbcl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-devel
0001-Fix-cross-compile-for-known-broken-host-ECL-versions.patch (text/x-patch, 1.5 KB)
From 1836db8dbae96d641ef17db39daadc6ddae06a6c Mon Sep 17 00:00:00 2001
From: Andreas Franke <[email protected]>
Date: Thu, 26 Mar 2026 02:43:56 +0100
Subject: [PATCH] Fix cross-compile for known-broken host ECL versions

ECL 20.4.24 and 21.2.1 compile (1+ #xFFFFFFFF) to 0.
---
 src/compiler/generic/vm-type.lisp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/compiler/generic/vm-type.lisp b/src/compiler/generic/vm-type.lisp
index f324d80c6..ecc3ac314 100644
--- a/src/compiler/generic/vm-type.lisp
+++ b/src/compiler/generic/vm-type.lisp
@@ -63,7 +63,8 @@
 
 (sb-xc:deftype bignum-element-type () 'sb-vm:word)
 (sb-xc:deftype bignum-index () `(mod ,maximum-bignum-length))
-(sb-xc:deftype bignum-length () `(mod ,(1+ maximum-bignum-length)))
+;; Avoid overflow of (1+ #xFFFFFFFF) in ECL host compilers before 23.9.9
+(sb-xc:deftype bignum-length () `(integer 0 ,maximum-bignum-length))
 
 (sb-xc:deftype half-bignum-element-type () `(unsigned-byte ,(/ sb-vm:n-word-bits 2)))
 (sb-xc:deftype half-bignum-index () `(mod ,(* maximum-bignum-length 2)))
@@ -71,7 +72,10 @@
 
 ;;; an index into an integer
 (sb-xc:deftype sb-bignum:bit-index ()
-  `(integer 0 ,(- (* (1+ maximum-bignum-length) sb-vm:n-word-bits) 1)))
+  ;; Avoid overflow of (1+ #xFFFFFFFF) in ECL host compilers before 23.9.9
+  ;; was:      (- (* (1+ maximum-bignum-length) sb-vm:n-word-bits) 1)
+  `(integer 0 ,(+ (* maximum-bignum-length sb-vm:n-word-bits)
+                  (1- sb-vm:n-word-bits))))
 
 
 ;;;; hooks into the type system
-- 
2.34.1