Subject: Re: bug#10015: Guile-2.0.3: test-ffi fails

From: Mark H Weaver <[email-masked]>
Date: Sun, 24 Feb 2013 22:16:40 -0500

Hi Hans.  Following up on an old bug report:

Hans Aberg <[email-masked]> wrote:
> bad return from expression `(f-sum -1 2000 -30000 40000000000)': expected 39999971999; got 39999972255
> FAIL: test-ffi

This turns out to be due to a bug in LLVM, namely that it improperly
assumes that signed integer arguments will be sign-extended by the
caller, although this is not specified by the SysV x86-64 PS ABI.
The recently-released libffi 3.0.12 works around this problem.

If you're interested in the gory details, see:

  http://sourceware.org/ml/libffi-discuss/2013/msg00012.html
  http://gcc.gnu.org/ml/gcc/2013-01/msg00447.html
  http://bugs.gnu.org/13342

We've been told by another MacOS user that the FFI tests now pass when
Guile is linked against libffi 3.0.12, so I'm closing this bug.  Please
let us know if you continue to have problems with the FFI on MacOS.

Thanks again for the bug report!

     Mark