Hi there, I'm posting a bunch of small patches to improve the building of guile-vm on Ubuntu amd64. I haven't tested _running_ the programs so far; perhaps I'll have more patches to send after playing with it a bit.
Dale Smith mentioned on IRC that I may need to have copyright assignment papers sorted out first. I have begun this process, but am still sending these patches in hope that they will come in useful (and/or that they're trivial enough not to require full assignment). The patches are in ``git diff'' order. I'm commenting on them separately so maintainers can decide what to include or not. Cheers! ---Chris K. * * * This patch suppresses the ``WARNING: $ac_file_inputs seems to ignore the --datarootdir setting'' message. diff --git a/guile-tools.in b/guile-tools.in index a4db08f..a0255b5 100644 --- a/guile-tools.in +++ b/guile-tools.in @@ -43,7 +43,7 @@ EOF } prefix="@prefix@" -pkgdatadir="@datadir@/@PACKAGE@" +pkgdatadir="@datarootdir@/@PACKAGE@" guileversion="@GUILE_EFFECTIVE_VERSION@" default_scriptsdir=$pkgdatadir/$guileversion/scripts * * * This removes the assumption that a fixnum fits in an int. Looking at the code, the limits of fixnums seem to depend on the size of scm_t_bits, so I'll use this here. The SYNC_REGISTER line is a tab-vs-space consistency fix. diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c index e1c0dbd..43dd3a5 100644 --- a/libguile/vm-i-scheme.c +++ b/libguile/vm-i-scheme.c @@ -223,11 +223,11 @@ VM_DEFINE_FUNCTION (ge, "ge?", 2) ARGS2 (x, y); \ if (SCM_I_INUMP (x) && SCM_I_INUMP (y)) \ { \ - int n = SCM_I_INUM (x) CFUNC SCM_I_INUM (y); \ + scm_t_bits n = SCM_I_INUM (x) CFUNC SCM_I_INUM (y);\ if (SCM_FIXABLE (n)) \ RETURN (SCM_I_MAKINUM (n)); \ } \ - SYNC_REGISTER (); \ + SYNC_REGISTER (); \ RETURN (SFUNC (x, y)); \ } * * * Pointers can't be cast to ints on amd64. diff --git a/libguile/vm.c b/libguile/vm.c index 5ec7d92..688e441 100644 --- a/libguile/vm.c +++ b/libguile/vm.c @@ -94,8 +94,8 @@ reinstate_vm_cont (struct scm_vm *vp, SCM cont) abort (); } vp->ip = p->ip; - vp->sp = vp->stack_limit - (int) p->sp; - vp->fp = vp->stack_limit - (int) p->fp; + vp->sp = vp->stack_limit - (intptr_t) p->sp; + vp->fp = vp->stack_limit - (intptr_t) p->fp; memcpy (vp->sp + 1, p->stack_base, p->stack_size * sizeof (SCM)); } * * * On the version of gnulib distributed with Ubuntu 8.04, the string module is required for autoconf macros which use gl_HEADER_STRING_H_DEFAULTS to work. diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index 5145d01..b49ccbb 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -19,7 +19,7 @@ # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) -gl_MODULES([alloca extensions strcase]) +gl_MODULES([alloca extensions strcase string]) gl_AVOID([]) gl_SOURCE_BASE([lib]) gl_M4_BASE([m4]) * * * Suppress warnings from aclocal about underquoting. diff --git a/m4/labels-as-values.m4 b/m4/labels-as-values.m4 index eedfb55..3cf7320 100644 --- a/m4/labels-as-values.m4 +++ b/m4/labels-as-values.m4 @@ -1,5 +1,5 @@ dnl check for gcc's "labels as values" feature -AC_DEFUN(AC_C_LABELS_AS_VALUES, +AC_DEFUN([AC_C_LABELS_AS_VALUES], [AC_CACHE_CHECK([labels as values], ac_cv_labels_as_values, [AC_TRY_COMPILE([ int foo(int); @@ -15,7 +15,7 @@ l2: return 2; ac_cv_labels_as_values=yes, ac_cv_labels_as_values=no)]) if test "$ac_cv_labels_as_values" = yes; then -AC_DEFINE(HAVE_LABELS_AS_VALUES, [], +AC_DEFINE([HAVE_LABELS_AS_VALUES], [], [Define if compiler supports gcc's "labels as values" (aka computed goto) feature, used to speed up instruction dispatch in the interpreter.]) fi * * * The (system vm core) module doesn't exist currently; instead, (system vm objcode) contains the ``load-objcode'' procedure. diff --git a/src/guile-disasm.in b/src/guile-disasm.in index 08095f5..9c286f0 100644 --- a/src/guile-disasm.in +++ b/src/guile-disasm.in @@ -3,7 +3,7 @@ ;; Obviously, this is -*- Scheme -*-. -(use-modules (system vm core) +(use-modules (system vm objcode) (system vm disasm)) (for-each (lambda (file)