guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Building Guile on IA64 HPUX


From: Hrvoje Nikšić
Subject: Building Guile on IA64 HPUX
Date: Wed, 25 Oct 2006 17:31:24 +0200

We use Guile on a number of platforms, including HP-UX 11.23 on Itanium.
While Guile seems to build on IA64 HPUX, it crashes while running
because of GC failing to mark some objects reachable through the stack.

There are three distinct problems that require attention:

1. The checks for __ia64__ don't work on HPUX because its compilers set
__ia64, not __ia64__.

2. The GC code under #ifdef __ia64__ accesses Linux-specific fields of
ucontext_t and the Linux-specific variable
__libc_ia64_register_backing_store_base.

3. The implementation of continuations under IA64 Linux makes use of a
non-standard and (to the best of my knowledge) undocumented extension to
getcontext.  It declares getcontext to return two values, and uses the
second one to determine whether the code after getcontext is executed
linearly or as a result to a call to setcontext.


The first problem can be solved by either changing the ifdefs, or by
#definining __ia64__ if defined(__ia64) && !defined(__ia64__).  That's
the easy one.

The second problem can be solved by using the libuca library on HPUX to
retrieve the Itanium-specific fields of the opaque ucontext_t structure.
This requires a change to configure to detect libuca, but the change is
trivial, since libuca is a "system library", therefore not requiring
special link magic.  As for __libc_ia64_register_backing_store_base, its
HPUX equivalent can be retrieved using the `pstat_getprocvm', as is done
in the Boehm collector.

The third issue requires the addition of a simple boolean field to
scm_t_contregs, which make_continuation uses to keep track of whether
the context was reached by setcontext or by falling through the call to
getcontext.  As far as I can tell, the non-standard use of getcontext is
really not necessary for this to work.


Putting all this together, I assembled a patch which, when applied,
should make Guile buildable on both IA64 HPUX and Linux, without
affecting other architectures.  After applying the patch, you will need
to run autoconf and autoheader.  Unfortunately the patch is for Guile
1.6.7 (which we use locally), but it should be trivial to port to 1.8.1
or 1.6.8.

Attachment: guile-patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]