This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ABI incompatibility between libffi and LLVM-generated callees


Hi Andrew,

Andrew Haley <aph@redhat.com> writes:
> On 01/31/2013 12:04 AM, Mark H Weaver wrote:
>> Guile requires a foreign-function interface that works properly on Macs,
>> even if that means working around LLVM bugs for a several years until
>> the improperly-compiled code is sufficiently rare.  I'm sure that many
>> other users of libffi would feel similarly.
>
> Sure, but why don't you just submit a patch?  You have the test
> systems, and you've carefully analysed the problem.  It's much
> harder if someone has to write then throw it over the wall for
> someone else to try.

I'm willing to work on a patch if no one else wants to do it, though I'm
not very familiar with libffi internals, or even how to use its API.
I've only used it via Guile.  My analysis of the problem did not go much
beyond noticing that libffi zero-extends register arguments whereas
LLVM-compiled code expects them to be sign-extended.

Also, for the record, I use GNU/Linux and GCC exclusively, and I don't
have any Mac systems to test on.  However, I did recently compile LLVM
on Debian for purposes of reproducing this bug, so I suppose that makes
it easier for me to test.

I apologize if I sounded as if I were demanding that someone else do
this work.  I'm pleased to hear that a patch would be accepted (assuming
of course that it's deemed to be of sufficient quality), and that's all
that I can reasonably ask for.

    Thanks,
      Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]