Daniel Katz | 2 Jul 03:04 2008
Picon

Conflicting symbols problem on OpenMCL/CCL when loading CFFI

Hi -

I just tried to load the latest CFFI from darcs into CCL 1.2, and I  
got a symbol conflict between CCL:COPY-FILE and ALEXANDRIA.0.DEV:COPY- 
FILE:

> CL-USER> (asdf:oos 'asdf:load-op :cffi)
> ; loading system definition from /Users/dkatz/dev/lisp/libs/clbuild/ 
> systems/cffi.asd into #<Package "ASDF0">
> ; registering #<SYSTEM CFFI #x8754B3E> as CFFI
> ; loading system definition from /Users/dkatz/dev/lisp/libs/clbuild/ 
> systems/babel.asd into #<Package "ASDF0">
> ; registering #<SYSTEM BABEL #x87910EE> as BABEL
> ; loading system definition from /Users/dkatz/dev/lisp/libs/clbuild/ 
> systems/alexandria.asd into #<Package "ASDF0">
> ; registering #<SYSTEM :ALEXANDRIA #x87BA8B6> as ALEXANDRIA
> ; loading system definition from /Users/dkatz/dev/lisp/libs/clbuild/ 
> systems/trivial-features.asd into #<Package "ASDF0">
> ; registering #<SYSTEM TRIVIAL-FEATURES #x86F53D6> as TRIVIAL-FEATURES
>
> Using #<Package "CCL"> in #<Package "CFFI-SYS">
> would cause name conflicts with symbols inherited by that package:
> ALEXANDRIA.0.DEV:COPY-FILE  COPY-FILE
>
>    [Condition of type CCL::USE-PACKAGE-CONFLICT-ERROR]
>
> Restarts:
>  0: [CONTINUE] Try again to use #<Package "CCL"> in #<Package "CFFI- 
> SYS">
>  1: [RESOLVE-BY-SHADOWING-IMPORT] SHADOWING-IMPORT one of each pair  
(Continue reading)

Luís Oliveira | 2 Jul 10:05 2008
Picon

Re: Conflicting symbols problem on OpenMCL/CCL when loading CFFI

On Wed, Jul 2, 2008 at 2:04 AM, Daniel Katz <dpkatz <at> gmail.com> wrote:

> When I look in the CFFI code, the problem seems to come from
> cffi--openmcl.lisp where ALEXANDRIA and CCL are both being :use-d without
> any shadowing.

You don't seem to have the latest version:
<http://common-lisp.net/cgi-bin/darcsweb/darcsweb.cgi?r=cffi-cffi;a=headblob;f=/src/cffi-openmcl.lisp>

HTH

--

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/
Daniel Katz | 2 Jul 13:48 2008
Picon

Re: Conflicting symbols problem on OpenMCL/CCL when loading CFFI


On Jul 2, 2008, at 4:05 AM, Luís Oliveira wrote:

> On Wed, Jul 2, 2008 at 2:04 AM, Daniel Katz <dpkatz <at> gmail.com> wrote:
>
>> When I look in the CFFI code, the problem seems to come from
>> cffi--openmcl.lisp where ALEXANDRIA and CCL are both being :use-d  
>> without
>> any shadowing.
>
> You don't seem to have the latest version:
> <http://common-lisp.net/cgi-bin/darcsweb/darcsweb.cgi?r=cffi- 
> cffi;a=headblob;f=/src/cffi-openmcl.lisp>

Oops -- you're right.  I had clbuild still pointing to the old  
repository by mistake.

Sorry for the confusion and thanks for the pointer!!

Dan
Stephen Compall | 23 Jul 06:54 2008
Picon

[PATCH] Expand body only once for uffi:with-cstring.

Got an explosion in CLSQL-PostgreSQL with a uffi:with-cstrings
expansion, as 7 strings makes 128 copies of the body.  On the theory
that the compiler can inline flets far easier than factor them, this
patch puts the body in an flet and calls the resulting function from the
two contexts `with-cstring' creates.


--

-- 
a Mr. Fleming wishes to study bugs in smelly cheese; a Polish woman
wishes to sift through tons of Central African ore to find minute
quantities of a substance she says will glow in the dark; a Mr. Kepler
wants to hear the songs the planets sing.
	--Carl Sagan, "The Demon-Haunted World"
_______________________________________________
cffi-devel mailing list
cffi-devel <at> common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
Luís Oliveira | 24 Jul 01:17 2008
Picon

Re: [PATCH] Expand body only once for uffi:with-cstring.

Pushed! Thanks.

--

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/
Luis Oliveira | 24 Jul 06:00 2008
Picon

New patches: 23-Jul-2008


Wed Jul 23 00:47:29 EDT 2008  Stephen Compall <scompall <at> nocandysw.com>
  * Expand body only once for uffi:with-cstring.

    M ./uffi-compat/uffi-compat.lisp -7 +7

An updated tarball of CFFI's source can be downloaded here:
http://common-lisp.net/project/cffi/tarballs/cffi-080723.tar.gz

Darcsweb URL:
http://common-lisp.net/cgi-bin/darcsweb/darcsweb.cgi?r=cffi-cffi;a=summary
Markus Flambard | 27 Jul 13:20 2008
Picon

Passing struct by value, kind of

Hello lispers!

I know that CFFI doesn't support passing structs by value. What I'm
wondering is, is it possible to squeeze in a small struct by instead
passing it as an int (or something) of the same size as the struct?

Example:

struct MyStruct {
  int32 x, y;
};

int myFunction(struct MyStruct s);

Could I force/lie to CFFI and declare 's' to be of type int64 and pass
it that way?

I tried something similar, but then CFFI (well, ClozureCL) just
couldn't resolve the function symbol..

--

-- 
Markus Flambard
6A63 2761 0A9E E510 DDAF C796 A3DF AB90 9C7C AD5C
Markus Flambard | 27 Jul 16:26 2008
Picon

Re: Passing struct by value, kind of

With some test I found that it is indeed possible. The unresolved
symbol problem was unrelated.

Thanks for listening! :-)

--

-- 
Markus Flambard
6A63 2761 0A9E E510 DDAF C796 A3DF AB90 9C7C AD5C
Luís Oliveira | 27 Jul 16:44 2008
Picon

Re: Passing struct by value, kind of

On Sun, Jul 27, 2008 at 12:20 PM, Markus Flambard <markus <at> flambard.se> wrote:

> I know that CFFI doesn't support passing structs by value. What I'm
> wondering is, is it possible to squeeze in a small struct by instead
> passing it as an int (or something) of the same size as the struct?

On linux/x86, for instance, it's fairly straightforward to pass
structs by value since all arguments are passed on the stack,
word-aligned. For instance, given the following C code:

    /* sizeof(s) => 12 */
    struct s { char c; short s; int i; };
    void f(char x, struct s y, short z);

f can be declared as:

    (defcfun f :void (x :char) (y0 :int) (y1 :int) (z :short))

f(1, {2, 3, 4}, 5) is then equivalent to (f 1 #x00030002 4 5), or
something like that. This works for any struct regardless of its size
or its members' data types. Other architectures might have less
straightforward calling conventions.

--

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/
Luis Oliveira | 29 Jul 06:00 2008
Picon

New patches: 28-Jul-2008


Mon Jul 28 22:33:39 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  * New and improved release script.

    M ./scripts/release.sh -33 +134

Mon Jul 28 22:32:40 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  * doc/Makefile: have upload-docs target build the manual first

    M ./doc/Makefile -1 +1

Mon Jul 28 22:15:53 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  * cffi-tests: mark a few expected failures for ECL

    M ./tests/defcfun.lisp -1 +1
    M ./tests/misc.lisp -1 +1
    M ./tests/strings.lisp +1

Mon Jul 28 22:14:09 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  * ECL: handle FILE-ERRORs in %LOAD-FOREIGN-LIBRARY

    M ./src/cffi-ecl.lisp -1 +4

Mon Jul 28 22:12:20 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  * ECL: support long long on x86-64 by treating it as long.

    M ./src/cffi-ecl.lisp -1 +3

Mon Jul 28 20:41:54 EDT 2008  Luis Oliveira <loliveira <at> common-lisp.net>
  * cffi-tests: mark expected failures for allegro.
(Continue reading)


Gmane