Subject: Re: [SWIPL] compile SWI Prolog on cygwin?

From: [email-masked]
Date: Fri, 11 May 2001 16:04:13 -0700

Jan,

To follow up -- I did as you suggested, and make
(and make install) completed successfully.

And, works!

I don't think the disadvantage of not having mapped
stacks will bother me for now.  If I ever have time,
:-)   I'll look into this.

Thanks!

John Velman

Jan Wielemaker <[email-masked]> on 05/11/2001 01:07:20 AM

To:    [email-masked], [email-masked]
cc:

Subject:  Re: [SWIPL] compile SWI Prolog on cygwin?

On Fri, 11 May 2001, [email-masked] wrote:
>I've attempted to compile pl-4.0.4 under cygwin 1.3.1-1
>(the most recent).
>
>Readline gave me a problem, namely, the last part of
>the make output was:
>

>pl-rl.o(.text+0x1c1):pl-rl.c: undefined reference to `rl_event_hook'
>pl-rl.o(.text+0x1ce):pl-rl.c: undefined reference to `rl_event_hook'
>collect2: ld returned 1 exit status
>make: *** [pl] Error 1

This is a hook that allows SWI-Prolog to look for X11 events on behalf
of XPCE.  I don't think that will work.  I've added a test for the
existence of this hook.  See CVS version (get configure, config.h.in and
pl-rl.c)

>ar x `gcc -print-libgcc-file-name` frame.o
>gcc  -o pl -Lrc 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-t
>able.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 frame.o -lrc
-lncurse
>s -lm
>./pl -O -o pl.prc -b ../boot/init.pl
>[FATAL ERROR:
>        mprotect() failed at 0x502d000 for 16384 bytes: Permission denied
>]

This looks more serious.  Looks a bit the mmap() implementation is a bit
dubious.  You can get away using configure --disable-mapped-stacks, but
that also looses all the benefits of mapped stacks.  If you can call
native Win32 API functions, you could use the Windows stack-management
code.  This requires a little fiddling with preprocessor symbols to get
the right implementation from pl-setup.c.  It contains 3 sets of
functions to manage the stacks.  Default on Unix it wants mmap().  On
Windows it want VirtualAlloc() and if all fails it uses malloc().

P.s. Do a `make clean' before recompiling after re-running configure.

     --- Jan

----------------
* To UNSUBSCRIBE, please use the HTML form at

    http://www.swi.psy.uva.nl/projects/SWI-Prolog/index.html#mailinglist

or send mail to [email-masked] using the Subject:
"unsubscribe"
(without the quotes) and *no* message body.

** An ARCHIVE of this list is maintained at

    http://www.swi.psy.uva.nl/projects/SWI-Prolog/mailinglist/archive/