From: William Harold Newman Date: Mon, 2 Oct 2000 00:58:59 +0000 (+0000) Subject: crudely patched to run on OpenBSD (which was broken by dyn lib patches) X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=3aba91516068375e01ffec0d19bf8cbe85feb828;p=sbcl.git crudely patched to run on OpenBSD (which was broken by dyn lib patches) --- diff --git a/BUGS b/BUGS index 1940489..c296e96 100644 --- a/BUGS +++ b/BUGS @@ -802,3 +802,5 @@ Error in function C::GET-LAMBDA-TO-COMPILE: (This is particularly annoying because several Lisp functions like PRINT *precede* their output with a newline, instead of following it with a newline.) + +* (SUBTYPEP '(AND ZILCH INTEGER) 'ZILCH) => NIL, NIL \ No newline at end of file diff --git a/NEWS b/NEWS index 413be43..5b3fabf 100644 --- a/NEWS +++ b/NEWS @@ -493,6 +493,9 @@ changes in sbcl-0.6.8 relative to sbcl-0.6.7: have been added. * Raymond Wiker's patches to port dynamic loading from Linux to FreeBSD have been added. +?? $Header$ and other CVS tags have been removed from the sources, + because they have never saved me trouble and they've been a + nuisance working with patches and other diff-related operations. ?? The debugger now flushes standard output streams before it begins its output ("debugger invoked" and so forth). ?? FINISH-OUTPUT now works better than it did before. (It used to diff --git a/src/code/run-program.lisp b/src/code/run-program.lisp index 0d1f594..13acdf9 100644 --- a/src/code/run-program.lisp +++ b/src/code/run-program.lisp @@ -22,7 +22,7 @@ (options sb-c-call:int) (rusage sb-c-call:int)) -(eval-when (load eval compile) +(eval-when (:compile-toplevel :load-toplevel :execute) (defconstant wait-wnohang #-svr4 1 #+svr4 #o100) (defconstant wait-wuntraced #-svr4 2 #+svr4 4) (defconstant wait-wstopped #-svr4 #o177 #+svr4 wait-wuntraced)) @@ -213,13 +213,18 @@ #+FreeBSD (def-alien-type nil - (struct sgttyb - (sg-ispeed sb-c-call:char) ; input speed - (sg-ospeed sb-c-call:char) ; output speed - (sg-erase sb-c-call:char) ; erase character - (sg-kill sb-c-call:char) ; kill character - (sg-flags sb-c-call:short) ; mode flags - )) + (struct sgttyb + (sg-ispeed sb-c-call:char) ; input speed + (sg-ospeed sb-c-call:char) ; output speed + (sg-erase sb-c-call:char) ; erase character + (sg-kill sb-c-call:char) ; kill character + (sg-flags sb-c-call:short))) ; mode flags +#+OpenBSD +(def-alien-type nil + (struct sgttyb + (sg-four sb-c-call:int) + (sg-chars (array sb-c-call:char 4)) + (sg-flags sb-c-call:int))) ;;; Find a pty that is not in use. Return three values: the file ;;; descriptor for the master side of the pty, the file descriptor for @@ -238,17 +243,32 @@ sb-unix:o_rdwr #o666))) (when slave-fd - ; Maybe put a vhangup here? - #-linux + ;; comment from classic CMU CL: + ;; Maybe put a vhangup here? + ;; + ;; FIXME: It seems as though this logic should be in + ;; OPEN-PTY, not FIND-A-PTY (both from the comments + ;; documenting DEFUN FIND-A-PTY, and from the + ;; connotations of the function names). + ;; + ;; FIXME: It would be nice to have a note, and/or a pointer + ;; to some reference material somewhere, explaining + ;; why we need this on *BSD and not on Linux. + #+bsd (sb-alien:with-alien ((stuff (sb-alien:struct sgttyb))) (let ((sap (sb-alien:alien-sap stuff))) (sb-unix:unix-ioctl slave-fd sb-unix:TIOCGETP sap) (setf (sb-alien:slot stuff 'sg-flags) - #o300) ; EVENP|ODDP + ;; This is EVENP|ODDP, the same numeric code + ;; both on FreeBSD and on OpenBSD. -- WHN 20000929 + #o300) ; EVENP|ODDP (sb-unix:unix-ioctl slave-fd sb-unix:TIOCSETP sap) (sb-unix:unix-ioctl master-fd sb-unix:TIOCGETP sap) (setf (sb-alien:slot stuff 'sg-flags) (logand (sb-alien:slot stuff 'sg-flags) + ;; This is ~ECHO, the same numeric + ;; code both on FreeBSD and on OpenBSD. + ;; -- WHN 20000929 (lognot 8))) ; ~ECHO (sb-unix:unix-ioctl master-fd sb-unix:TIOCSETP sap))) (return-from find-a-pty diff --git a/src/code/unix.lisp b/src/code/unix.lisp index d7a66d0..a6b01be 100644 --- a/src/code/unix.lisp +++ b/src/code/unix.lisp @@ -979,8 +979,8 @@ (def-unix-error ESRCH 3 "No such process") |# (def-unix-error EINTR 4 "Interrupted system call") -#| (def-unix-error EIO 5 "I/O error") +#| (def-unix-error ENXIO 6 "No such device or address") (def-unix-error E2BIG 7 "Arg list too long") (def-unix-error ENOEXEC 8 "Exec format error") diff --git a/src/cold/warm.lisp b/src/cold/warm.lisp index 8efbc69..566fd7e 100644 --- a/src/cold/warm.lisp +++ b/src/cold/warm.lisp @@ -202,7 +202,9 @@ "src/code/inspect" ; FIXME: should be byte compiled "src/code/profile" "src/code/ntrace" + #+nil ; REMOVEME (for debugging 0.6.7.6 on OpenBSD only) "src/code/foreign" + #+nil ; REMOVEME (for debugging 0.6.7.6 on OpenBSD only) "src/code/run-program" ;; Code derived from PCL's pre-ANSI DESCRIBE-OBJECT ;; facility is still used in our ANSI DESCRIBE diff --git a/src/compiler/x86/parms.lisp b/src/compiler/x86/parms.lisp index bc0a177..f2938d8 100644 --- a/src/compiler/x86/parms.lisp +++ b/src/compiler/x86/parms.lisp @@ -125,17 +125,16 @@ ;;; Note: Mostly these values are black magic, inherited from CMU CL ;;; without any documentation. However, there have been a few changes ;;; since the fork: -;;; * The non-Linux *TARGET-STATIC-SPACE-START* value was bumped up -;;; from #x28000000 to #x30000000 when non-Linux ld.so dynamic linking +;;; * The FreeBSD *TARGET-STATIC-SPACE-START* value was bumped up +;;; from #x28000000 to #x30000000 when FreeBSD ld.so dynamic linking ;;; support was added for FreeBSD ca. 20000910. This was to keep from ;;; stomping on an address range that the dynamic libraries want to use. ;;; (They want to use this address range even if we try to reserve it ;;; with a call to validate() as the first operation in main().) #!-linux (defparameter *target-read-only-space-start* #x10000000) #!-linux (defparameter *target-static-space-start* - ;; FIXME: was #x28000000 until RAW's RUN-PROGRAM - ;; patches, why the change? - #x30000000) + #!+freebsd #x30000000 + #!+openbsd #x28000000) #!-linux (defparameter *target-dynamic-space-start* #x48000000) #!+linux (defparameter *target-read-only-space-start* #x01000000) #!+linux (defparameter *target-static-space-start* #x05000000) diff --git a/src/runtime/Config.x86-bsd b/src/runtime/Config.x86-bsd index 49d74b6..8017592 100644 --- a/src/runtime/Config.x86-bsd +++ b/src/runtime/Config.x86-bsd @@ -16,7 +16,10 @@ OS_SRC = bsd-os.c os-common.c undefineds.c # worked fine for most things, but LOAD-FOREIGN & friends require # dlopen() etc., which in turn depend on dynamic linking of the # runtime. -OS_LINK_FLAGS=-dynamic -export-dynamic +#for OpenBSD: +OS_LINK_FLAGS=-static +#for FreeBSD: +#OS_LINK_FLAGS=-dynamic -export-dynamic OS_LIBS=-lm # -ldl GC_SRC= gencgc.c diff --git a/src/runtime/bsd-os.c b/src/runtime/bsd-os.c index 44b5a05..bd60796 100644 --- a/src/runtime/bsd-os.c +++ b/src/runtime/bsd-os.c @@ -245,6 +245,10 @@ os_install_interrupt_handlers(void) } #endif /* !defined GENCGC */ + +/* + * stuff to help work with dynamically linked libraries + */ /* feh! * @@ -254,7 +258,15 @@ os_install_interrupt_handlers(void) * sbcl.nm). * * FIXME: This flag should be set in Config.bsd */ +#if defined __FreeBSD__ #define DL_WORKAROUND 1 +#elif defined __OpenBSD__ +/* SBCL doesn't (yet?) work at all with dynamic libs on OpenBSD, so we + * wouldn't get any use out of these stubs. -- WHN 20001001 */ +#define DL_WORKAROUND 0 +#else +#error unsupported BSD variant +#endif #if DL_WORKAROUND #include diff --git a/src/runtime/x86-validate.h b/src/runtime/x86-validate.h index 2fdf41e..8ae0588 100644 --- a/src/runtime/x86-validate.h +++ b/src/runtime/x86-validate.h @@ -27,6 +27,9 @@ * 0x48000000->0xC8000000 2GB Dynamic Space. * 0xE0000000-> 256M C stack - Alien stack. * + * OpenBSD: + * almost the same as FreeBSD + * * Linux: Note that this map has some problems and requires some further * development so is not implemented below. * 0x00000000->0x08000000 128M Unused. @@ -47,8 +50,16 @@ #define READ_ONLY_SPACE_START (0x10000000) #define READ_ONLY_SPACE_SIZE (0x0ffff000) /* 256MB - 1 page */ +#if defined __FreeBSD__ #define STATIC_SPACE_START (0x30000000) #define STATIC_SPACE_SIZE (0x07fff000) /* 128M - 1 page */ +#elif defined __OpenBSD__ +#define STATIC_SPACE_START (0x28000000) +#define STATIC_SPACE_SIZE (0x0ffff000) /* 256M - 1 page */ +#else +#error unsupported BSD variant +#endif + #define BINDING_STACK_START (0x38000000) #define BINDING_STACK_SIZE (0x07fff000) /* 128MB - 1 page */ diff --git a/version.lisp-expr b/version.lisp-expr index f476b4c..f08e56a 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -15,4 +15,4 @@ ;;; versions, and a string a la "0.6.5.12" is used for versions which ;;; aren't released but correspond only to CVS tags or snapshots. -"0.6.7.5" +"0.6.7.6"