Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!shelby!agate!ziploc!eps From: eps@toaster.SFSU.EDU (Eric P. Scott) Newsgroups: comp.sys.next Subject: Re: Lisp in 2.0 Message-ID: <1339@toaster.SFSU.EDU> Date: 22 Feb 91 00:27:50 GMT References: <1991Feb21.001055.5896@zip.eecs.umich.edu> Reply-To: eps@cs.SFSU.EDU (Eric P. Scott) Organization: San Francisco State University Lines: 104 In article <1991Feb21.001055.5896@zip.eecs.umich.edu> telfeyan@zip.eecs.umich.edu (Roland Telfeyan) writes: > (2) [Important] What is the workaround for getting the 1.0 >version to work in 2.0? In the upgrade manual it says that there >is an alteration that can be done, but it says nothing more (p. 5). Attached. -=EPS=- ------- Franz Allegro Common Lisp 2.0 1.0 Q: Why can't I use my 1.0 version of Franz Allegro Common Lisp under 2.0? Is there something I can do to make it work until an update becomes available? A: The 1.0 release of Common Lisp does not work with Release 2.0 for several reasons: 1. the Mach header of the .o files have some uninitialized fields 2. the libNeXT and libdsp have some incompatibilities and cannot be used 3. foreign loading doesn't quite work (and perhaps other unknown things). The 1.0 version may be modified to more or less work (i.e. no NeXTstep, no dsp, limited foreign code interface) as follows. THIS WILL ONLY WORK FOR 030 MACHINES!!! There is no known fix for the 040 machines. Make sure that the /usr/cl directory from 1.0 is backed up. Also save the /usr/lib/emacs/lisp/fi directory if you like that sort of thing. After building a 2.0 system, re-install the /usr/cl directory. Save the following program as fixlispheader.c: ========================================================= #include #include #include #include /* * This fixes the mach header of /usr/cl/build/static.o for * release 2.0 */ main(int argc, char *argv[]) { int fd; struct mach_header mh; struct nlist nl; fd = open("static.o", O_RDWR); read(fd, &mh, sizeof(mh)); mh.cputype = CPU_TYPE_MC680x0; mh.cpusubtype = CPU_SUBTYPE_MC68030; lseek(fd, 0, L_SET); write(fd, &mh, sizeof(mh)); lseek(fd, 1400832, L_SET); read(fd, &nl, sizeof(nl)); nl.n_type = N_SECT | N_EXT; nl.n_sect = 1; lseek(fd, 1400832, L_SET); write(fd, &nl, sizeof(nl)); } ==================================================================== Compile this program: (i.e., "cc -o fixlispheader fixlispheader.c"), then in a shell as root: # cd /usr/cl/build # fixlispheader This will destructively modify the static.o file so that it works with the 2.0 release. Before doing a normal "config" operation to build the lisp image, the config file must be modified to not link in libNeXT and libdsp. Open /usr/cl/build/config and change line 679 from LDFLAGS = -lcrt0.o -u _NXEditorFilter -u _DSPAwaitData to LDFLAGS = -lcrt0.o Also change line 680 from LIBRARIES = -lNeXT_s -ldsp_s -lsys_s to LIBRARIES = -lsys_s After these modifications, run the configuration script as normal. Dynamic foreign code loading is also broken: (load "foo.o") will not work. The workaround is to build a custom image (using the configuration script) with your code linked in. To do this, add your .o files to the LIBRARIES macro mentioned above. For example: LIBRARIES = /me/foo.o -lsys_s When running this image, use the lisp defforeign function as usual. Brought to you by Super Global Mega Corp .com