From: Johann Hibschman
Subject: Compiling GCL on Ultras?
Date: 
Message-ID: <5q65lb$qa8@agate.berkeley.edu>
Hi all,

Does anyone have any information about compiling GCL 2.2 (which I believe is
the latest version) on Ultrasparcs (Solaris 2.5)?

I tried:
	add-defs solaris
	make

and got:

...
gcc -I/fizz/johann/src/gcl-2.2/o -static -DVOL=volatile -fsigned-char -c -O -I../gcl-tk -I../h/ -O4 gbc.c  
sgbc.c: In function `sgc_quit':
In file included from gbc.c:1321:
sgbc.c:1072: warning: assignment makes pointer from integer without a cast
sgbc.c:1074: warning: assignment makes integer from pointer without a cast
sgbc.c: In function `memprotect_handler':
sgbc.c:1124: void value not ignored as it ought to be
*** Error code 1
make: Fatal error: Command failed for target `gbc.o'
Current working directory /fizz/johann/src/gcl-2.2/o
*** Error code 1
make: Fatal error: Command failed for target `all'

I took a look at the source, but I can't figure out what's going on; I'm
sure it's something buried in all of the configuration details, but I
don't know enough to hunt it down myself.

- Johann

-- 
Johann A. Hibschman         | Grad student in Physics, working in Astronomy.
······@physics.berkeley.edu | Probing pulsar pair production processes.
From: ···@ptc.spbu.ru
Subject: Compiling GCL on Solaris. (Was: Compiling GCL on Ultras?)
Date: 
Message-ID: <5qjgn5$63i@svx1.ptc.spbu.ru>
Johann Hibschman <······@physics12.Berkeley.EDU> wrote:

> Does anyone have any information about compiling GCL 2.2 (which I
> believe is the latest version) on Ultrasparcs (Solaris 2.5)?
[...]
> sgbc.c:1124: void value not ignored as it ought to be

At the very begining of h/solaris.h fix GET_FAULT_ADDR macro  by
adding (caddr_t)0 to the `false' branch of ?: operator.

#define GET_FAULT_ADDR(sig,code,scp,addr) \
  (code ? ((siginfo_t *)code )->si_addr : (error("no address info"),(caddr_t)0))

Few more tips/warnings based on my recent experience with compiling
gcl-2.2 on solaris.

* Remove -static from compiler options (unexec can handle shared
  libraries) and comment out stub dlopen &co at the end of
  o/run_process.c.  You really want to do this because solaris libnsl
  uses dl* to load appropriate naming service shared objects based on
  /etc/nsswitch.conf.  With -static you won't be able to resolve
  hostnames (and this implies no CLX).

* There's lost #else in o/sockets.c in set-sigio-for-fd somewhere around
  line 450.

* There's a bug in ld that I was able to reproduce at some machines
  and unable at others.  Unexeced saved_gcl had apparent garbage in
  it's dumped bss segment.  The problem was caused by ld's incorrect
  handling of section alignments.  The following is sections layout
  for a minimal case that reproduces the bug.

    .dtors:  off = 7dc; addr = 207dc; size = 8;   align = 4
    .bss:    off = 7e8; addr = 207e8; size = 10;  align = 8
    .symtab: off = 7e4; addr = 0;     size = 3d0; align = 4

  Note that dtors section that precedes bss ends at 7e4.  bss section
  needs align=8 and so it starts at 7e8 (note that bss is not actually
  stored in the file).  Now symtab only requires align=4 and linker
  incorrectly put it at 7e4 instead of 7e8 thus ignoring the fact that
  it already `allocated' bss.

  When raw_gcl unexecs itself unexec can see that symtab section
  offset is less than bss offest and happily overwrites just dumped
  bss content with the symbol table. I cured the problem by manually
  adding some junk data to the section that preceded bss in raw_gcl to
  make it a bit longer and work around this ld bug.

Hope it helps.

SY, Uwe
-- 
···@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen