Sunday, December 02, 2018

[update] sbcl-1.4.14

Hi,

Here's an update to SBCL to bring it to latest version as I noticed the release
fixes the thread support on OpenBSD.

This also changes the thread backend to futex and adds support for core
compression using zlib.

I haven't tested this that much yet but tests seem to pass on amd64 at
least with it.

Timo

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/sbcl/Makefile,v
retrieving revision 1.38
diff -u -p -u -p -r1.38 Makefile
--- Makefile 24 Jun 2018 18:33:36 -0000 1.38
+++ Makefile 3 Dec 2018 07:06:41 -0000
@@ -6,7 +6,7 @@ USE_WXNEEDED = Yes

COMMENT= compiler and runtime system for ANSI Common Lisp

-V = 1.4.8
+V = 1.4.14
DISTNAME= sbcl-${V}-source
PKGNAME= sbcl-${V}
WRKDIST= ${WRKDIR}/sbcl-${V}
@@ -21,7 +21,7 @@ PERMIT_PACKAGE_CDROM= Yes

MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=sbcl/}

-WANTLIB= c m util
+WANTLIB= c m util z

PSEUDO_FLAVORS= native_bootstrap

@@ -30,10 +30,10 @@ PSEUDO_FLAVORS= native_bootstrap
FLAVORS= threads
FLAVOR?=

-EXTRA_PARAMS=
+EXTRA_PARAMS= --with-sb-core-compression
.if ${FLAVOR:Mthreads}
ONLY_FOR_ARCHS = amd64
-EXTRA_PARAMS+= --with-sb-thread
+EXTRA_PARAMS+= --with-sb-thread --with-sb-futex
WANTLIB+= pthread
.endif

Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/sbcl/distinfo,v
retrieving revision 1.16
diff -u -p -u -p -r1.16 distinfo
--- distinfo 24 Jun 2018 18:33:36 -0000 1.16
+++ distinfo 3 Dec 2018 07:06:41 -0000
@@ -1,2 +1,2 @@
-SHA256 (sbcl-1.4.8-source.tar.bz2) = ziS2K4hIJiHCKKT9bIAjUDMLYmPhsbmEYO60qB1/szU=
-SIZE (sbcl-1.4.8-source.tar.bz2) = 6040563
+SHA256 (sbcl-1.4.14-source.tar.bz2) = TfJu1E1FWAzuy/nhpunkCV3nPHaZxrlFu+jMhxAwHCw=
+SIZE (sbcl-1.4.14-source.tar.bz2) = 6187821
Index: patches/patch-src_runtime_Config_generic-openbsd
===================================================================
RCS file: /cvs/ports/lang/sbcl/patches/patch-src_runtime_Config_generic-openbsd,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 patch-src_runtime_Config_generic-openbsd
--- patches/patch-src_runtime_Config_generic-openbsd 8 Mar 2018 15:17:39 -0000 1.3
+++ patches/patch-src_runtime_Config_generic-openbsd 3 Dec 2018 07:06:41 -0000
@@ -12,12 +12,12 @@ Index: src/runtime/Config.generic-openbs
# provided with absolutely no warranty. See the COPYING and CREDITS
# files for more information.

--LINKFLAGS += -export-dynamic -Wl,-z,wxneeded
+-LINKFLAGS += -Wl,-z,wxneeded
+LINKFLAGS += -Wl,--export-dynamic -Wl,-z,wxneeded
OS_LIBS += -lutil

ifdef LISP_FEATURE_SB_THREAD
-@@ -17,9 +17,7 @@ CFLAGS += -pthread
+@@ -17,9 +17,7 @@ CFLAGS += -pthread -DOS_THREAD_STACK
OS_LIBS += -pthread
endif

Index: patches/patch-src_runtime_GNUmakefile
===================================================================
RCS file: /cvs/ports/lang/sbcl/patches/patch-src_runtime_GNUmakefile,v
retrieving revision 1.8
diff -u -p -u -p -r1.8 patch-src_runtime_GNUmakefile
--- patches/patch-src_runtime_GNUmakefile 8 Mar 2018 15:17:39 -0000 1.8
+++ patches/patch-src_runtime_GNUmakefile 3 Dec 2018 07:06:41 -0000
@@ -2,7 +2,7 @@ $OpenBSD: patch-src_runtime_GNUmakefile,
Index: src/runtime/GNUmakefile
--- src/runtime/GNUmakefile.orig
+++ src/runtime/GNUmakefile
-@@ -30,7 +30,7 @@ __LDFLAGS__ =
+@@ -34,7 +34,7 @@ __LDFLAGS__ =

include ../../output/prefix.def

Index: patches/patch-src_runtime_bsd-os_c
===================================================================
RCS file: patches/patch-src_runtime_bsd-os_c
diff -N patches/patch-src_runtime_bsd-os_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_runtime_bsd-os_c 3 Dec 2018 07:06:41 -0000
@@ -0,0 +1,63 @@
+OB$OpenBSD$
+
+Index: src/runtime/bsd-os.c
+--- src/runtime/bsd-os.c.orig
++++ src/runtime/bsd-os.c
+@@ -693,7 +693,57 @@ os_dlsym(void *handle, const char *symbol)
+ return ret;
+ }
+
++#if defined(LISP_FEATURE_SB_THREAD) && defined(LISP_FEATURE_SB_FUTEX) \
++ && !defined(LISP_FEATURE_SB_PTHREAD_FUTEX)
++
++#include <sys/syscall.h>
++#include <unistd.h>
++
++int __syscall(quad_t, ...);
++
++#define FUTEX_WAIT 1
++#define FUTEX_WAKE 2
++#define FUTEX_REQUEUE 3
++
++#define FUTEX_PRIVATE_FLAG 128
++
++#define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
++#define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
++#define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
++
++int
++futex_wait(int *lock_word, int oldval, long sec, unsigned long usec)
++{
++ struct timespec timeout;
++ int t;
++
++ if (sec < 0) {
++ t = __syscall(SYS_futex, lock_word, FUTEX_WAIT, oldval, NULL, NULL);
++ }
++ else {
++ timeout.tv_sec = sec;
++ timeout.tv_nsec = usec * 1000;
++ t = __syscall(SYS_futex, lock_word, FUTEX_WAIT, oldval, &timeout, NULL);
++ }
++ if (t == 0)
++ return 0;
++ else if (errno == ETIMEDOUT)
++ return 1;
++ else if (errno == EINTR)
++ return 2;
++ else
++ /* EWOULDBLOCK and others, need to check the lock */
++ return -1;
++}
++
++int
++futex_wake(int *lock_word, int n)
++{
++ return (__syscall(SYS_futex, lock_word, FUTEX_WAKE, n, NULL, NULL));
++}
++
+

No comments:

Post a Comment