From: Scott Taylor (n217cg@tamuts.tamu.edu)
Date: 09/29/92


From: n217cg@tamuts.tamu.edu (Scott Taylor)
Subject: Re: Okay, another CLISP problem (fatal!)
Date: Wed, 30 Sep 1992 03:21:12 GMT

In article <1992Sep30.031337.2535@tamsun.tamu.edu> n217cg@tamuts.tamu.edu (Scott Taylor) writes:
>In article <IemBjGa00YV9M8Vm1R@andrew.cmu.edu> sg2j+@andrew.cmu.edu (Scott R. Grabowski) writes:
>>Hello, again......
>>
>>Well, I followed the instructions that were posted the other day by Ziad
>> ...stuff deleted...
>>and running for Linux? FYI, this is version .97pl5, 486/33, 4MB, IDE,
>>VGA.
>>
>
>I ftp'ed the CLISP files from ma2s2.mathematik.uni-karlsruhe.de a few
>weeks ago, followed the installation instructions in the README, and
>now have CLISP running fine on my linux box. I am running 0.96c pl2
>and gcc 2.2.2; I think that if you are running gcc 2.2.2d you need a
>patch (actually source for a required C function absent from the
>library) that was posted here by Bruno Haible (one of the authors)
>a couple weeks ago.
>

Here's what Mr. Haible mailed me last week; this may not have been
posted (I don't remember), so I am posting it in the hopes that it
will help someone out. I would have included it in my first post,
but I had to go look for the file ;-)

Scott
n217cg@tamuts.tamu.edu
================================================================
Subject: Re: linking clisp
Status: RO

Dear CLISP users,

Some of you have had problems when linking lisp.a with the libc
coming with gcc 2.2.2d. In case "setjmp" is missing from that
library, here is the source of setjmp() from some older libc:

============================= setjmp.s =========================
/*
 * setjmp & longjmp for gcc.
 *
 * We need to save all regs except %eax,%ecx,%edx, as these are
 * used by calls.
 *
 * Jump buffer looks like this (same as bruce evans for minix):
 *
 * 00: %ebp
 * 04: %esp
 * 08: %eip
 * 0C: %ebx
 * 10: %esi
 * 14: %edi
 *
 * Total length hex 18 = 24 bytes.
 */

.text
.globl _setjmp,_longjmp
.align 2
_setjmp:
        popl %ecx # get return address
        movl 0(%esp),%edx # and jump buffer address
        movl %ebp,0(%edx)
        movl %esp,4(%edx)
        movl %ecx,8(%edx)
        movl %ebx,12(%edx)
        movl %esi,16(%edx)
        movl %edi,20(%edx)
        xorl %eax,%eax # non-jump return
        jmpl *%ecx

.align 2
_longjmp:
        movl 4(%esp),%edx # jump buffer address
        movl 8(%esp),%eax # val
        cmpl $1,%eax # Value may not be zero (code by bruce?)
        adcb $0,%al # nice code, somewhat cryptic, no?
        movl 0(%edx),%ebp # restore %ebp
        movl 4(%edx),%esp
        movl 12(%edx),%ebx
        movl 16(%edx),%esi
        movl 20(%edx),%edi
        jmp 8(%edx)
=========================================================

Assemble it:

        gcc -c setjmp.s

and use setjmp.o for linking:

      gcc lisp.a setjmp.o -L. -lreadline -ltermcap -s -o lisp.run

I hope this solves this problem.

Bruno Haible
haible@ma2s2.mathematik.uni-karlsruhe.de
================================================================