GNU bug report logs - #13386
Fwd: bug#13342: Errors trying to build Guile 2.0.7

Previous Next

Package: guile;

Reported by: Peter Teeson <peter.teeson <at> me.com>

Date: Tue, 8 Jan 2013 16:10:01 UTC

Severity: normal

Tags: notabug

Merged with 13342

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


Message #21 received at 13386 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Peter Teeson <pteeson <at> me.com>
Cc: 13342 <at> debbugs.gnu.org,
	Ludovic Courtès <ludo <at> gnu.org>,
	13386 <at> debbugs.gnu.org
Subject: Re: bug#13342: closed (Re: bug#13342: Errors trying to build Guile
	2.0.7) ,
	bug#13386: closed (Re: bug#13342: Errors trying to build Guile 2.0.7)
Date: Sat, 02 Feb 2013 08:11:26 -0500
[Message part 1 (text/plain, inline)]
Hi Peter,

Peter Teeson <pteeson <at> me.com> wrote:
> When you think things are ready to test I'll be glad to do so on my
> Mac setup.

I believe that this libffi patch will fix the problem.  Would you like
to test it?  It would also be helpful if you could run "make check" on
both libffi and Guile and let us know of any failures.  There's no need
to test on older versions of the OS.

    Thanks again!
        Mark


[SIGN_EXTEND_SINT_ARGS.patch (text/x-diff, inline)]
diff --git a/src/x86/ffi64.c b/src/x86/ffi64.c
index b8a823d..2014af2 100644
--- a/src/x86/ffi64.c
+++ b/src/x86/ffi64.c
@@ -484,8 +484,25 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
 		{
 		case X86_64_INTEGER_CLASS:
 		case X86_64_INTEGERSI_CLASS:
-		  reg_args->gpr[gprcount] = 0;
-		  memcpy (&reg_args->gpr[gprcount], a, size < 8 ? size : 8);
+		  /* Sign-extend integer arguments passed in general
+		     purpose registers, to cope with the fact that
+		     LLVM incorrectly assumes that this will be done
+		     (the x86-64 PS ABI does not specify this). */
+		  switch (arg_types[i]->type)
+		    {
+		    case FFI_TYPE_SINT8:
+		      *(SINT64 *)&reg_args->gpr[gprcount] = (SINT64) *((SINT8 *) a);
+		      break;
+		    case FFI_TYPE_SINT16:
+		      *(SINT64 *)&reg_args->gpr[gprcount] = (SINT64) *((SINT16 *) a);
+		      break;
+		    case FFI_TYPE_SINT32:
+		      *(SINT64 *)&reg_args->gpr[gprcount] = (SINT64) *((SINT32 *) a);
+		      break;
+		    default:
+		      reg_args->gpr[gprcount] = 0;
+		      memcpy (&reg_args->gpr[gprcount], a, size < 8 ? size : 8);
+		    }
 		  gprcount++;
 		  break;
 		case X86_64_SSE_CLASS:

This bug report was last modified 12 years and 109 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.