Builds and passes tests on amd64 and i386, builds on macppc and test
results don't look much worse. Any sbcl users care to give the update
a try?
diff -ruN ./Makefile ../../mystuff/lang/sbcl/Makefile
--- ./Makefile Tue Jan 23 08:15:57 2018
+++ ../../mystuff/lang/sbcl/Makefile Wed Mar 7 11:32:54 2018
@@ -6,8 +6,7 @@
COMMENT= compiler and runtime system for ANSI Common Lisp
-V = 1.3.10
-REVISION= 2
+V = 1.4.5
DISTNAME= sbcl-${V}-source
PKGNAME= sbcl-${V}
WRKDIST= ${WRKDIR}/sbcl-${V}
@@ -55,8 +54,7 @@
USE_GMAKE= Yes
PORTHOME= ${TMPDIR}
MAKE_ENV= GNUMAKE=${GMAKE} INSTALL_ROOT=${PREFIX} \
- MAN_DIR=${PREFIX}/man INFO_DIR=${PREFIX}/info \
- PORTS_CFLAGS="${CFLAGS}"
+ MAN_DIR=${PREFIX}/man INFO_DIR=${PREFIX}/info
# Upstream asks that packagers append something like this to the
# version to distinguish official tarballs from third-party packages.
@@ -86,8 +84,6 @@
chown -R 0:0 ${PREFIX}/lib/sbcl
do-test:
- cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} DONT_CLEAN_SBCL_CONTRIB=1 \
- /bin/sh make-target-contrib.sh
cd ${WRKSRC}/tests && ${SETENV} ${MAKE_ENV} /bin/sh run-tests.sh
.include <bsd.port.mk>
diff -ruN ./distinfo ../../mystuff/lang/sbcl/distinfo
--- ./distinfo Sat May 6 18:36:10 2017
+++ ../../mystuff/lang/sbcl/distinfo Wed Mar 7 07:32:05 2018
@@ -1,2 +1,2 @@
-SHA256 (sbcl-1.3.10-source.tar.bz2) =
SlZ6rZGzFsIut1bdjlAs/ZqVpMZg+x+i6x5Q4Am4V3c=
-SIZE (sbcl-1.3.10-source.tar.bz2) = 5763563
+SHA256 (sbcl-1.4.5-source.tar.bz2) =
lhku/9F/PkV/d7z/Bhl4TObnKT4n4ObBVGpUKz2KxUA=
+SIZE (sbcl-1.4.5-source.tar.bz2) = 5998856
diff -ruN ./patches/patch-src_code_x86-64-vm_lisp
../../mystuff/lang/sbcl/patches/patch-src_code_x86-64-vm_lisp
--- ./patches/patch-src_code_x86-64-vm_lisp Wed Dec 31 16:00:00 1969
+++ ../../mystuff/lang/sbcl/patches/patch-src_code_x86-64-vm_lisp Wed Mar
7 10:04:51 2018
@@ -0,0 +1,42 @@
+$OpenBSD$
+
+Index: src/code/x86-64-vm.lisp
+--- src/code/x86-64-vm.lisp.orig
++++ src/code/x86-64-vm.lisp
+@@ -72,7 +72,7 @@
+ (if (eq kind :relative) :relative))))
+ nil) ; non-immobile-space builds never record code fixups
+
+-#!+(or darwin linux win32)
++#!+(or darwin linux openbsd win32)
+ (define-alien-routine ("os_context_float_register_addr"
context-float-register-addr)
+ (* unsigned) (context (* os-context-t)) (index int))
+
+@@ -81,11 +81,11 @@
+
+ (defun context-float-register (context index format)
+ (declare (ignorable context index))
+- #!-(or darwin linux win32)
++ #!-(or darwin linux openbsd win32)
+ (progn
+ (warn "stub CONTEXT-FLOAT-REGISTER")
+ (coerce 0 format))
+- #!+(or darwin linux win32)
++ #!+(or darwin linux openbsd win32)
+ (let ((sap (alien-sap (context-float-register-addr context index))))
+ (ecase format
+ (single-float
+@@ -101,11 +101,11 @@
+
+ (defun %set-context-float-register (context index format value)
+ (declare (ignorable context index format))
+- #!-(or linux win32)
++ #!-(or linux openbsd win32)
+ (progn
+ (warn "stub %SET-CONTEXT-FLOAT-REGISTER")
+ value)
+- #!+(or linux win32)
++ #!+(or linux openbsd win32)
+ (let ((sap (alien-sap (context-float-register-addr context index))))
+ (ecase format
+ (single-float
diff -ruN ./patches/patch-src_runtime_Config_generic-openbsd
../../mystuff/lang/sbcl/patches/patch-src_runtime_Config_generic-openbsd
--- ./patches/patch-src_runtime_Config_generic-openbsd Tue Jan 23 08:15:57 2018
+++ ../../mystuff/lang/sbcl/patches/patch-src_runtime_Config_generic-openbsd
Wed Mar 7 08:57:36 2018
@@ -8,7 +8,7 @@
Index: src/runtime/Config.generic-openbsd
--- src/runtime/Config.generic-openbsd.orig
+++ src/runtime/Config.generic-openbsd
-@@ -9,16 +9,12 @@
+@@ -9,7 +9,7 @@
# provided with absolutely no warranty. See the COPYING and CREDITS
# files for more information.
@@ -16,13 +16,14 @@
+LINKFLAGS += -Wl,--export-dynamic -Wl,-z,wxneeded
OS_LIBS += -lutil
--# If the compiler recognizes a -nopie flag then we're building on a
--# PIE-by-default system, so disable PIE.
--ifneq ($(shell $(CC) -dumpspecs 2>/dev/null | grep -e -nopie),)
+ ifdef LISP_FEATURE_SB_THREAD
+@@ -17,9 +17,7 @@ CFLAGS += -pthread
+ OS_LIBS += -pthread
+ endif
+
+-ifneq ($(shell $(CC) -dM -E - < /dev/null 2>/dev/null | grep -e '__clang__'),)
CFLAGS += -fno-pie
- LINKFLAGS += -nopie
+ LINKFLAGS += -Wl,-nopie
LDFLAGS += -nopie
+ __LDFLAGS__ += -nopie
-endif
-
- ifdef LISP_FEATURE_SB_THREAD
- CFLAGS += -pthread
diff -ruN ./patches/patch-src_runtime_GNUmakefile
../../mystuff/lang/sbcl/patches/patch-src_runtime_GNUmakefile
--- ./patches/patch-src_runtime_GNUmakefile Sat May 6 18:36:10 2017
+++ ../../mystuff/lang/sbcl/patches/patch-src_runtime_GNUmakefile Wed Mar
7 09:11:17 2018
@@ -1,12 +1,13 @@
$OpenBSD: patch-src_runtime_GNUmakefile,v 1.7 2017/02/06 08:18:53 jca Exp $
---- src/runtime/GNUmakefile.orig Mon Feb 6 08:42:09 2017
-+++ src/runtime/GNUmakefile Mon Feb 6 08:42:22 2017
-@@ -24,7 +24,7 @@ GREP = grep
+Index: src/runtime/GNUmakefile
+--- src/runtime/GNUmakefile.orig
++++ src/runtime/GNUmakefile
+@@ -30,7 +30,7 @@ __LDFLAGS__ =
include ../../output/prefix.def
--CFLAGS = -g -Wall -Wsign-compare -O3
-+CFLAGS = -Wall -Wsign-compare ${PORTS_CFLAGS}
- ASFLAGS = $(CFLAGS)
- CPPFLAGS = -I. -DSBCL_PREFIX=\"$(SBCL_PREFIX)\"
+-CFLAGS += -g -Wall -Wundef -Wsign-compare -Wpointer-arith -O3
++CFLAGS += -Wall -Wundef -Wsign-compare -Wpointer-arith
+ ASFLAGS += $(CFLAGS)
+ CPPFLAGS += -I. -DSBCL_PREFIX=\"$(SBCL_PREFIX)\"
diff -ruN ./patches/patch-src_runtime_gc-common_c
../../mystuff/lang/sbcl/patches/patch-src_runtime_gc-common_c
--- ./patches/patch-src_runtime_gc-common_c Wed May 31 12:14:50 2017
+++ ../../mystuff/lang/sbcl/patches/patch-src_runtime_gc-common_c Wed Mar
7 08:57:36 2018
@@ -5,8 +5,8 @@
Index: src/runtime/gc-common.c
--- src/runtime/gc-common.c.orig
+++ src/runtime/gc-common.c
-@@ -52,6 +52,8 @@
- #endif
+@@ -55,6 +55,8 @@
+ #define LONG_FLOAT_SIZE 3
#endif
+#define ffsl __builtin_ffsl
diff -ruN ./patches/patch-src_runtime_run-program_c
../../mystuff/lang/sbcl/patches/patch-src_runtime_run-program_c
--- ./patches/patch-src_runtime_run-program_c Wed Dec 31 16:00:00 1969
+++ ../../mystuff/lang/sbcl/patches/patch-src_runtime_run-program_c Wed Mar
7 10:07:26 2018
@@ -0,0 +1,33 @@
+$OpenBSD$
+
+Work around a problem where non-PIC code ends up using a different
+copy of environ than libc.
+
+Index: src/runtime/run-program.c
+--- src/runtime/run-program.c.orig
++++ src/runtime/run-program.c
+@@ -200,14 +200,18 @@ int spawn(char *program, char *argv[], int sin, int so
+ if (pwd && chdir(pwd) < 0) {
+ failure_code = 3;
+ } else {
++ /* Exec the program. */
+ if (envp) {
+- environ = envp;
++ if (search)
++ execvpe(program, argv, envp);
++ else
++ execve(program, argv, envp);
++ } else {
++ if (search)
++ execvp(program, argv);
++ else
++ execv(program, argv);
+ }
+- /* Exec the program. */
+- if (search)
+- execvp(program, argv);
+- else
+- execv(program, argv);
+ }
+
+ /* When exec or chdir fails and channel is available, send the errno
value. */
diff -ruN ./patches/patch-src_runtime_thread_c
../../mystuff/lang/sbcl/patches/patch-src_runtime_thread_c
--- ./patches/patch-src_runtime_thread_c Wed Dec 31 16:00:00 1969
+++ ../../mystuff/lang/sbcl/patches/patch-src_runtime_thread_c Wed Mar 7
10:04:51 2018
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Index: src/runtime/thread.c
+--- src/runtime/thread.c.orig
++++ src/runtime/thread.c
+@@ -653,9 +653,16 @@ create_thread_struct(lispobj initial_function) {
+ * on the alignment passed from os_validate, since that might
+ * assume the current (e.g. 4k) pagesize, while we calculate with
+ * the biggest (e.g. 64k) pagesize allowed by the ABI. */
++#if defined(LISP_FEATURE_OPENBSD) && defined(MAP_STACK)
++ spaces = mmap(0, THREAD_STRUCT_SIZE, PROT_READ|PROT_WRITE,
++ MAP_PRIVATE|MAP_ANON|MAP_STACK, -1, 0);
++ if(spaces == MAP_FAILED)
++ return NULL;
++#else
+ spaces = os_allocate(THREAD_STRUCT_SIZE);
+ if(!spaces)
+ return NULL;
++#endif
+ /* Aligning up is safe as THREAD_STRUCT_SIZE has
+ * THREAD_ALIGNMENT_BYTES padding. */
+ aligned_spaces = PTR_ALIGN_UP(spaces, THREAD_ALIGNMENT_BYTES);
diff -ruN ./patches/patch-src_runtime_x86-64-bsd-os_c
../../mystuff/lang/sbcl/patches/patch-src_runtime_x86-64-bsd-os_c
--- ./patches/patch-src_runtime_x86-64-bsd-os_c Wed Dec 31 16:00:00 1969
+++ ../../mystuff/lang/sbcl/patches/patch-src_runtime_x86-64-bsd-os_c Wed Mar
7 12:23:26 2018
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: src/runtime/x86-64-bsd-os.c
+--- src/runtime/x86-64-bsd-os.c.orig
++++ src/runtime/x86-64-bsd-os.c
+@@ -209,4 +209,10 @@ os_restore_fp_control(os_context_t *context)
+ asm ("fldcw %0" : : "m" (cw));
+ }
+ }
++
++os_context_register_t *
++os_context_float_register_addr(os_context_t *context, int offset)
++{
++ return (os_context_register_t *)&context->sc_fpstate->fx_xmm[offset];
++}
+ #endif
diff -ruN ./pkg/PLIST ../../mystuff/lang/sbcl/pkg/PLIST
--- ./pkg/PLIST Sat May 6 18:36:10 2017
+++ ../../mystuff/lang/sbcl/pkg/PLIST Wed Mar 7 09:04:34 2018
@@ -41,6 +41,7 @@
lib/sbcl/contrib/sb-sprof.fasl
lib/sbcl/contrib/uiop.fasl
lib/sbcl/sbcl.core
+lib/sbcl/sbcl.mk
@man man/man1/sbcl.1
share/doc/sbcl/
share/doc/sbcl/BUGS