Subject: Latest version, compiling on FreeBSD

From: "John D. Boggs" <[email-masked]>
Date: Sat, 18 Nov 1995 11:19:39 -0600

I would like to get CLISP running on FreeBSD-2.0.5-950622-SNAP, and
have 2 questions:

1.  How do I know which version I have?  I can't find reference to
    version at all in any of the files.

2.  Has anyone managed to get it to compile on FreeBSD-2.0.5?  I get
    as far as compiling clos.lsp in the "make compiled.mem" step,
    and get a core dump.  I've no idea how to read core dumps, and
    don't really want to learn just so I can use LISP on my system.

-- 

John D. Boggs            \ The great thing about human language is
[email-masked]  \   that it prevents us from sticking to
                           \    the matter at hand.  -Lewis Thomas

---

From: [email-masked] (Martin Cracauer)
Date: Tue, 21 Nov 1995 10:31:13 +0100 (MET)

>     don't really want to learn just so I can use LISP on my system.

Maybe you have a memory limit in your shell?

`limit`
or
`ulimit`

tell.

-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <[email-masked]>  
Tel.: +49 40 / 522 18 29
Fax.: +49 40 / 522 85 36

---

From: [email-masked] (Bruno Haible)
Date: Tue, 21 Nov 95 22:46:46 +0100

>     version at all in any of the files.

There should be a file clisp/src/VERSION. If not, you have a very old
version and should definitely get newer sources.

> 2.  Has anyone managed to get it to compile on FreeBSD-2.0.5?

On FreeBSD-1.0.2 (or so), attempts to bring up CLISP failed.

On NetBSD 1.0 Beta, Douglas Crosher <[email-masked]> did
the port and then fixed bugs in NetBSD's mmap management, in order to
get CLISP's generational GC working.

I don't know which of these fixes were copied to FreeBSD-2.0.5.

>     I get

Recommendation: Remove the src/*.o files, add -DSAFETY=3 to the CFLAGS
in the makefile, and restart "make". Then please find out about the
least SAFETY level that produces a working lisp.run and lispinit.mem, and
tell Marcus about it.

----------------------------------------------------------------------------
Bruno Haible                            net: <[email-masked]>
ILOG S.A.                               tel: +33 1 4908 3585
9, rue de Verdun - BP 85                fax: +33 1 4908 3510
94253 Gentilly Cedex                    url: http://www.ilog.fr/
France                                  url: http://www.ilog.com/

---

From: [email-masked] (Martin Cracauer)
Date: Thu, 23 Nov 1995 14:29:53 +0100 (MET)

I am running and building Clisp on NetBSD ever since.

I just checked Clisp-19940901 on FreeBSD-2.1-951005-SNAP, using
gcc-2.7.0 and it just works when sys_errlist is handled. There are
many places where FreeBSD (and NetBSD) chose to change datatypes, so
warnings about signed/unsigned operations are common. The testsuite
failes with floating point underflow, which may be related to
FreeBSD's barfink on FP exceptions. I am going to try a more rescent
release of Clisp.

Everyone having problems with Lisp/Scheme implementations on NetBSD or
FreeBSD should contact me with(!) the necessary information. With the
excetion of Rscheme, I think I have every recent implementation
running on at least NetBSD/i386. That doesn't mean I stress-tested
them, a leaking GC could slip through. I run implementation-provided
test suites, though.

Remember that NetBSD/i386 has a very descent Linux emulator (which,
for example, runs MIT-Scheme) and FreeBSD is catching up. If you
really can't compile on *BSD, try a Linux binary.

One possible reason for breaking binaries in the build process of
image-based programming language implementations are shell limits for
maximum datasize or stacksize of processes. Try `limit` or `ulimit` to
find out. Unfortunatly, in some *BSD releases, some shells has default
values to limit resources instead of unlimiting them until the user
wants to limit. bash(1) is an example.

And remove sys_errlist definitions or change them to 'const'.

Happy Hacking
	Martin
--
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <[email-masked]>  - BSD User Group Hamburg, Germany 
"As far as I'm concerned,  if something is so complicated that you can't ex-"
"plain it in 10 seconds, then it's probably not worth knowing anyway"- Calvin

---

From: Douglas Crosher <[email-masked]>
Date: Mon, 27 Nov 1995 02:35:00 +1100 (GMT+1100)

> FreeBSD's barfink on FP exceptions. I am going to try a more rescent

I think there was a recent bug report about this and that it was a bug
with gcc-2.7.0.

Using clisp-1995-06-23 and gcc-2.7.1 I found that clisp compiles and
passes the tests without change under both NetBSD 1.1 and FreeBSD 2.1.

I briefly tried the most recent version of clisp but had trouble with
the configure scripts.

I also have CLISP running under both NetBSD 1.1 and FreeBSD 2.1 using
generational GC.  This requires an addition to the src/unix.d file of
clisp and appropriate kernel configurations - details below:

Regards
Douglas Crosher

-=-=-=-=-=-
CLISP patch relative to clisp-06-23

*** src/unix.d.orig	Thu Jun 15 06:23:20 1995
--- src/unix.d	Mon Nov 27 02:08:17 1995
***************
*** 270,275 ****
--- 270,285 ----
      #define WP_SIGNAL  FAULT_HANDLER(SIGSEGV) FAULT_HANDLER(SIGBUS)
      #define CAN_HANDLE_WP_FAULT
    #endif
+   #if defined(__NetBSD__) || defined(__FreeBSD__)
+     #define FAULT_HANDLER_ARGLIST  sig, code, scp, addr
+     #define FAULT_HANDLER_ARGDECL  int sig; int code; void* scp; char* addr;
+     #define FAULT_ADDRESS  addr
+     #define WP_SIGNAL FAULT_HANDLER(SIGBUS)
+     #define CAN_HANDLE_WP_FAULT
+     #if defined(__FreeBSD__)
+ 	#define PROT_NONE 0x00
+     #endif	
+   #endif
    #if defined(UNIX_SUNOS5)
      #include <siginfo.h>
      #define FAULT_HANDLER_ARGLIST  sig, sip, ucp

-=-=-=-=-=-
Kernel configuration

To use generational GC under FreeBSD 2.1 and NetBSD 1.1 requires the
appropriate configuration of the kernel and in the case of NetBSD a
small kernel hack:

1. For clisp to use shared memory and thus generational GC the size of
SHMSEG needs to be increased.

To do this under FreeBSD 2.1, just add the following line to your
config file:
options		"SHMSEG=200"

Under NetBSD 1.1, edit the param.c file in the compile directory; you
may need to run 'make param.c' first.

2. Further to use generational GC under NetBSD requires a small hack
to the kernel. The following two patches, against NetBSD 1.1 kernel
sources, add the ability to return the address of a protection
fault. Note: this is compatible with the FreeBSD implementation, and
is also useful with gcl to implement SGC.

*** i386/machdep.c.orig	Mon Oct 16 12:43:28 1995
--- i386/machdep.c	Mon Nov 13 03:07:46 1995
***************
*** 532,537 ****
--- 532,538 ----
  
  	frame.sf_code = code;
  	frame.sf_scp = &fp->sf_sc;
+ 	frame.sf_addr = (char *)rcr2();
  	frame.sf_handler = catcher;
  
  	/*

*** include/frame.h.orig	Sat Oct 14 11:57:34 1995
--- include/frame.h	Mon Nov 13 03:09:01 1995
***************
*** 117,122 ****
--- 117,123 ----
  	int	sf_signum;
  	int	sf_code;
  	struct	sigcontext *sf_scp;
+ 	char    *sf_addr;
  	sig_t	sf_handler;
  	struct	sigcontext sf_sc;
  };

-=-=-=-=-=-