Subject: [clisp-list] Compiling on sparc64

From: Sean Callanan <[email-masked]>
Date: Wed, 22 Nov 2000 01:43:34 -0500 (EST)

Dear mailing list:

I am having issues compiling clisp on 64-bit Sparcs - specifically, an
Ultra 5 (360MHz UltraSparc IIi w/256k cache, SuSE Linux 7.0/sparc) and an
Ultra 10 (400MHz UltraSparc IIi w/2MB cache, Red Hat Linux 6.2/sparc).

I am using gcc and have tried make with no -DSAFETY= setting, and all
settings 1-4, inclusive. These have not succeeded. Settings above 2
resulted in a failure to compile "array.d" among other files, complaining
about invalid operands being passed to binary ==.

Settings where -DSAFETY is less than 2, or entrely left out, resulted in a
segfault (or bus error).

I have tried hacking src/configure to force it to configure for sparc64 -
however, the assembler complains about "requires v9|v9a; requested
architecture is sparclite". And SuSE's distribution includes a
sparc64-linux-gcc; however, this doesn't work properly: I guess it's only
supposed to compile kernels.

What do I need to do here?

Sincerely,

Sean Callanan

--
"The surest sign of intelligent life in the universe is that none of it
has tried to contact us." -- Calvin (www.calvinandhobbes.com)

---

From: Bruno Haible <[email-masked]>
Date: Thu, 23 Nov 2000 23:49:41 +0100 (CET)

Hello Sean,

The support for sparc64 is only tentative and has never been tested.

> about invalid operands being passed to binary ==.

This is fixed in the current CVS.

> architecture is sparclite".

Is it trying to assemble the wrong arisparc.d/arisparc64.d file? Maybe
there are bugs in arisparc64.d.

> I downloaded the CVS version and tried to compile that; it compiled
> fine (after an error which I'll explain in a moment)

The error is fixed now, thanks.

> but still no joy on the segfault problem.

Can you give a backtrace with maximum amount of debugging information?
Does the segfault persist when you remove all -O flags from the
CFLAGS in the Makefile?

Bruno

---

From: Sean Callanan <[email-masked]>
Date: Thu, 23 Nov 2000 22:53:06 -0500

Dear mailing list, particularly Mr. Bruno Haible,

Thank you for being so prompt. I received your message with pleasure, 
and have performed the steps you suggested off of the latest CVS source. 
The errors I mentioned in my previous letter were all corrected.

Anyway, I tried to do what you said on my Ultra 5, running SuSE Linux 
7.0/sparc. It might be of note that although the kernel is 64-bit, the 
only gcc capable of building userland binaries under sparc is 32-bit.

Here are the parameters being passed to GCC:

CFLAGS = -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type 
-fomit-frame-pointer -Wno-sign-compare -O2 -fno-schedule-insns -fno-gcse 
-DDYNAMIC_FFI -DSAFETY=3 -ggdb3

The following steps work:

make init
make allc
make libreadine.a
make lisp.run (lots of warnings, available upon request)

The following is the exact output of "make interpreted.mem"

./lisp.run -m 750KW -B . -N locale -Efile UTF-8 -norc -x "(load 
\"init.lisp\")
(sys::%saveinitmem) (exit)"
  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
  \  `-+-'  /       8         8           8      ooooo   8oooo
   `-__|__-'        8         8           8           8  8
       |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000

;; Loading file defseq.lisp ...
;; Loading of file defseq.lisp is finished.
;; Loading file backquote.lisp ...
;; Loading of file backquote.lisp is finished.
;; Loading file defmacro.lisp ...make: *** [interpreted.mem] 
Segmentation fault

--

Here is a log of my interaction with gdb:

GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-suse-linux"...
.gdbinit:3: Error in sourced command file:
Function "sigsegv_handler_failed" not defined.
(gdb) set args -m 750KW -B . -N locale -Efile UTF-8 -norc -x "(load
\"init.lisp\") (sys::%saveinitmem) (exit)" 
(gdb) run
Starting program: /root/lisp/clisp-devel/src/lisp.run -m 750KW -B . -N 
locale
-Efile UTF-8 -norc -x "(load \"init.lisp\") (sys::%saveinitmem) (exit)"
  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
  \  `-+-'  /       8         8           8      ooooo   8oooo
   `-__|__-'        8         8           8           8  8
       |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000

;; Loading file defseq.lisp ...
;; Loading of file defseq.lisp is finished.
;; Loading file backquote.lisp ...
;; Loading of file backquote.lisp is finished.
;; Loading file defmacro.lisp ...
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) backtrace
No stack.
(gdb) info all-registers
The program has no registers now.

--

How should I get the information you want? Amusingly enough, lisp.run 
does run, even allowing me to do simple things like (+ 0 1).
I will leave the program as is, with interpreted.mem unmade. Anything 
you want me to do, I will do. However, as I am unfamiliar with debugging 
programs, I'm going to need a little help.

Sincerely,

Sean Callanan