[Ecls-list] UFFI returning double is broken?
Matthew Mondor
mm_lists at pulsar-zone.net
Fri Oct 4 19:30:56 UTC 2013
On Fri, 4 Oct 2013 13:06:37 +0000 (UTC)
"anri p." <anri_p at mail.com> wrote:
> I've recently encountered a situation, when calling compiled C function like:
>
> double
> fn( double a);
>
>
> from ECL causes to return garbage. It seem that it is ether an UFFI bug
> or misconfiguration in the build environment. This happens on linux x86-64,
> running 32 bit ECL and compiling C code with -m32 gcc flag. And integer/pointer
> C code calling works fine.
>
> So i believe that it is some issue with FP registers returning convention for x86.
> Is there any way to change it in a some predictable way in both UFFI/ECL and
> gcc options?
Would it be possible to show how you're calling the function from Lisp
(including the UFFI binding)?
Also, it'd be useful to have the C source code which fails and the
assembly of the resulting code. Using (setf c::*delete-files* nil) and
then compiling the file should leave the C file around for inspection.
It's also possible to obtain the resulting assembly using objdump -drw
<file>.fas (from binutils).
Thanks,
--
Matt
More information about the ecl-devel
mailing list