Saturday, March 30, 2024

update lang/sbcl to 2.4.3 (test wanted on arm, powerpc, powerpc64)

Hi,

The following patch updates lang/sbcl to 2.4.3

I am interested to have it tested on:
- arm
- powerpc
- powerpc64

(for others archs, I have already tested it).

A build test is enough (running 'make' and see if it build successfully
or error-out).

The reason is 2.4.2 introduced some changes in the way some hashes are
generated (by using perfecthash). If it works well when using sbcl for
building itself (using FLAVOR=native_bootstrap), but it uses
pre-computed values for clisp or ecl, and fail to build if some values
are missing.

So before commiting the update, I would like to be sure to not break
arm, powerpc or powerpc64... I already added bits for i386. amd64 and
aarch64 was fine.

The Makefile also includes few changes to error-out early (and have the
error message at the end of the build, instead of several lines before).

The post-extract changes will help to get the missing bits for
perfecthash:
- if usual build failed
- install sbcl from package (pkg_add -a sbcl)
- build sbcl using sbcl (env FLAVOR=native_bootstrap make) - it is a quick build (usually 5~10min)
- update the patches to get the new bits (env FLAVOR=native_bootstrap make update-patches)
- build 'normally' using the changed patches (make)

Thanks.
--
Sebastien Marie


Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/sbcl/Makefile,v
diff -u -p -r1.66 Makefile
--- Makefile 3 Feb 2024 07:21:34 -0000 1.66
+++ Makefile 30 Mar 2024 10:36:06 -0000
@@ -4,7 +4,7 @@ ONLY_FOR_ARCHS += aarch64 amd64 arm i386

COMMENT = high performance Common Lisp compiler

-V = 2.4.1
+V = 2.4.3
DISTNAME = sbcl-${V}-source
PKGNAME = sbcl-${V}

@@ -55,11 +55,13 @@ XCHOST_CMD = ${LOCALBASE}/bin/sbcl \

.elif ${BOOTSTRAP_METHOD:Mclisp}
BUILD_DEPENDS += lang/clisp
-XCHOST_CMD = ${LOCALBASE}/bin/clisp -q -norc
+XCHOST_CMD = ${LOCALBASE}/bin/clisp \
+ -q -norc -on-error exit

.elif ${BOOTSTRAP_METHOD:Mecl}
BUILD_DEPENDS += lang/ecl
-XCHOST_CMD = ${LOCALBASE}/bin/ecl -q --norc
+XCHOST_CMD = ${LOCALBASE}/bin/ecl \
+ -q --norc --load ${.CURDIR}/files/ecl-nodebugger.lisp

.else
ERRORS += "Fatal: unknown BOOTSTRAP_METHOD"
@@ -87,11 +89,20 @@ MAKE_ENV += CFLAGS="${CFLAGS} -I${LOCAL
LINKFLAGS="-L${LOCALBASE}/lib" \
MAKEINFO=${PREFIX}/bin/gmakeinfo \
MAN_DIR="${PREFIX}/man/" \
- INFO_DIR="${PREFIX}/info/"
+ INFO_DIR="${PREFIX}/info/" \
+ SBCL_MAKE_JOBS="-j${MAKE_JOBS}"

USE_GMAKE = Yes

DEBUG_PACKAGES = ${BUILD_PACKAGES}
+
+post-extract:
+# the build might modify some files. keep original files to help creating patches.
+.if ${FLAVOR:Mnative_bootstrap}
+. for nn in 30 61 63
+ cp ${WRKSRC}/xperfecthash${nn}.lisp-expr{,${PATCHORIG}}
+. endfor
+.endif

do-configure:
printf '"%s.%s.%s"\n' "${V}" "openbsd" "${FULLPKGNAME}" \
Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/sbcl/distinfo,v
diff -u -p -r1.31 distinfo
--- distinfo 3 Feb 2024 07:21:34 -0000 1.31
+++ distinfo 30 Mar 2024 10:36:06 -0000
@@ -1,2 +1,2 @@
-SHA256 (sbcl-2.4.1-source.tar.bz2) = 2k+UhvrUE9OversbCSaTJf20v/fnuI8hld3udDJjz34=
-SIZE (sbcl-2.4.1-source.tar.bz2) = 7800453
+SHA256 (sbcl-2.4.3-source.tar.bz2) = icmq35K4KtPHSj1PFYoDiJPeoOTzlNyvyWNYPDC3w/I=
+SIZE (sbcl-2.4.3-source.tar.bz2) = 8126417
Index: files/ecl-nodebugger.lisp
===================================================================
RCS file: files/ecl-nodebugger.lisp
diff -N files/ecl-nodebugger.lisp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/ecl-nodebugger.lisp 30 Mar 2024 10:36:06 -0000
@@ -0,0 +1,6 @@
+;; define a debugger hook which exit early
+(setf *debugger-hook*
+ (lambda (c fun)
+ (princ c)
+ (si::tpl-backtrace)
+ (quit 1)))
Index: patches/patch-xperfecthash30_lisp-expr
===================================================================
RCS file: patches/patch-xperfecthash30_lisp-expr
diff -N patches/patch-xperfecthash30_lisp-expr
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-xperfecthash30_lisp-expr 30 Mar 2024 10:36:06 -0000
@@ -0,0 +1,28 @@
+Add some missing entries for bootstrapping from no-sbcl on i386
+
+Index: xperfecthash30.lisp-expr
+--- xperfecthash30.lisp-expr.orig
++++ xperfecthash30.lisp-expr
+@@ -2322,5 +2322,22 @@
+ (#(73FB831 85FCC7A 1025CF34 1A13A884 1CA0C5B8)
+ "(REAL FLOAT DOUBLE-FLOAT SINGLE-FLOAT RATIONAL)"
+ "( (& (+ (>> val 18) (>> val 22)) 7))")
++(#(B1B342 207D684 20BE5F4 27E4E79 34001B1 34EBEE5 35C8E17 3CC42AC 4BB7808 4C4FB75 5502DD7 70F5EF0 8E1655F 8FFB29F 9D14A2B
++ A8542A3 AD2E8E6 B0580F9 BE9B4CB C042E4D E824A51 EF70D00 FB43EC2 10D39C38 114F77D4 116E414E 118F7907 11AD100A 11E583E7
++ 11FF1DFE 12B50090 13B30D76 13D394E1 14287725 159AB905 15E063C2 17AAEED6 17BE5DB2 17D87E68 183A215C 1A66777D 1E25A858
++ 1EFFF46E 1F125097)
++ "#(T *FREE-INTERRUPT-CONTEXT-INDEX* *ALLOW-WITH-INTERRUPTS* *INTERRUPTS-ENABLED* *INTERRUPT-PENDING* *IN-WITHOUT-GCING* *GC-INHIBIT* *GC-PENDING* SB-IMPL::*UNWEAKENED-VECTORS* SB-VM::*PINNED-OBJECTS* *GC-PIN-CODE-PAGES* SB-VM:*CURRENT-CATCH-BLOCK* SB-VM::*CURRENT-UNWIND-PROTECT-BLOCK* SB-VM::*IMMOBILE-CODEBLOB-TREE* SB-VM::*IMMOBILE-CODEBLOB-VECTOR* SB-VM::*DYNSPACE-CODEBLOB-TREE* SB-IMPL::**FINALIZER-STORE** SB-IMPL::*FINALIZER-REHASHLIST* SB-IMPL::*FINALIZERS-TRIGGERED* SB-VM:*BINDING-STACK-START* SB-VM:*CONTROL-STACK-START* SB-VM:*CONTROL-STACK-END* *STEPPING* SB-VM::*FREE-TLS-INDEX* SB-VM::+REQUIRED-FOREIGN-SYMBOLS+ *GC-EPOCH* %%DATA-VECTOR-REFFERS%% SB-VM::%%DATA-VECTOR-REFFERS/CHECK-BOUNDS%% %%DATA-VECTOR-SETTERS%% SB-VM::%%DATA-VECTOR-SETTERS/CHECK-BOUNDS%% SB-C:*ALIEN-STACK-POINTER* *PSEUDO-ATOMIC-BITS* SB-VM::*BINDING-STACK-POINTER* SB-VM::*FP-CONSTANT-0D0* SB-VM::*FP-CONSTANT-1D0* SB-VM::*FP-CONSTANT-0F0* SB-VM::*FP-CONSTANT-1F0* SB-VM::*FP-CONSTANT-0L0* SB-VM::*FP-CONSTANT-1L0* SB-VM::*FP-CONSTANT-PI* SB-VM::*FP-CONSTANT-L2T* SB-VM::*FP-CONSTANT-L2E* SB-VM::*FP-CONSTANT-LG2* SB-VM::*FP-CONSTANT-LN2*)"
++ "((let ((tab #a((32) (unsigned-byte 8) 28 28 0 36 34 0 51 0 0 0 34 19 51 41 0 0 19 18 19 0 9 59 46 0 9 16 0 0 11 12 52 57)))
++ (let ((b (& val #x1f)))
++ (let ((a (>> (<< val 9) 27)))
++ (^ a (aref tab b))))))")
++(#(B17EA B621A 765909 CA4AAA 261EC99 2740F12 2DCA563 3338509 4838F98 5408EC3 54FE9F6 620099A AA84B76 BFFC3D4 D514142 DC65EEE
++ E5D1897 EDFD052 FA21765 10E2FDD1 11191CE8 1278BFE6 13632D1F 13FFF4F3 1451524B 169E1DF6 16AAD643 1712EA5F 17A76ECC 1806A438
++ 187CC43D 18AD9421 19C62B17 1ABE4E69 1BBA8D9F 1C5C0C65 1CDF5674 1D7BD61D 1DC4409C 1F038512 1F354480 1F7C3062)
++ "#(SUB-GC POST-GC INTERNAL-ERROR CONTROL-STACK-EXHAUSTED-ERROR BINDING-STACK-EXHAUSTED-ERROR ALIEN-STACK-EXHAUSTED-ERROR HEAP-EXHAUSTED-ERROR UNDEFINED-ALIEN-VARIABLE-ERROR MEMORY-FAULT-ERROR UNHANDLED-TRAP-ERROR UNDEFINED-ALIEN-FUN-ERROR SB-DI::HANDLE-BREAKPOINT SB-DI::HANDLE-SINGLE-STEP-TRAP ENTER-ALIEN-CALLBACK TWO-ARG-+ TWO-ARG-- TWO-ARG-* TWO-ARG-/ TWO-ARG-< TWO-ARG-> TWO-ARG-= EQL %NEGATE LENGTH ERROR FORMAT EQUALP SB-C::CHECK-DS-LIST SB-C::CHECK-DS-LIST/&REST WRITE-STRING WRITE-CHAR PRINC HAIRY-DATA-VECTOR-SET HAIRY-DATA-VECTOR-REF VECTOR-HAIRY-DATA-VECTOR-SET VECTOR-HAIRY-DATA-VECTOR-REF HAIRY-DATA-VECTOR-SET/CHECK-BOUNDS HAIRY-DATA-VECTOR-REF/CHECK-BOUNDS VECTOR-HAIRY-DATA-VECTOR-SET/CHECK-BOUNDS VECTOR-HAIRY-DATA-VECTOR-REF/CHECK-BOUNDS %LDB VECTOR-UNSIGNED-BYTE-8-P)"
++ "((let ((tab #a((32) (unsigned-byte 8) 36 46 7 0 0 19 7 0 0 0 0 60 28 0 7 0 0 7 9 26 31 0 9 51 33 59 9 0 13 57 0 9)))
++ (let ((b (& val #x1f)))
++ (let ((a (>> (<< val 9) 27)))
++ (^ a (aref tab b))))))")
+ )
+ ;; EOF

No comments:

Post a Comment