Subject: Building 0812 on Sun4 solaris 2.4 with gcc 2.7.0?

From: Raymond Toy <[email-masked]>
Date: Mon, 13 Nov 1995 09:05:04 -0500

I finally got around to grabbing the 0812 version of clisp.  I also
grabbed readline and regexp files too.

I followed the directions in unix/INSTALL.  and ran "makmake
--with-readline --with-dynamic-ffi".  However, I could quite get a
totally successful build.  Here are some of the problems encountered.

1.  When adding the regexp module, gcc fails because explicit is now a
    keyword.  In particular, see clisp.h, lispbibl.d.  I got around
    this by adding -Dexplicit=clisp_explicit.

2.  A working lisp is produced after doing the above.  However, I
    can't add the regexp module.  gcc says:

+ gcc -O -Dexplicit=clisp_expl -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -fomit-frame-pointer -O2 -DUNIX_BINARY_DISTRIB -DDYNAMIC_MODULES -DDYNAMIC_FFI -Iintl -DLOCALEDIR="/usr/local/lib/locale" -I/apps/public/src/lisp/08-12/clisp-1995-08-12/solaris-gcc -DMODULE=regexp -c regexp_module.cc 
In file included from regexp_module.cc:16:
/apps/public/src/lisp/08-12/clisp-1995-08-12/solaris-gcc/clisp.h:2373: global register variable follows a function definition
/apps/public/src/lisp/08-12/clisp-1995-08-12/solaris-gcc/clisp.h:2373: warning: call-clobbered register used for global register variable

    The relevant line in clisp.h is:

register object subr_self __asm__("%g4");

    At this point I'm stuck.

3.  There were various other minor problems with directories, but I,
    unfortunately, did not write them down.

Any hints or pointers?

Ray

---

From: Marcus Daniels <[email-masked]>
Date: Mon, 13 Nov 1995 18:29:20 GMT

>>>>> "Raymond" == Raymond Toy <[email-masked]> writes:

Raymond> When adding the regexp module, gcc fails because explicit is now a
Raymond> keyword.

Thanks, will be fixed.

Raymond> global register variable follows a function definition
Raymond> The relevant line in clisp.h is:

Raymond>    register object subr_self __asm__("%g4");

Raymond> At this point I'm stuck.

A workaround is compiling without "--with-dynamic-modules".

---

From: [email-masked] (Joerg Hoehle)
Date: Tue, 14 Nov 1995 09:14:00 +0100

Hi,

 > A workaround is compiling without "--with-dynamic-modules".

What I had to do in the Amiga port was to change the location of the
above line to come before any function definitions (especially inlined
functions defined in the headers files). So make sure the register
declaration comes first or compile the module with -ffixed-g4 so that
the register is allocated right from the beginning.

Hope this helps,
 	Joerg Hoehle.
[email-masked]			[email-masked]

---

From: Raymond Toy <[email-masked]>
Date: Thu, 16 Nov 1995 13:36:29 -0500

>>>>> "Joerg" == Joerg Hoehle <[email-masked]> writes:

    Raymond> global register variable follows a function definition
    Raymond> The relevant line in clisp.h is:

    >> A workaround is compiling without "--with-dynamic-modules".

    Joerg> What I had to do in the Amiga port was to change the
    Joerg> location of the above line to come before any function
    Joerg> definitions (especially inlined functions defined in the
    Joerg> headers files). So make sure the register declaration comes
    Joerg> first or compile the module with -ffixed-g4 so that the
    Joerg> register is allocated right from the beginning.

Thanks for the hints

I would try them out, but I went and grabbed new versions from 
which seem to work better.  The "explicit" problem is still there, but
the %g4 problem seems to be gone.

However, this raises another question.  Whenever I compile I get many
warnings from gcc about volatile not doing what might be expected and
using call-clobbered global registers (or something like that).  Are
these warnings important, especially the call-clobbered global
register?  I've been using the result on various things, and the
answer has always been what was expected.

Ray

---

From: [email-masked] (Bruno Haible)
Date: Thu, 16 Nov 95 23:32:52 +0100

> which seem to work better.  The "explicit" problem is still there

It shouldn't be a show-stopper. How about adding "-Dexplicit=eksplicit"
to the CFLAGS?

> using call-clobbered global registers (or something like that).

It's because CLISP plays dirty tricks with the stack pointer, for
efficiency. You can ignore the warnings.

Bruno

---

From: Aaron Ben Neerenberg <[email-masked]>
Date: Fri, 17 Nov 1995 13:44:20 -0800 (PST)

In "Common Lisp: The Language" (2nd ed.), by Steele, take a 
second when you're feeling defeated by code, and look up the index entry 
for "kludges" :)

	-Aaron Neerenberg
	[email-masked]
	Linfield College