On Mon, 2006-06-26 at 14:06 +0100, Luís Oliveira wrote:
Heh, ECL/x86 too then. Cool. BTW, I still can't compile cffi-tests due to the MAKE-LOAD-FORM bug though. (Well, I'm /assuming/ it's that bug.)
;;; Loading "/Users/luis/src/cffi/tests/bindings.fas" No dispatch function defined for character #<. Broken at LAMBDA.
You probably used an old ECL. Our implementation can compile files with almost any kind of lisp object thanks to some patches contributed by Brian Spilsbury.
I just "darc pull"'ed the latest sources from http://common-lisp.net/project/cffi/darcs/cffi and built it without problems. Indeed there are people using CFFI on ECL since a long time ago. See below how I build a single DLL for CFFI using a trick which is proper to our implementation.
Regards,
Juanjo
---------
jlr@mpq3p59:~/src/lisp/cffi$ ecl ECL (Embeddable Common-Lisp) 0.9h Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya Copyright (C) 1993 Giuseppe Attardi Copyright (C) 2000 Juan J. Garcia-Ripoll ECL is free software, and you are welcome to redistribute it under certain conditions; see file 'Copyright' for details. Type :h for Help. Broken at EVAL.
(require 'asdf)
;;; Loading #P"/home/jlr/lib/ecl/asdf.fas" ("ASDF")
(asdf:make-build "cffi")
; loading system definition from cffi.asd into #<ASDF37 package> ;;; Loading "/home/jlr/src/lisp/cffi/cffi.asd" [...] NIL
(load "cffi.fas")
;;; Loading "/home/jlr/src/lisp/cffi/cffi.fas" ;;; Warning: Redefining class LOAD-FOREIGN-LIBRARY-ERROR [...] "/home/jlr/src/lisp/cffi/cffi.fas"
On 2006-jun-26, at 14:15, Juan Jose Garcia Ripoll wrote:
;;; Loading "/Users/luis/src/cffi/tests/bindings.fas" No dispatch function defined for character #<. Broken at LAMBDA.
You probably used an old ECL. Our implementation can compile files with almost any kind of lisp object thanks to some patches contributed by Brian Spilsbury.
Just to make sure, I did a "make clean", "cvs up" (again) rebuilt ECL from scratch and tried again. I still get the same error. Did you try to load the cffi-tests test suite?
2006/6/26, Luís Oliveira luismbo@gmail.com:
On 2006-jun-26, at 14:15, Juan Jose Garcia Ripoll wrote:
;;; Loading "/Users/luis/src/cffi/tests/bindings.fas" No dispatch function defined for character #<. Broken at LAMBDA.
You probably used an old ECL. Our implementation can compile files with almost any kind of lisp object thanks to some patches contributed
by
Brian Spilsbury.
Just to make sure, I did a "make clean", "cvs up" (again) rebuilt ECL
Do you use the sources from common-lisp.net? Or the older tree (abandoned due to CVS problems) in sourceforge.net?
from scratch and tried again. I still get the same error. Did you try
to load the cffi-tests test suite?
Yes, and indeed I found several bugs in CFFI.
1) You want to use load-foreign-module when loading shared libraries. 2) The flags you pass for building the shared library produce an invalid executable on RedHat 9.0. 3) DEFCVAR uses DEFINE-SYMBOL-MACRO without encapsulating it in an EVAL-WHEN form. This breaks bindings.lisp.
Apart from that, and from the fact that your tests files include functions with too many arguments (ECL is restricted to 64 required arguments, but this could be changed, probably), things run ok here.
Did you also remove al FAS files from CFFI? They typically become incompatible from version to version.
Juanjo
-----
Using ECL from CVS (repository in common-lisp.net!!!) I just type
(require 'asdf) (require 'rt) (asdf::operate 'asdf:load-source-op "cffi") (load "cffi-tests.asd") (asdf:operate 'asdf:load-op "cffi-tests")
On 2006-jun-26, at 18:13, Juan Jose Garcia-Ripoll wrote:
Do you use the sources from common-lisp.net? Or the older tree (abandoned due to CVS problems) in sourceforge.net?
Doh! I was using the sf.net repository. Sorry about that.
- DEFCVAR uses DEFINE-SYMBOL-MACRO without encapsulating it in an
EVAL-WHEN form. This breaks bindings.lisp.
Reading the spec, it seems you are right. Unlike every other macro definers, define-symbol-macro is not required to make the macro available at compile-time. Yet, every other lisp does that. To me, it seems like an oversight in the spec since define-symbol-macro was a late addition to ANSI CL. Is there a particular reason why ECL's define-symbol-macro shouldn't do what the other lisps do?
Apart from that, and from the fact that your tests files include functions with too many arguments (ECL is restricted to 64 required arguments, but this could be changed, probably), things run ok here.
Now that I have a recent ECL, I fixed other cffi-ecl bugs (specific to darwin/ppc). Still, it fails 31 tests on linux/x86 and 35 tests on darwin/ppc. Some of these might be cffi-ecl bugs but others like MAKE- POINTER.HIGH seem to indicate ECL bugs. I'll look into this later, if someone more proficient with ECL doesn't look into this in the mean time.
<cffi.diff>
Thanks! (Didn't understand the RT changes, works fine for me without them, so didn't apply those.)