[mercury-users] GC / Guile

Tomas By tomas at basun.net
Sat Jun 11 03:32:44 AEST 2011


Hi all,

After various upgrades, including to Guile 2.0.1, I am having new
problems with the Mercury - Guile combination.

| $ ./test
| 0xac44040 is not a GC visible pointer location
| GC_is_visible test failed
| Aborted
| $

As far as I can tell, the `test' binary uses the Mercury version of the
Boehm GC. All source files shown below.

Any help appreciated.

/Tomas

-----------test.c ----------------------------------------------------
#include <libguile.h>
#include <mercury.h>
#include "hercules.h"
#include "azoth.mh"

static void inner_main(void* data,int argc,char** argv)
{
  scm_shell(argc,argv);
}

int main(int argc,char** argv)
{
  void* dummy;
  mercury_init(argc,argv,&dummy);
  scm_boot_guile(argc,argv,inner_main,NULL);
  return 0;
}
---------- azoth.m ---------------------------------------------------
:- module azoth.
:- interface.
:- pred azoth is det.
:- implementation.
azoth.
:- end_module azoth.
-----------Makefile --------------------------------------------------
nothing: test

MMC = mmc
MMAKE = mmc --make

CC = $(shell $(MMC) --output-cc)
LD = $(shell $(MMC) --output-link-command)

GUILE_CFLAGS=$(shell pkg-config --cflags guile-2.0)
GUILE_LIBS=$(shell pkg-config --libs guile-2.0)

MERCURY_CFLAGS=$(shell $(MMC) --output-cflags)
MERCURY_LIBS=$(shell $(MMC) --mercury-linkage static
--output-library-link-flags)

CFLAGS = $(MERCURY_CFLAGS) $(GUILE_CFLAGS)
LDFLAGS = $(MERCURY_LIBS) $(GUILE_LIBS)

azoth.init : azoth.m
	$(MMC) --make libazoth

azoth_int.o : azoth.init
	$(MMC) --ml azoth --generate-standalone-interface hercules

test.o : test.c azoth.init azoth_int.o
	$(CC) $(CFLAGS) -c test.c

test : test.o azoth_int.o azoth.init
	$(LD) -o test test.o hercules.o libazoth.a $(LDFLAGS)
----------------------------------------------------------------------


--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list