Subject: [SWIPL] StrongARM Install Problem

From: "Sergio Martinez" <[email-masked]>
Date: Wed, 12 Dec 2001 14:54:17 -0800

I'm attempting to compile SWI Prolog on a StrongARM processor.  I used the
following commands to
configure and build from the source:

CFLAGS='-I/mnt/disk/usr/include' CPPFLAGS='-I/mnt/disk/usr/include'
./configure --prefix=/mnt/disk/usr --cache-file=/dev/null \
--includedir=/mnt/disk/usr/include --host=arm-unknown-linux --disable-mapped
-stacks --disable-segv-handling

gmake CIFLAGS='-I/mnt/disk/usr/include'

After the 'pl' executable was built, I got the following assert error:

gcc -export-dynamic  -o pl pl-atom.o pl-wam.o pl-stream.o pl-error.o
pl-arith.o pl-bag.o pl-comp.o pl-rc.o pl-dwim.o pl-ext.o pl-file.o pl-flag.o
pl-fmt.o pl-funct.o pl-gc.o pl-glob.o pl-itf.o pl-list.o pl-load.o
pl-modul.o pl-op.o pl-os.o pl-prims.o pl-pro.o pl-proc.o pl-prof.o pl-read.o
pl-rec.o pl-rl.o pl-setup.o pl-sys.o pl-table.o pl-trace.o pl-util.o
pl-wic.o pl-write.o pl-term.o pl-buffer.o pl-thread.o pl-xterm.o
pl-feature.o pl-ctype.o pl-main.o
pl-extend.o  -Lrc -lrc -ldl -lreadline -lncurses -lm
./pl -O -o pl.prc -b ../boot/init.pl
Loading boot file ...
Loading Prolog startup files
pl: pl-rec.c:848: copyRecordToGlobal: Assertion `b.gstore ==
((&PL_local_data)->stacks.global.top)' failed.
gmake[1]: *** [pl.prc] Aborted
gmake[1]: Leaving directory `/mnt/disk/pl-4.0.11/src'
gmake: *** [all] Error 2

I added some some printf's and found out that 'b.gstore' is 4 larger than
the other value.
Here's the function in question:

void
copyRecordToGlobal(term_t copy, Record r ARG_LD)
{ copy_info b;

  DEBUG(3, Sdprintf("PL_recorded(%p)\n", r));

  b.base = b.data = dataRecord(r);
  b.gstore = allocGlobal(r->gsize);

  INITCOPYVARS(b, r->nvars);
  copy_record(valTermRef(copy), &b);
  FREECOPYVARS(b, r->nvars);

  assert(b.gstore == gTop);
  SECURE(checkData(valTermRef(copy)));
}

I saw that "allocGlobal" increments "gTop" by 12.  "r->gsize" is 3.
The "copy_record" call increments "b.gstore" by 16.  Then the
assert fails.

I would greatly appreciate any help with this.

Thanks a lot,

Sergio Martinez
GNP Computers