guile-user
[Top][All Lists]
Advanced

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

Guile + Mercury / GC


From: Tomas By
Subject: Guile + Mercury / GC
Date: Sat, 11 Jun 2011 23:11:13 +0200
User-agent: SquirrelMail/1.4.18

Hi all,

After upgrading to Guile 2.0.1, my Mercury - Guile app stopped working.

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

All source files for a minimal example shown below.

Any help appreciated.

/Tomas

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

int main(int argc,char** argv)
{
  void* dummy;
  mercury_init(argc,argv,&dummy);
  scm_boot_guile(argc,argv,inner_main,NULL);
  return 0;
}

static void inner_main(void* data,int argc,char** argv)
{
  scm_shell(argc,argv);
}
---------- 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)
----------------------------------------------------------------------






reply via email to

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