;;;; -*- coding: utf-8; fill-column: 78 -*-
changes in sbcl-1.0.27 relative to 1.0.26:
+ * new port: support added for x86-64 OpenBSD. (thanks to Josh Elsasser)
* bug fix: a type error is signaled for attempts to use the LOOP
keyword ACROSS for a NIL value. (thanks to Daniel Lowe)
;; microsecond but also has a range of years.
;; CLH: Note that tv-usec used to be a time-t, but that this seems
;; problematic on Darwin x86-64 (and wrong). Trying suseconds-t.
-#!-win32
+#!-(or win32 openbsd)
(define-alien-type nil
(struct timeval
(tv-sec time-t) ; seconds
(tv-usec suseconds-t))) ; and microseconds
+;; The above definition doesn't work on 64-bit OpenBSD platforms.
+;; Both tv_sec and tv_usec are declared as long instead of time_t, and
+;; time_t is a typedef for int.
+#!+openbsd
+(define-alien-type nil
+ (struct timeval
+ (tv-sec long) ; seconds
+ (tv-usec long))) ; and microseconds
+
#!+win32
(define-alien-type nil
(struct timeval
;; the POSIX.4 structure for a time value. This is like a "struct
;; timeval" but has nanoseconds instead of microseconds.
+#!-openbsd
(define-alien-type nil
(struct timespec
(tv-sec long) ; seconds
(tv-nsec long))) ; nanoseconds
+;; Just as with struct timeval, 64-bit OpenBSD has problems with the
+;; above definition. tv_sec is declared as time_t instead of long,
+;; and time_t is a typedef for int.
+#!+openbsd
+(define-alien-type nil
+ (struct timespec
+ (tv-sec time-t) ; seconds
+ (tv-nsec long))) ; nanoseconds
+
;; used by other time functions
(define-alien-type nil
(struct tm
(def!constant static-space-end #x201ff000)
(def!constant dynamic-space-start #x1000000000)
+ #!-openbsd
(def!constant dynamic-space-end #x11ffff0000)
+ #!+openbsd
+ ;; This is lower on OpenBSD to allow SBCL to run under the default
+ ;; 512M data size limit.
+ (def!constant dynamic-space-end #x101bcf0000)
(def!constant linkage-table-space-start #x20200000)
(def!constant linkage-table-space-end #x202ff000)
--- /dev/null
+# -*- makefile -*- for the C-level run-time support for SBCL
+
+# This software is part of the SBCL system. See the README file for
+# more information.
+#
+# This software is derived from the CMU CL system, which was
+# written at Carnegie Mellon University and released into the
+# public domain. The software is in the public domain and is
+# provided with absolutely no warranty. See the COPYING and CREDITS
+# files for more information.
+
+include Config.x86-64-bsd
+
+ASSEM_SRC += ldso-stubs.S
+OS_LIBS += -lutil
+
+# XXX why do all the other Configs set LINKFLAGS instead of LDFLAGS?
+# LINKFLAGS is only used in src/runtime/GNUmakefile, this causes the
+# dladdr test in tools-for-build/ to fail.
+
+LINKFLAGS += -export-dynamic
+LDFLAGS += -export-dynamic
void
openbsd_init()
{
+ /*
+ * Show a warning if it looks like the memory available after
+ * allocating the spaces won't be at least this much.
+ */
+#ifdef LISP_FEATURE_X86_64
+ const int wantfree = 64 * 1024 * 1024;
+#else
+ const int wantfree = 32 * 1024 * 1024;
+#endif
struct rlimit rl;
/* OpenBSD, like NetBSD, counts mmap()ed space against the
* process's data size limit. If the soft limit is lower than the
* hard limit then try to yank it up, this lets users in the
- * "staff" login class run sbcl with a default /etc/login.conf
+ * "staff" or "daemon" login classes run sbcl with larger dynamic
+ * space sizes.
*/
getrlimit (RLIMIT_DATA, &rl);
if (rl.rlim_cur < rl.rlim_max) {
}
}
- /* Display a (hopefully) helpful warning if it looks like we won't
- * be able to allocate enough memory. In testing I found that on
- * my system at least, a minimum of 25M on top of the three space
- * sizes was needed to start SBCL. Show a warning below 32M so as
- * to leave a little breathing room.
+ /*
+ * Display a (hopefully) helpful warning if it looks like we won't
+ * be able to allocate enough memory.
*/
getrlimit (RLIMIT_DATA, &rl);
if (dynamic_space_size + READ_ONLY_SPACE_SIZE + STATIC_SPACE_SIZE +
- LINKAGE_TABLE_SPACE_SIZE + (32*1024*1024) > rl.rlim_cur)
+ LINKAGE_TABLE_SPACE_SIZE + wantfree > rl.rlim_cur)
fprintf (stderr,
"RUNTIME WARNING: data size resource limit may be too low,\n"
- " try decreasing the dynamic space size with --dynamic-space-size\n");
+ " try decreasing the dynamic space size with --dynamic-space-size\n"
+ " or raising the datasize or datasize-max limits in /etc/login.conf\n");
}
/* OpenBSD's dlsym() relies on the gcc bulitin
#elif defined LISP_FEATURE_DARWIN
return CONTEXT_ADDR_FROM_STEM(rflags);
#elif defined __OpenBSD__
- return &context->sc_eflags;
+ return &context->sc_rflags;
#else
#error unsupported OS
#endif
#include "genesis/thread.h"
/* Minimize conditionalization for different OS naming schemes. */
-#if defined __linux__ || defined __FreeBSD__ /* (but *not* OpenBSD) */
+#if defined __linux__ || defined __FreeBSD__ || defined __OpenBSD__
#define GNAME(var) var
#else
#define GNAME(var) _##var
#endif
-/* Get the right type of alignment. Linux and FreeBSD (but not OpenBSD)
+/* Get the right type of alignment. Linux, FreeBSD and OpenBSD
* want alignment in bytes. */
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#define align_4byte 4
#define align_8byte 8
#define align_16byte 16
* entails; unfortunately, currently the situation is worse, not
* better, than in the above paragraph. */
-#if defined(LISP_FEATURE_FREEBSD) || defined(LISP_FEATURE_DARWIN)
+#if defined(LISP_FEATURE_FREEBSD) || defined(LISP_FEATURE_DARWIN) || defined(LISP_FEATURE_OPENBSD)
os_context_register_t *
os_context_register_addr(os_context_t *context, int offset)
{
(and :x86 :linux)
(and :x86-64 :darwin)
(and :x86-64 :linux)
+ (and :x86-64 :openbsd)
(and :sparc :linux)
:alpha
:mips))
(funcall (compile nil '(lambda () (tan (tan (round 0))))))
(with-test (:name (:addition-overflow :bug-372)
- :fails-on '(or :ppc :darwin (and :x86 (or :netbsd :openbsd))))
+ :fails-on '(or :ppc :darwin (and (or :x86 :x86-64)
+ (or :netbsd :openbsd))))
(assert (typep (nth-value
1
(ignore-errors
;;;; Build the tool again, this time as a shared object, and load it
(run "cc" "stack-alignment-offset.c"
- #+(and (or linux freebsd) (or x86-64 ppc mips)) "-fPIC"
+ #+(and (not darwin) (or x86-64 ppc mips)) "-fPIC"
#+(and x86-64 darwin) "-arch" #+(and x86-64 darwin) "x86_64"
#+darwin "-bundle" #-darwin "-shared"
"-o" "stack-alignment-offset.so")
/* test to build and run so that we know if we have dladdr
*/
+#include <stdlib.h>
+
/* bloody FSF dlcfn.h won't give us dladdr without this */
#define _GNU_SOURCE
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.26.12"
+"1.0.26.13"