Hi Andy/Julian,
I just got round to trying to build Hugs on my freebsd machine at work
bash$ uname -a
FreeBSD thistle.cs.utah.edu 3.0-CURRENT FreeBSD 3.0-CURRENT #0: Mon Dec 14 11:28:13
MST 1998 [EMAIL PROTECTED]:/usr/src/sys/compile/SMPSIMP i386
bash$ gcc -v
gcc version 2.7.2.1
To get it to build, I need this fix
nHandle.c:
#if 0 /* suppress warning in freebsd */
#include <malloc.h>
#endif
#include <stdlib.h>
#include <ctype.h>
#ifndef _WIN32
#if 1 /* make it work in freebsd */
#include <sys/types.h>
#include <sys/time.h>
#endif
Then I removed -lbfd -liberty -ldl from the link line (first 2 not
needed, -ldl is part of libc on freebsd).
Then I ran it:
Prelude> [1..]
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,ASSERTION FAILED: file
../rts/GC.c, line 1111
So I went in with gdb. Couldn't figure out what was wrong but I'm
hoping the following transcript will suggest something to you.
(btw note that start is called _start on FreeBSD. This doesn't seem
to matter too much though since it doesn't seem to be used.)
STGHUGSDIR=`pwd` gdb ./hugs
Prelude> [1..]
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,ASSERTION FAILED: file
../rts/GC.c, line 1111
Program received signal SIGABRT, Aborted.
0x2812ca88 in _kill ()
(gdb) up 3
#3 0x8091098 in evacuate (q=0x50087000) at ../rts/GC.c:1111
1111 || IS_HUGS_CONSTR_INFO(GET_INFO(q))));
(gdb) p q
$1 = (StgClosure *) 0x50087000
(gdb) p *q
$2 = {header = {info = 0x80afa24}, payload = 0x0}
(gdb) p *(q->info)
There is no member named info.
(gdb) p *(q->header.info)
$3 = {srt = 0x0, layout = {payload = {ptrs = 0, nptrs = 0}, bitmap = 0,
selector_offset = 0, large_bitmap = 0x0}, type = 59, srt_len = 0,
entry = 0x809c180 <TSO_entry>, vector = 0x0}
(gdb) p start
No symbol "start" in current context.
(gdb) p _start
$4 = {<text variable, no debug info>} 0x80494e8 <_start>
(gdb) p _etext
$5 = -24 '�'
(gdb) p &_etext
$6 = (<variable (not text or data), no debug info> *) 0x809f800 "�_\235���"
(gdb) p &_end
$7 = (<variable (not text or data), no debug info> *) 0x820ea24 ""
If you can suggest where to start looking, I can have another go at
this.
Alastair
ps Sorry it's taken me so long to try out stghugs - you'd have thought I'd
have jumped on it right away. All my spare cycles have been spent
porting the Graphics library to X11 (beta release in a few days).