Browse Source

lang/sbcl: Fix a regression in sbcl 2.2.7

PR:		265661
Reported by:	dmgk, jinxiaoyong@gmail.com
main
Kirill Ponomarev 5 days ago
parent
commit
5b9ecf3b2b
  1. 4
      lang/sbcl/Makefile
  2. 20
      lang/sbcl/files/patch-src_runtime_Config.x86-64-freebsd
  3. 16
      lang/sbcl/files/patch-src_runtime_stringspace.c
  4. 20
      lang/sbcl/files/patch-tests_save1.test.sh

4
lang/sbcl/Makefile

@ -5,7 +5,7 @@
PORTNAME= sbcl
DISTVERSION= 2.2.7
DISTVERSIONSUFFIX= -source
PORTREVISION= 1
PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= lang lisp
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${DISTVERSION} \
@ -143,7 +143,7 @@ post-patch:
${WRKSRC}/doc/manual/start-stop.texinfo
do-build:
(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} LINKFLAGS="${LDFLAGS}" ${SH} make.sh ${MAKE_SH_ARGS})
(cd ${WRKSRC} && ${SH} make.sh ${MAKE_SH_ARGS})
post-build-DOCS-on:
${DO_MAKE_BUILD} -C ${WRKSRC}/doc/manual info html

20
lang/sbcl/files/patch-src_runtime_Config.x86-64-freebsd

@ -0,0 +1,20 @@
From 9de74a0d4d0f1f38db5ae7e891480d8a4b4ad8d9 Mon Sep 17 00:00:00 2001
From: Douglas Katzman <dougk@google.com>
Date: Tue, 2 Aug 2022 14:40:28 -0400
Subject: [PATCH] Add /usr/local/include for freebsd
https://wiki.freebsd.org/WarnerLosh/UsrLocal says something about it.
Should fix lp#1981112.
--- src/runtime/Config.x86-64-freebsd.orig 2022-07-29 14:39:18 UTC
+++ src/runtime/Config.x86-64-freebsd
@@ -15,7 +15,8 @@ include Config.x86-64-bsd
# worked fine for most things, but LOAD-FOREIGN & friends require
# dlopen() etc., which in turn depend on dynamic linking of the
# runtime.
-OS_LIBS += -lutil
+OS_LIBS += -lutil -L/usr/local/lib
+CPPFLAGS += -isystem/usr/local/include
# use libthr (1:1 threading). libpthread (m:n threading) does not work.
ifdef LISP_FEATURE_SB_THREAD

16
lang/sbcl/files/patch-src_runtime_stringspace.c

@ -0,0 +1,16 @@
From 48d686f9718f98122547a9006c871cfcd50439ab Mon Sep 17 00:00:00 2001
From: Douglas Katzman <dougk@google.com>
Date: Sun, 31 Jul 2022 21:38:19 -0400
Subject: [PATCH] Accept that value-cell-value can move to R/O space
Fixes lp#1983218
--- src/runtime/stringspace.c.orig 2022-07-29 14:39:18 UTC
+++ src/runtime/stringspace.c
@@ -76,6 +76,7 @@ static void visit_pointer_words(lispobj* object, lispo
widetag == RATIO_WIDETAG || widetag == COMPLEX_WIDETAG ||
widetag == SIMPLE_ARRAY_WIDETAG ||
(widetag >= COMPLEX_BASE_STRING_WIDETAG && widetag <= COMPLEX_ARRAY_WIDETAG) ||
+ widetag == VALUE_CELL_WIDETAG ||
widetag == WEAK_POINTER_WIDETAG) {
int len = object_size(object), i;
for (i=1; i<len; ++i) FIX(object[i]);

20
lang/sbcl/files/patch-tests_save1.test.sh

@ -0,0 +1,20 @@
From 48d686f9718f98122547a9006c871cfcd50439ab Mon Sep 17 00:00:00 2001
From: Douglas Katzman <dougk@google.com>
Date: Sun, 31 Jul 2022 21:38:19 -0400
Subject: [PATCH] Accept that value-cell-value can move to R/O space
Fixes lp#1983218
--- tests/save1.test.sh.orig 2022-07-29 14:39:18 UTC
+++ tests/save1.test.sh
@@ -23,6 +23,11 @@ run_sbcl <<EOF
;; but maybe someone changed it :immobile, so bind it to be certain.
(let (#+immobile-code (sb-c::*compile-to-memory-space* :dynamic))
(defvar *afun* (compile nil '(lambda (x) (- (length x))))))
+ ;; test for lp#1983218 - a VALUE-CELL holding a readonly string could crash
+ (defun mkcell (x) (sb-sys:%primitive sb-vm::make-value-cell x nil))
+ (compile 'mkcell)
+ (defvar *cell* (mkcell (symbol-name '*print-base*)))
+ ;;
(save-lisp-and-die "$tmpcore")
EOF
run_sbcl_with_core "$tmpcore" --noinform --no-userinit --no-sysinit --noprint \
Loading…
Cancel
Save