From: ed ed <vegetarian.substitute@gm...> - 2007-08-02 22:04:51
I have been working on a common lisp objective c bridge with a lot of
success there is just one loose end in SBCL that I need to try to sort
out. There is no support for structs as values for return types or
arguments in alien funcalls and callbacks. I have tried to add the
support myself with some luck but there are still some issues I'm not
able to sort out.
I should also mention that I am on x86/darwin and that the code I have
written is relying on parts of the ABI for that platform, I would like
to do this for callbacks, and then PPC as well if I can but I thought
first I should get one thing to work.
I've made a patch to SBCL 22.214.171.124 from CVS which does work (passes
all my tests) when you start up a normal SBCL then evaluate the code
from this file, redefining the alien-funcall deftransform in
src/compiler/aliencomp.lisp. The problem is when trying to build SBCL
from scratch with the patch on the actual codebase.
I was hoping someone can give me some advice for what I did wrong that
is causing this problem and how I should go about fixing that.
The code I wrote: http://fax.twilightcoders.net/sbcl/structs-as-values.lisp
and the patch is: http://fax.twilightcoders.net/sbcl/sbcl-patch.txt
also a build log from trying to compile with the patch, using sb-show:
I have tests here also:
Thanks in advance
From: ed ed <vegetarian.substitute@gm...> - 2007-08-11 11:19:07
Some good news, I have managed to rewrite the code somewhat better so
now I can build SBCL with the changes and all the tests I made passed.
The patch is here:
for x86 tested on darwin
I get various warnings from the compiler like:
; note: unable to
; could not optimize away %SAP-ALIEN: forced to do runtime
; allocation of alien-value structure
I think it's because I am rebinding FUNCTION to a different type at
runtime in the expansion of the deftransform. I'll try to fix this now
but I thought give an update on the progress and also would like for
any comments about this patch so far.