From unknown Fri Jun 20 07:10:28 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#13342 <13342@debbugs.gnu.org> To: bug#13342 <13342@debbugs.gnu.org> Subject: Status: Clang, the FFI, and 8-bit signed integers Reply-To: bug#13342 <13342@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:10:28 +0000 retitle 13342 Clang, the FFI, and 8-bit signed integers reassign 13342 guile submitter 13342 Peter Teeson severity 13342 normal tag 13342 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 02 18:05:34 2013 Received: (at submit) by debbugs.gnu.org; 2 Jan 2013 23:05:34 +0000 Received: from localhost ([127.0.0.1]:40478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqXNN-0000K3-UV for submit@debbugs.gnu.org; Wed, 02 Jan 2013 18:05:34 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54957) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqV7L-0005JR-5p for submit@debbugs.gnu.org; Wed, 02 Jan 2013 15:40:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TqV5x-0006sp-GE for submit@debbugs.gnu.org; Wed, 02 Jan 2013 15:39:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:35888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TqV5x-0006sl-Cr for submit@debbugs.gnu.org; Wed, 02 Jan 2013 15:39:25 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TqV5u-0000qP-J0 for bug-guile@gnu.org; Wed, 02 Jan 2013 15:39:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TqV5r-0006r5-OQ for bug-guile@gnu.org; Wed, 02 Jan 2013 15:39:22 -0500 Received: from nk11p08mm-asmtpout001.mac.com ([17.158.58.246]:48809 helo=nk11p08mm-asmtp001.mac.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TqV5r-0006qa-Fi for bug-guile@gnu.org; Wed, 02 Jan 2013 15:39:19 -0500 MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_SYGIUkL0iWLTdJbEfEAjFQ)" Received: from [192.168.2.10] (bas4-toronto21-1176476140.dsl.bell.ca [70.31.153.236]) by nk11p08mm-asmtp001.mac.com (Oracle Communications Messaging Server 7u4-26.01(7.0.4.26.0) 64bit (built Jul 13 2012)) with ESMTPSA id <0MG0006JLMP9BJ10@nk11p08mm-asmtp001.mac.com> for bug-guile@gnu.org; Wed, 02 Jan 2013 20:39:11 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8327,1.0.431,0.0.0000 definitions=2013-01-02_08:2012-12-31, 2013-01-02, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=6 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1301020217 From: Peter Teeson Subject: Errors trying to build Guile 2.0.7 Date: Wed, 02 Jan 2013 15:39:10 -0500 Message-id: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> To: bug-guile@gnu.org X-Mailer: Apple Mail (2.1283) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 02 Jan 2013 18:05:32 -0500 Cc: Peter Teeson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) --Boundary_(ID_SYGIUkL0iWLTdJbEfEAjFQ) Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: quoted-printable My environment is Mac Pro 4,1 Intel, MacOS 10.7.5 Lion All required Guile libs are newly installed in /usr/local/ I get the following 2 errors, (A & B below) trying to build Guile. (A) I solved this one by installing GNU readline-6.2. Prior to that it must have used Apple's deadline which didn't have the = rl_get_keymap_name function. You might wish to make a test for that function in configure and maybe = make GNU readline a required lib? -------- Tail Log for Make ----- =85... make all-am CC readline.lo readline.c: In function 'init_bouncing_parens': readline.c:445: warning: implicit declaration of function = 'rl_get_keymap_name' readline.c:445: warning: passing argument 1 of 'strncmp' makes pointer = from integer without a cast CCLD libguilereadline-v-18.la Undefined symbols for architecture x86_64: "_rl_get_keymap_name", referenced from: _scm_init_readline in readline.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status make[3]: *** [libguilereadline-v-18.la] Error 1 make[2]: *** [all] Error 2 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 Gandalf:guile-2.0.7 pteeson$ ----------------- readline.c:445 -------- if (strncmp (rl_get_keymap_name (rl_get_keymap ()), "vi", 2)) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D (B) I ran Make Check after Make as I always do and this error is = reported --------------- Make Check -------------------- =85.. PASS: test-asmobs bad return from expression `(f-sum -1 2000 -30000 40000000000)': = expected 39999971999; got 39999972255 FAIL: test-ffi PASS: test-list =85. PASS: test-pthread-create-secondary =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D 1 of 29 tests failed Please report to bug-guile@gnu.org =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D make[5]: *** [check-TESTS] Error 1 make[4]: *** [check-am] Error 2 make[3]: *** [check] Error 2 make[2]: *** [check-recursive] Error 1 make[1]: *** [check-recursive] Error 1 make: *** [check] Error 2 --Boundary_(ID_SYGIUkL0iWLTdJbEfEAjFQ) Content-type: text/html; charset=windows-1252 Content-transfer-encoding: quoted-printable
      _scm_init_readline in = readline.o
ld: symbol(s) not found for architecture = x86_64
collect2: ld returned 1 exit status
make[3]: = *** [libguilereadline-v-18.la] Error 1
make[2]: *** [all] = Error 2
make[1]: *** [all-recursive] Error 1
make: = *** [all] Error 2
Gandalf:guile-2.0.7 = pteeson$

----------------- readline.c:445 = --------
  if (strncmp (rl_get_keymap_name (rl_get_keymap ()), = "vi", 2))
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D


(B) I ran Make Check after Make as I always do = and this error is reported
--------------- Make Check = --------------------
=85..
PASS: = test-asmobs
bad return from expression `(f-sum -1 2000 -30000 = 40000000000)': expected 39999971999; got 39999972255
FAIL: = test-ffi
PASS: test-list
=85.
PASS: = test-pthread-create-secondary
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
1 of 29 tests failed
Please report to bug-guile@gnu.org
=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D
make[5]: *** [check-TESTS] Error = 1
make[4]: *** [check-am] Error 2
make[3]: *** = [check] Error 2
make[2]: *** [check-recursive] Error = 1
make[1]: *** [check-recursive] Error 1
make: *** = [check] Error = 2



= --Boundary_(ID_SYGIUkL0iWLTdJbEfEAjFQ)-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 03 10:22:39 2013 Received: (at 13342) by debbugs.gnu.org; 3 Jan 2013 15:22:39 +0000 Received: from localhost ([127.0.0.1]:41734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tqmct-00046Z-M5 for submit@debbugs.gnu.org; Thu, 03 Jan 2013 10:22:39 -0500 Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:11158) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tqmcn-00046M-Dh for 13342@debbugs.gnu.org; Thu, 03 Jan 2013 10:22:33 -0500 X-IronPort-AV: E=Sophos;i="4.84,403,1355094000"; d="scan'208";a="167359464" Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 03 Jan 2013 16:22:25 +0100 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Peter Teeson Subject: Re: bug#13342: Errors trying to build Guile 2.0.7 References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> Date: Thu, 03 Jan 2013 16:22:24 +0100 In-Reply-To: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> (Peter Teeson's message of "Wed, 02 Jan 2013 15:39:10 -0500") Message-ID: <87r4m22swf.fsf@gnu.org> User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 13342 Cc: 13342@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.3 (----) Hi! Peter Teeson skribis: > I get the following 2 errors, (A & B below) trying to build Guile. > > (A) I solved this one by installing GNU readline-6.2. > Prior to that it must have used Apple's deadline which didn't have the rl= _get_keymap_name > function. Yes, that=E2=80=99s because you were using the Readline =E2=80=9Ccompatibil= ity=E2=80=9D layer of libeditline, which is shipped as part of MacOS. > You might wish to make a test for that function in configure and maybe ma= ke GNU readline a required lib? There are tests checking for GNU Readline. The problem is that libeditline attempts to replicate Readline=E2=80=99s API, but not quite, he= nce the problem. That=E2=80=99s why =E2=80=98README=E2=80=99 insists on using = GNU Readline. > bad return from expression `(f-sum -1 2000 -30000 40000000000)': expected= 39999971999; got 39999972255 > FAIL: test-ffi This is a known issue when building Guile with LLVM/Clang: http://bugs.gnu.org/10015 http://bugs.gnu.org/10681 It would be great if you could investigate. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 03 21:21:14 2013 Received: (at 13342) by debbugs.gnu.org; 4 Jan 2013 02:21:14 +0000 Received: from localhost ([127.0.0.1]:42311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqwuF-0002xA-VI for submit@debbugs.gnu.org; Thu, 03 Jan 2013 21:21:13 -0500 Received: from nk11p08mm-asmtp001.mac.com ([17.158.58.246]:33744) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqwuD-0002x1-74 for 13342@debbugs.gnu.org; Thu, 03 Jan 2013 21:21:10 -0500 MIME-version: 1.0 Content-type: text/plain; charset=windows-1252 Received: from [192.168.2.10] (bas4-toronto21-1176476140.dsl.bell.ca [70.31.153.236]) by nk11p08mm-asmtp001.mac.com (Oracle Communications Messaging Server 7u4-26.01(7.0.4.26.0) 64bit (built Jul 13 2012)) with ESMTPSA id <0MG2000OOX72BN20@nk11p08mm-asmtp001.mac.com> for 13342@debbugs.gnu.org; Fri, 04 Jan 2013 02:21:03 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8327,1.0.431,0.0.0000 definitions=2013-01-04_01:2013-01-03, 2013-01-04, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=4 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1301030330 Subject: Re: bug#13342: Errors trying to build Guile 2.0.7 From: Peter Teeson In-reply-to: Date: Thu, 03 Jan 2013 21:21:00 -0500 Content-transfer-encoding: quoted-printable Message-id: <69FAB6BC-CFB2-49AC-B103-D57E454091F0@me.com> References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> <87r4m22swf.fsf@gnu.org> To: =?iso-8859-1?Q?Ludovic_Court=E8s?= X-Mailer: Apple Mail (2.1283) X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13342 Cc: 13342@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hi Ludo': Thanks for your reply and your explanation. On 2013-01-03, at 10:22 AM, Ludovic Court=E8s wrote: >> (A) I solved this one by installing GNU readline-6.2. >> Prior to that it must have used Apple's deadline which didn't have = the rl_get_keymap_name >> function. >=20 > Yes, that=92s because you were using the Readline =93compatibility=94 = layer of > libeditline, which is shipped as part of MacOS. >> You might wish to make a test for that function in configure and = maybe make GNU readline a required lib? >=20 > There are tests checking for GNU Readline. The problem is that > libeditline attempts to replicate Readline=92s API, but not quite, = hence > the problem. That=92s why =91README=92 insists on using GNU Readline. Before I did/do anything I always read the README ;} Somehow I missed the README insisting - I still don't see it there;} There is a cryptic statement on page 1 "It will also use the libreadline library if it is available."=20 and buried later on at line 413 (using BBEdit) "guile-readline: The glue code for using GNU readline with Guile. This will be build when configure can find a recent enough readline library on your system." I agree there should be something mentioning the Mac situation and = insisting on on GNU Readline. Where do you think it should be explicitly = mentioned? In the Special Instructions For Some Systems section? >> bad return from expression `(f-sum -1 2000 -30000 40000000000)': = expected 39999971999; got 39999972255 >> FAIL: test-ffi >=20 > This is a known issue when building Guile with LLVM/Clang: >=20 > http://bugs.gnu.org/10015 > http://bugs.gnu.org/10681 >=20 > It would be great if you could investigate. I'd be glad to try and help but please give me pointers on how to = approach this. This will be a learning exercise for me as I am familiar with Xcode and = it's debugger (GDB and LLDB) but have only used it developing Cocoa = apps. Care to suggest how I should approach things? thanks and respect=85. Peter From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 03 21:53:31 2013 Received: (at 13342) by debbugs.gnu.org; 4 Jan 2013 02:53:31 +0000 Received: from localhost ([127.0.0.1]:42337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqxPV-0003j9-Dm for submit@debbugs.gnu.org; Thu, 03 Jan 2013 21:53:30 -0500 Received: from nk11p08mm-asmtpout002.mac.com ([17.158.58.247]:51513 helo=nk11p08mm-asmtp002.mac.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqwsH-0002tn-6n for 13342@debbugs.gnu.org; Thu, 03 Jan 2013 21:19:10 -0500 MIME-version: 1.0 Content-type: text/plain; charset=windows-1252 Received: from [192.168.2.10] (bas4-toronto21-1176476140.dsl.bell.ca [70.31.153.236]) by nk11p08mm-asmtp002.mac.com (Oracle Communications Messaging Server 7u4-26.01(7.0.4.26.0) 64bit (built Jul 13 2012)) with ESMTPSA id <0MG2007Q4X3CHJA0@nk11p08mm-asmtp002.mac.com> for 13342@debbugs.gnu.org; Fri, 04 Jan 2013 02:18:49 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8327,1.0.431,0.0.0000 definitions=2013-01-04_01:2013-01-03, 2013-01-04, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=4 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1301030329 Subject: Re: bug#13342: Errors trying to build Guile 2.0.7 From: Peter Teeson In-reply-to: Date: Thu, 03 Jan 2013 21:18:47 -0500 Content-transfer-encoding: quoted-printable Message-id: References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> <87r4m22swf.fsf@gnu.org> To: Peter Teeson X-Mailer: Apple Mail (2.1283) X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13342 X-Mailman-Approved-At: Thu, 03 Jan 2013 21:53:28 -0500 Cc: 13342@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hi Ludo': Thanks for your reply and your explanation. On 2013-01-03, at 10:22 AM, Ludovic Court=E8s wrote: >> (A) I solved this one by installing GNU readline-6.2. >> Prior to that it must have used Apple's deadline which didn't have = the rl_get_keymap_name >> function. >=20 > Yes, that=92s because you were using the Readline =93compatibility=94 = layer of > libeditline, which is shipped as part of MacOS. >> You might wish to make a test for that function in configure and = maybe make GNU readline a required lib? >=20 > There are tests checking for GNU Readline. The problem is that > libeditline attempts to replicate Readline=92s API, but not quite, = hence > the problem. That=92s why =91README=92 insists on using GNU Readline. Before I did/do anything I always read the README ;} Somehow I missed the README insisting - I still don't see it there;} There is a cryptic statement on page 1 "It will also use the libreadline library if it is available."=20 and buried later on at line 413 (using BBEdit) "guile-readline: The glue code for using GNU readline with Guile. This will be build when configure can find a recent enough readline library on your system." I agree there should be something mentioning the Mac situation and = insisting on on GNU Readline. Where do you think it should be explicitly = mentioned? In the Special Instructions For Some Systems section? >> bad return from expression `(f-sum -1 2000 -30000 40000000000)': = expected 39999971999; got 39999972255 >> FAIL: test-ffi >=20 > This is a known issue when building Guile with LLVM/Clang: >=20 > http://bugs.gnu.org/10015 > http://bugs.gnu.org/10681 >=20 > It would be great if you could investigate. I'd be glad to try and help but please give me pointers on how to = approach this. This will be a learning exercise for me as I am familiar with Xcode and = it's debugger (GDB and LLDB) but have only used it developing Cocoa = apps. Care to suggest how I should approach things? thanks and respect=85. Peter From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 04 12:23:49 2013 Received: (at 13342) by debbugs.gnu.org; 4 Jan 2013 17:23:49 +0000 Received: from localhost ([127.0.0.1]:43788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TrAzk-00050c-4c for submit@debbugs.gnu.org; Fri, 04 Jan 2013 12:23:48 -0500 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:30324) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TrAzg-00050X-9s for 13342@debbugs.gnu.org; Fri, 04 Jan 2013 12:23:46 -0500 X-IronPort-AV: E=Sophos;i="4.84,411,1355094000"; d="scan'208";a="188496364" Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 04 Jan 2013 18:23:34 +0100 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Peter Teeson Subject: Re: bug#13342: Errors trying to build Guile 2.0.7 References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> <87r4m22swf.fsf@gnu.org> <69FAB6BC-CFB2-49AC-B103-D57E454091F0@me.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 15 =?utf-8?Q?Niv=C3=B4se?= an 221 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Fri, 04 Jan 2013 18:23:34 +0100 In-Reply-To: <69FAB6BC-CFB2-49AC-B103-D57E454091F0@me.com> (Peter Teeson's message of "Thu, 03 Jan 2013 21:21:00 -0500") Message-ID: <877gnsvp49.fsf@gnu.org> User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: 13342 Cc: 13342@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Hi, Peter Teeson skribis: > On 2013-01-03, at 10:22 AM, Ludovic Court=C3=A8s wrote: >>> (A) I solved this one by installing GNU readline-6.2. >>> Prior to that it must have used Apple's deadline which didn't have the = rl_get_keymap_name >>> function. >>=20 >> Yes, that=E2=80=99s because you were using the Readline =E2=80=9Ccompati= bility=E2=80=9D layer of >> libeditline, which is shipped as part of MacOS. > >>> You might wish to make a test for that function in configure and maybe = make GNU readline a required lib? >>=20 >> There are tests checking for GNU Readline. The problem is that >> libeditline attempts to replicate Readline=E2=80=99s API, but not quite,= hence >> the problem. That=E2=80=99s why =E2=80=98README=E2=80=99 insists on usi= ng GNU Readline. > Before I did/do anything I always read the README ;} > Somehow I missed the README insisting - I still don't see it there;} > There is a cryptic statement on page 1 > "It will also use the libreadline library if it is available."=20 > > and buried later on at line 413 (using BBEdit) > "guile-readline: > The glue code for using GNU readline with Guile. This > will be build when configure can find a recent enough readline > library on your system." > > I agree there should be something mentioning the Mac situation and insist= ing on on GNU Readline. Where do you think it should be explicitly mentione= d? In the Special Instructions For Some Systems section? Well, you=E2=80=99re right that it doesn=E2=80=99t really insist. ;-) It = does mention GNU Readline though, which is not what was being used here. I=E2=80=99m reluctant to adding anything special about libeditline, since they=E2=80=99re really failing to be compatible with Readline here, and it= =E2=80=99s something to be fixed in libeditline. >>> bad return from expression `(f-sum -1 2000 -30000 40000000000)': expect= ed 39999971999; got 39999972255 >>> FAIL: test-ffi >>=20 >> This is a known issue when building Guile with LLVM/Clang: >>=20 >> http://bugs.gnu.org/10015 >> http://bugs.gnu.org/10681 >>=20 >> It would be great if you could investigate. > > I'd be glad to try and help but please give me pointers on how to approac= h this. I=E2=80=99d first add printfs in test_ffi_sum (in test-ffi-lib.c) to see if= it gets the right arguments. Depending on the result, I=E2=80=99d try to call test_ffi_sum from C with the same arguments to see if it=E2=80=99s an integer-wrapping issue. I=E2=80=99ll try a Clang build when time permits to see what happens. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 08 11:09:30 2013 Received: (at submit) by debbugs.gnu.org; 8 Jan 2013 16:09:30 +0000 Received: from localhost ([127.0.0.1]:56956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tsbk1-0005Ho-PT for submit@debbugs.gnu.org; Tue, 08 Jan 2013 11:09:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43552) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tsbjy-0005Ha-3s for submit@debbugs.gnu.org; Tue, 08 Jan 2013 11:09:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tsbji-0006dE-5W for submit@debbugs.gnu.org; Tue, 08 Jan 2013 11:09:16 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:49870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tsbji-0006d8-1v for submit@debbugs.gnu.org; Tue, 08 Jan 2013 11:09:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsbjW-0003e6-OM for bug-guile@gnu.org; Tue, 08 Jan 2013 11:09:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsbjO-0006cK-Sg for bug-guile@gnu.org; Tue, 08 Jan 2013 11:08:58 -0500 Received: from nk11p08mm-asmtpout002.mac.com ([17.158.58.247]:58340 helo=nk11p08mm-asmtp002.mac.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsbjO-0006az-K0; Tue, 08 Jan 2013 11:08:50 -0500 MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_qkGrg1fvQ3U843pTKVSJiQ)" Received: from [192.168.2.10] (bas4-toronto21-1176476140.dsl.bell.ca [70.31.153.236]) by nk11p08mm-asmtp002.mac.com (Oracle Communications Messaging Server 7u4-26.01(7.0.4.26.0) 64bit (built Jul 13 2012)) with ESMTPSA id <0MGB00MHVE5X7T70@nk11p08mm-asmtp002.mac.com>; Tue, 08 Jan 2013 16:08:43 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8327,1.0.431,0.0.0000 definitions=2013-01-08_06:2013-01-08, 2013-01-08, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=3 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1301080118 Subject: Re: [PARTIALLY SOLVED] bug#13342: Errors trying to build Guile 2.0.7 From: Peter Teeson In-reply-to: <895C23AD-DD0D-40FC-AD5F-6CEF52365444@me.com> Date: Tue, 08 Jan 2013 11:08:43 -0500 Message-id: <7C7443E9-9DA7-493D-8321-F5859170BAB5@me.com> References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> <87r4m22swf.fsf@gnu.org> <69FAB6BC-CFB2-49AC-B103-D57E454091F0@me.com> <877gnsvp49.fsf@gnu.org> <895C23AD-DD0D-40FC-AD5F-6CEF52365444@me.com> To: =?iso-8859-1?Q?Ludovic_Court=E8s?= X-Mailer: Apple Mail (2.1283) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit Cc: bug-guile@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) --Boundary_(ID_qkGrg1fvQ3U843pTKVSJiQ) Content-type: text/plain; CHARSET=US-ASCII Content-transfer-encoding: 7BIT Hi Ludo: I think the reason that we get this error is that the "a" argument is declared to be only 8 bits wide but is passed in as -1 which is correctly represented as 0xFFFFFFFF However an 8-bit representation is 0xFF which is only 255. Here is how I tracked it down: (0) Took the printf's from my test program and placed them in scm_t_int64 test_ffi_sum (scm_t_int8 a, scm_t_int16 b, scm_t_int32 c, scm_t_int64 d); scm_t_int64 test_ffi_sum (scm_t_int8 a, scm_t_int16 b, scm_t_int32 c, scm_t_int64 d) { scm_t_int64 sum; printf("scm_t_int64 d %" "ll" "d" " %#llX \n", d,d); printf("scm_t_int32 c %" "d" " %#X \n", c,c); printf("scm_t_int16 b %" "hd" " %#X \n", b,b); printf("scm_t_int8 a %" "hh" "d" " %#X \n", a,a); sum = d + c + b + a; printf("scm_t_int64 sum %" "ll" "d" " %#llX \n", sum,sum); a = -1; // NOTE:re-assign of a!!!! printf("scm_t_int16 a %" "hd" " %#X \n", a,a); return d + c + b + a; } (1) Did make and make check with the following result scm_t_int64 d 40000000000 0X9502F9000 scm_t_int32 c -30000 0XFFFF8AD0 scm_t_int16 b 2000 0X7D0 scm_t_int8 a -1 0XFF scm_t_int64 sum 39999972255 0X9502F239F scm_t_int16 a -1 0XFFFFFFFF PASS: test-ffi (2) Observe that the test passed. So I think my original suspicion seems to have been confirmed. I do not know where to go from here but await your further instructions. respect Peter --Boundary_(ID_qkGrg1fvQ3U843pTKVSJiQ) Content-type: text/html; CHARSET=US-ASCII Content-transfer-encoding: quoted-printable Hi = Ludo:
I think the reason that we get this error is that the "a" = argument is declared to be only 8 bits wide
but is passed in = as -1 which is correctly represented as = 0xFFFFFFFF

However an 8-bit representation is = 0xFF which is only 255.

Here is how I tracked = it down:
(0) Took the printf's from my test program and placed = them in 

scm_t_int64 test_ffi_sum (scm_t_int8 a, scm_t_int16 = b,
            =               scm_t_int32 c, = scm_t_int64 d);
scm_t_int64 test_ffi_sum = (scm_t_int8 a, scm_t_int16 b,
                  =         scm_t_int32 c, scm_t_int64 = d)
{
    scm_t_int64 sum;
    printf("scm_t_int32 c %" "d" " = %#X \n", c,c);
    = printf("scm_t_int16 b %" "hd" " %#X \n", b,b);
    printf("scm_t_int8 a %" "hh" "d" " %#X \n", = a,a);
    sum =3D d + c + b + = a;
    printf("scm_t_int64 sum %" "ll" = "d" " %#llX \n", sum,sum);

    a =3D -1; // =  NOTE:re-assign of a!!!!
    printf("scm_t_int16 a %" "hd" " %#X \n", = a,a);

    return d + c + b + a;
}

(1) Did make and make = check with the following result

scm_t_int64 d 40000000000 = 0X9502F9000 
scm_t_int32 c -30000 = 0XFFFF8AD0 
scm_t_int16 b 2000 = 0X7D0 
scm_t_int8 a -1 = 0XFF 
scm_t_int64 sum 39999972255 = 0X9502F239F 
scm_t_int16 a -1 = 0XFFFFFFFF 
PASS: = test-ffi


(2) Observe that the test = passed. 
So I think my original suspicion seems to have been = confirmed.

I do not know where to go from here but await your further = instructions.

respect

Peter
= --Boundary_(ID_qkGrg1fvQ3U843pTKVSJiQ)-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 08 11:31:28 2013 Received: (at submit) by debbugs.gnu.org; 8 Jan 2013 16:31:28 +0000 Received: from localhost ([127.0.0.1]:56982 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tsc5H-0005ot-3z for submit@debbugs.gnu.org; Tue, 08 Jan 2013 11:31:27 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49151) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tsc5E-0005oh-Cg for submit@debbugs.gnu.org; Tue, 08 Jan 2013 11:31:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tsc4y-0004fO-Hj for submit@debbugs.gnu.org; Tue, 08 Jan 2013 11:31:14 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:38168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tsc4y-0004fK-EL for submit@debbugs.gnu.org; Tue, 08 Jan 2013 11:31:08 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tsc4v-0007ZQ-KP for bug-guile@gnu.org; Tue, 08 Jan 2013 11:31:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tsc4r-0004eh-Rx for bug-guile@gnu.org; Tue, 08 Jan 2013 11:31:05 -0500 Received: from nk11p08mm-asmtp002.mac.com ([17.158.58.247]:44936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tsc4r-0004dK-Ke; Tue, 08 Jan 2013 11:31:01 -0500 MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_xukbwMxAENoFrfMVjhka3Q)" Received: from [192.168.2.10] (bas4-toronto21-1176476140.dsl.bell.ca [70.31.153.236]) by nk11p08mm-asmtp002.mac.com (Oracle Communications Messaging Server 7u4-26.01(7.0.4.26.0) 64bit (built Jul 13 2012)) with ESMTPSA id <0MGB003QVF70H610@nk11p08mm-asmtp002.mac.com>; Tue, 08 Jan 2013 16:30:38 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8327,1.0.431,0.0.0000 definitions=2013-01-08_06:2013-01-08, 2013-01-08, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=6 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1301080121 From: Peter Teeson Subject: Re: bug#13342: Errors trying to build Guile 2.0.7 [PARTIALLY SOLVED] Date: Tue, 08 Jan 2013 11:30:36 -0500 Message-id: <87D82FD7-F4FA-4516-9C31-8201F9EC172F@me.com> To: bug-guile@gnu.org X-Mailer: Apple Mail (2.1283) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit Cc: =?iso-8859-1?Q?Ludovic_Court=E8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) --Boundary_(ID_xukbwMxAENoFrfMVjhka3Q) Content-type: text/plain; CHARSET=US-ASCII Content-transfer-encoding: 7BIT Hi Ludo: I believe my conjecture that -1 was correct based on the following: (0) I took the printf statements from my test program and placed them in test-ffi-sum: scm_t_int64 test_ffi_sum (scm_t_int8 a, scm_t_int16 b, scm_t_int32 c, scm_t_int64 d); scm_t_int64 test_ffi_sum (scm_t_int8 a, scm_t_int16 b, scm_t_int32 c, scm_t_int64 d) { scm_t_int64 sum; printf("scm_t_int64 d %" "ll" "d" " %#llX \n", d,d); printf("scm_t_int32 c %" "d" " %#X \n", c,c); printf("scm_t_int16 b %" "hd" " %#X \n", b,b); printf("scm_t_int8 a %" "hh" "d" " %#X \n", a,a); sum = d + c + b + a; printf("scm_t_int64 sum %" "ll" "d" " %#llX \n", sum,sum); a = -1; // NOTE re-assinging of a! printf("scm_t_int16 a %" "hd" " %#X \n", a,a); return d + c + b + a; } (1) Ran make Making all in standalone make all-am CC libtest_ffi_la-test-ffi-lib.lo CCLD libtest-ffi.la and then make check scm_t_int64 d 40000000000 0X9502F9000 scm_t_int32 c -30000 0XFFFF8AD0 scm_t_int16 b 2000 0X7D0 scm_t_int8 a -1 0XFF scm_t_int64 sum 39999972255 0X9502F239F scm_t_int16 a -1 0XFFFFFFFF PASS: test-ffi (2) Since scm_t_int8 is only 8 bits wide it's maximum value is 0xFF <=> 255 Reassigning "a" to be -1 allowed it to pass the test. (3) Therefore I conclude that this is why the test fails (correctly IMHO). You can only get a litre of milk into a litre jar! (4) Where do we go from here? respect Peter --Boundary_(ID_xukbwMxAENoFrfMVjhka3Q) Content-type: text/html; CHARSET=US-ASCII Content-transfer-encoding: quoted-printable Hi = Ludo:

I believe my conjecture that -1 was correct = based on the following:

(0) I took the printf = statements from my test program and placed them = in 
test-ffi-sum:

scm_t_int64 test_ffi_sum (scm_t_int8 a, scm_t_int16 = b,
            =               scm_t_int32 c, = scm_t_int64 d);
scm_t_int64 test_ffi_sum = (scm_t_int8 a, scm_t_int16 b,
                  =         scm_t_int32 c, scm_t_int64 = d)
{
    scm_t_int64 sum;
    printf("scm_t_int64 d %" "ll" "d" " %#llX \n", = d,d);
    printf("scm_t_int32 c %" "d" " = %#X \n", c,c);
    = printf("scm_t_int16 b %" "hd" " %#X \n", b,b);
    printf("scm_t_int8 a %" "hh" "d" " %#X \n", = a,a);

    sum =3D d + c + b + a;
    printf("scm_t_int64 sum %" "ll" "d" " %#llX \n", = sum,sum);

    a =3D -1; // NOTE re-assinging of = a!
    printf("scm_t_int16 a %" "hd" " = %#X \n", a,a);

    return d + c + b + a;
}

(1) Ran make 

Making all in standalone
make  all-am
  CC     =   libtest_ffi_la-test-ffi-lib.lo
  CCLD     = libtest-ffi.la

and then make check

scm_t_int64 d 40000000000 = 0X9502F9000 
scm_t_int32 c -30000 = 0XFFFF8AD0 
scm_t_int16 b 2000 = 0X7D0 
scm_t_int8 a -1 = 0XFF 
scm_t_int64 sum 39999972255 = 0X9502F239F 
scm_t_int16 a -1 = 0XFFFFFFFF 
PASS: = test-ffi

(2) Since scm_t_int8 is only 8 bits wide it's = maximum value is 0xFF <=3D> 255
Reassigning "a" to be -1 allowed it to pass = the test.

(3) Therefore I conclude that this is why the = test fails (correctly IMHO).
You can only get a litre of milk into a litre = jar!

(4) Where do we go from = here?

respect

Peter
= --Boundary_(ID_xukbwMxAENoFrfMVjhka3Q)-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 27 09:12:00 2013 Received: (at 13342) by debbugs.gnu.org; 27 Jan 2013 14:12:01 +0000 Received: from localhost ([127.0.0.1]:51160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzSxk-0004Ym-0p for submit@debbugs.gnu.org; Sun, 27 Jan 2013 09:12:00 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:34319) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzSxe-0004YW-GO for 13342@debbugs.gnu.org; Sun, 27 Jan 2013 09:11:57 -0500 X-IronPort-AV: E=Sophos;i="4.84,546,1355094000"; d="scan'208";a="246192" Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 27 Jan 2013 15:11:32 +0100 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Peter Teeson Subject: Re: [PARTIALLY SOLVED] bug#13342: Errors trying to build Guile 2.0.7 References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> <87r4m22swf.fsf@gnu.org> <69FAB6BC-CFB2-49AC-B103-D57E454091F0@me.com> <877gnsvp49.fsf@gnu.org> <895C23AD-DD0D-40FC-AD5F-6CEF52365444@me.com> <7C7443E9-9DA7-493D-8321-F5859170BAB5@me.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 8 =?utf-8?Q?Pluvi=C3=B4se?= an 221 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Sun, 27 Jan 2013 15:11:32 +0100 In-Reply-To: <7C7443E9-9DA7-493D-8321-F5859170BAB5@me.com> (Peter Teeson's message of "Tue, 08 Jan 2013 11:08:43 -0500") Message-ID: <87a9ru7m23.fsf@gnu.org> User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 13342 Cc: 13342@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.8 (----) Hi Peter, Sorry for the late reply, and thanks for investigating. I reproduced the bug on GNU/Linux with Clang 3.1. Peter Teeson skribis: > I think the reason that we get this error is that the "a" argument is dec= lared to be only 8 bits wide > but is passed in as -1 which is correctly represented as 0xFFFFFFFF > > However an 8-bit representation is 0xFF which is only 255. This is part of the issue. Consider this example: --8<---------------cut here---------------start------------->8--- #include int64_t test_sum (int8_t a, int64_t b) { return a + b; } --8<---------------cut here---------------end--------------->8--- When compiled with GCC 4.6, the assembly is: --8<---------------cut here---------------start------------->8--- test_sum: .LFB0: .cfi_startproc movsbq %dil, %rdi leaq (%rdi,%rsi), %rax ret .cfi_endproc --8<---------------cut here---------------end--------------->8--- With Clang 3.1, it is: --8<---------------cut here---------------start------------->8--- test_sum: # @test_sum .cfi_startproc # BB#0: movslq %edi, %rax addq %rsi, %rax ret --8<---------------cut here---------------end--------------->8--- The =E2=80=98movsbq=E2=80=99 emitted by GCC arranges to keep only the 8 LSB= s. Clang does no such thing, thus keeping all the bits of the first operand in the addition. I looked at Section 3.2.3 (=E2=80=9CParameter Passing=E2=80=9D) of the SysV= ABI x86_64 PS but couldn=E2=80=99t find any evidence as to what the correct behavior i= s. However, on the caller side, both compilers emit the same code. This program: --8<---------------cut here---------------start------------->8--- #include extern int64_t test_sum (int8_t a, int64_t b); int64_t foo (void) { return test_sum (-1, 123132); } --8<---------------cut here---------------end--------------->8--- leads to the following assembly with both compilers: --8<---------------cut here---------------start------------->8--- foo: # @foo .cfi_startproc movl $-1, %edi movl $123132, %esi # imm =3D 0x1E0FC jmp test_sum # TAILCALL --8<---------------cut here---------------end--------------->8--- (And as we=E2=80=99ve seen, libffi does the same.) So that seems to indicate that the callee code generated by Clang is incorrect as it fails to discard the 24 MSBs of its first argument. Could you report it as a Clang/LLVM bug (keeping 13342@debbugs.gnu.org Cc=E2=80=99d)? Thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 27 16:35:32 2013 Received: (at 13342) by debbugs.gnu.org; 27 Jan 2013 21:35:32 +0000 Received: from localhost ([127.0.0.1]:51699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzZsy-0008E9-5k for submit@debbugs.gnu.org; Sun, 27 Jan 2013 16:35:32 -0500 Received: from nk11p08mm-asmtpout001.mac.com ([17.158.58.246]:54156 helo=nk11p08mm-asmtp001.mac.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzZsv-0008E1-09 for 13342@debbugs.gnu.org; Sun, 27 Jan 2013 16:35:31 -0500 MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_HibOZqOn47OBRWr6SN1yVg)" Received: from [192.168.2.10] (bas4-toronto21-1176476140.dsl.bell.ca [70.31.153.236]) by nk11p08mm-asmtp001.mac.com (Oracle Communications Messaging Server 7u4-26.01(7.0.4.26.0) 64bit (built Jul 13 2012)) with ESMTPSA id <0MHA00G69ZYFCI70@nk11p08mm-asmtp001.mac.com> for 13342@debbugs.gnu.org; Sun, 27 Jan 2013 21:35:05 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8327,1.0.431,0.0.0000 definitions=2013-01-27_07:2013-01-25, 2013-01-27, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=4 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1301270251 Subject: Re: [PARTIALLY SOLVED] bug#13342: Errors trying to build Guile 2.0.7 From: Peter Teeson In-reply-to: <87a9ru7m23.fsf@gnu.org> Date: Sun, 27 Jan 2013 16:35:04 -0500 Message-id: <39E86B9E-8939-4F1C-9DFE-2071010E1E70@me.com> References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> <87r4m22swf.fsf@gnu.org> <69FAB6BC-CFB2-49AC-B103-D57E454091F0@me.com> <877gnsvp49.fsf@gnu.org> <895C23AD-DD0D-40FC-AD5F-6CEF52365444@me.com> <7C7443E9-9DA7-493D-8321-F5859170BAB5@me.com> <87a9ru7m23.fsf@gnu.org> To: =?iso-8859-1?Q?Ludovic_Court=E8s?= X-Mailer: Apple Mail (2.1283) X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13342 Cc: 13342@debbugs.gnu.org, guile-devel@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) --Boundary_(ID_HibOZqOn47OBRWr6SN1yVg) Content-type: text/plain; CHARSET=US-ASCII Content-transfer-encoding: 7BIT Hi Ludo: MacOS 10.7.5 Intel Dual CPU quad cores Many thanks for your reply. A nice demo but, no disrespect, maybe not really the issue. Looking at the generated code from each compiler was going to be my next step after taking a look at the stack and regs to see what got passed/pushed/popped in the call to test_sum. Which is why I posted about how can I debug/step through the interpreter. I still don't understand how to do that even though I read through the manual. My experiment in building guile with both compilers indicate they both produce the same error. bad return from expression `(f-sum -1 2000 -30000 40000000000)': expected 39999971999; got 39999972255 I am still of the opinion that it's an interpreter issue and not a compiler one. I ask for help in confirming my understanding of this scheme code from the file /test-suite/standalone/test-ffi ;; ;; Multiple int args of differing types ;; (define f-sum (pointer->procedure int64 (dynamic-func "test_ffi_sum" lib) (list int8 int16 int32 int64))) (test (f-sum -1 2000 -30000 40000000000) ;; This calls the c function f-sum (+ -1 2000 -30000 40000000000)) ;; This executes the scheme interpreter to do the sum Is my understanding correct?????? If so please explain to me how the interpreter knows that the -1 in this expression is an int8? My suspicion is that it thinks it's an int16 and that's why we see the difference!! I don't know how to pass an int8 of -1 to the interpreter in REPL mode. Otherwise I'd try that. ============= from Terminal REPL session ============= Gandalf:guile-2.0.7 pteeson$ guile GNU Guile 2.0.7 scheme@(guile-user)> (+ -1 2000 -30000 40000000000) $1 = 39999971999 scheme@(guile-user)> ,q which matches the fail message value. bad return from expression `(f-sum -1 2000 -30000 40000000000)': expected 39999971999; got 39999972255 ================= from http://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdint.h.html =========== Limits of exact-width integer types Minimum values of exact-width signed integer types: {INTN_MIN} Exactly -(2 N-1) Maximum values of exact-width signed integer types: {INTN_MAX} Exactly 2N-1 -1 ========================================== --Boundary_(ID_HibOZqOn47OBRWr6SN1yVg) Content-type: text/html; CHARSET=US-ASCII Content-transfer-encoding: quoted-printable Hi = Ludo:
MacOS 10.7.5 Intel Dual CPU quad = cores 

Many thanks for your reply. A nice demo = but, no disrespect, maybe not really the issue.
Looking at the = generated code from each compiler was going to be my next step = after
taking a look at the stack and regs to see = what got passed/pushed/popped in the call to = test_sum.
Which is why I posted about how can I debug/step = through the interpreter. 
I still don't understand how to = do that even though I read through the = manual.

My experiment in building guile with = both compilers indicate they both produce the same = error.
bad return from expression `(f-sum -1 2000 -30000 = 40000000000)': expected 39999971999; got = 39999972255
I am still of the opinion that it's an = interpreter issue and not a compiler = one. 

I ask for help in confirming my = understanding of this scheme code from the = file 
/test-suite/standalone/test-ffi
;;
;; Multiple int args of differing = types
;;
(define f-sum
  = (pointer->procedure int64 (dynamic-func "test_ffi_sum" = lib)
                =       (list int8 int16 int32 int64)))
(test = (f-sum -1 2000 -30000 40000000000)  ;; This calls the c function = f-sum
      (+ -1 2000 -30000 = 40000000000)) =      ;;  This executes the scheme = interpreter to do the sum

Is my = understanding correct??????

If so please = explain to me how the interpreter knows that the -1 in this = expression is an int8?
My suspicion is that it thinks = it's an int16 and that's why we see the = difference!!

I don't know how to pass an int8 = of -1 to the interpreter in REPL mode.
Otherwise I'd try = that.

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D = from Terminal REPL session = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Gandalf:guile-2.0.7= pteeson$ guile
GNU Guile 2.0.7
<snipped = comments>

scheme@(guile-user)> (+ -1 2000 = -30000 40000000000)
$1 =3D = 39999971999
scheme@(guile-user)> = ,q

which matches the fail message = value.
bad return from expression `(f-sum -1 2000 -30000 = 40000000000)': expected 39999971999; got = 39999972255

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D from http://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdint.h.html= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 
Limits of = exact-width integer types
Minimum values of exact-width signed = integer types:
{INTN_MIN}
Exactly = -(2 N-1)
Maximum values of = exact-width signed integer = types:
{INTN_MAX}
Exactly = 2N-1 = -1
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D


= --Boundary_(ID_HibOZqOn47OBRWr6SN1yVg)-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 27 20:47:09 2013 Received: (at 13342) by debbugs.gnu.org; 28 Jan 2013 01:47:09 +0000 Received: from localhost ([127.0.0.1]:51847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzdoT-0006jm-8b for submit@debbugs.gnu.org; Sun, 27 Jan 2013 20:47:09 -0500 Received: from world.peace.net ([96.39.62.75]:52558) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzdoP-0006jd-C6 for 13342@debbugs.gnu.org; Sun, 27 Jan 2013 20:47:07 -0500 Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Tzdnt-0006WK-Sm; Sun, 27 Jan 2013 20:46:34 -0500 From: Mark H Weaver To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: bug#13342: [PARTIALLY SOLVED] bug#13342: Errors trying to build Guile 2.0.7 References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> <87r4m22swf.fsf@gnu.org> <69FAB6BC-CFB2-49AC-B103-D57E454091F0@me.com> <877gnsvp49.fsf@gnu.org> <895C23AD-DD0D-40FC-AD5F-6CEF52365444@me.com> <7C7443E9-9DA7-493D-8321-F5859170BAB5@me.com> <87a9ru7m23.fsf@gnu.org> Date: Sun, 27 Jan 2013 20:46:22 -0500 In-Reply-To: <87a9ru7m23.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 27 Jan 2013 15:11:32 +0100") Message-ID: <87r4l6krkh.fsf@tines.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13342 Cc: 13342@debbugs.gnu.org, Peter Teeson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Hi Ludovic, Thanks for looking into this! I think I understand the problem now. ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Consider this example: > > #include > > int64_t > test_sum (int8_t a, int64_t b) > { > return a + b; > } > > When compiled with GCC 4.6, the assembly is: > > test_sum: > .LFB0: > .cfi_startproc > movsbq %dil, %rdi > leaq (%rdi,%rsi), %rax > ret > .cfi_endproc > > With Clang 3.1, it is: > > test_sum: # @test_sum > .cfi_startproc > # BB#0: > movslq %edi, %rax > addq %rsi, %rax > ret > > The =E2=80=98movsbq=E2=80=99 emitted by GCC arranges to keep only the 8 L= SBs. Clang > does no such thing, thus keeping all the bits of the first operand in > the addition. This is the key revelation, although I've reached a different conclusion about where the bug is. > I looked at Section 3.2.3 (=E2=80=9CParameter Passing=E2=80=9D) of the Sy= sV ABI x86_64 > PS but couldn=E2=80=99t find any evidence as to what the correct behavior= is. I read the same section, and although it is not as clear as I'd prefer, my interpretation is that the caller is responsible for sign-extending signed chars to ints. This is also consistent with something I vaguely remember reading in K&R long ago, namely that 'char' and 'short' arguments are coerced to 'int' before making a function call. Clang strictly requires callers to sign-extend, whereas GCC is tolerant of callers who fail to do so. IMO, both behaviors are permitted by the ABI. The problem is that libffi does *not* sign-extend arguments passed in registers when making calls, which is IMO a bug that has gone (mostly) unnoticed because of the tolerance and ubiquity of GCC. > However, on the caller side, both compilers emit the same code. This > program: > > #include > > extern int64_t test_sum (int8_t a, int64_t b); > > int64_t > foo (void) > { > return test_sum (-1, 123132); > } > > leads to the following assembly with both compilers: > > foo: # @foo > .cfi_startproc > movl $-1, %edi > movl $123132, %esi # imm =3D 0x1E0FC > jmp test_sum # TAILCALL > > (And as we=E2=80=99ve seen, libffi does the same.) No, libffi does *not* do the same. Take a look at the relevant code: https://github.com/atgreen/libffi/blob/master/src/x86/ffi64.c#L488 As you can see in lines 487 and 488, arguments passed in registers are never sign-extended, but rather zero-extended. The register values are then copied whole in the darwin-specific assembly stub: https://github.com/atgreen/libffi/blob/master/src/x86/darwin64.S#L61 Interestingly, arguments passed on the stack *are* sign-extended: https://github.com/atgreen/libffi/blob/master/src/x86/darwin64.S#L120 * * * * * In summary, I think this is a bug in libffi. Note that it has already been reported that the libffi testsuite shows many failures on OS X Lion, and the failures appear to be related to this precise issue: http://sourceware.org/ml/libffi-discuss/2012/msg00162.html The libffi maintainer wrote "I'm going to chalk this up to compiler bugs", based on his observation that the tests worked properly when compiled with -O0. I think it's time to raise this issue again on the libffi-discuss mailing list. In any case, it's certainly not a bug in Guile. The bug is either in LLVM/Clang or libffi, depending on how one chooses to interpret the x86-64 API. Regards, Mark From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 27 21:40:49 2013 Received: (at 13342) by debbugs.gnu.org; 28 Jan 2013 02:40:49 +0000 Received: from localhost ([127.0.0.1]:51882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzeeO-000815-Uh for submit@debbugs.gnu.org; Sun, 27 Jan 2013 21:40:49 -0500 Received: from nk11p08mm-asmtpout001.mac.com ([17.158.58.246]:48324 helo=nk11p08mm-asmtp001.mac.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzeeN-00080u-6h for 13342@debbugs.gnu.org; Sun, 27 Jan 2013 21:40:48 -0500 MIME-version: 1.0 Content-type: text/plain; charset=windows-1252 Received: from [192.168.2.10] (bas4-toronto21-1176476140.dsl.bell.ca [70.31.153.236]) by nk11p08mm-asmtp001.mac.com (Oracle Communications Messaging Server 7u4-26.01(7.0.4.26.0) 64bit (built Jul 13 2012)) with ESMTPSA id <0MHB008IXE394V80@nk11p08mm-asmtp001.mac.com> for 13342@debbugs.gnu.org; Mon, 28 Jan 2013 02:40:22 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8327,1.0.431,0.0.0000 definitions=2013-01-28_01:2013-01-27, 2013-01-28, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=3 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1301270350 Subject: Re: bug#13342: [PARTIALLY SOLVED] bug#13342: Errors trying to build Guile 2.0.7 From: Peter Teeson In-reply-to: <87r4l6krkh.fsf@tines.lan> Date: Sun, 27 Jan 2013 21:40:21 -0500 Content-transfer-encoding: quoted-printable Message-id: <432981BC-1618-4D6E-A1F7-2B7ED3C8EFBC@me.com> References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> <87r4m22swf.fsf@gnu.org> <69FAB6BC-CFB2-49AC-B103-D57E454091F0@me.com> <877gnsvp49.fsf@gnu.org> <895C23AD-DD0D-40FC-AD5F-6CEF52365444@me.com> <7C7443E9-9DA7-493D-8321-F5859170BAB5@me.com> <87a9ru7m23.fsf@gnu.org> <87r4l6krkh.fsf@tines.lan> To: Mark H Weaver X-Mailer: Apple Mail (2.1283) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13342 Cc: =?iso-8859-1?Q?Ludovic_Court=E8s?= , 13342@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hi Mark: Thanks for your comments and I agree I was wrong. Ludovic pointed out GCC dropping off the MSB 24-bits whereas Clang does = not. You pointed out the lack of sign extension in the libffi implementation. I would think it would be easier to make the change to libffi=20 rather than expect changes to be made to the compilers. But that's just my opinion. Anyway glad that you wizards have nailed it. OK if I bow out now and let others fix it? respect=85. Peter= From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 28 07:57:14 2013 Received: (at 13342) by debbugs.gnu.org; 28 Jan 2013 12:57:14 +0000 Received: from localhost ([127.0.0.1]:52206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzoGv-0006HN-UG for submit@debbugs.gnu.org; Mon, 28 Jan 2013 07:57:14 -0500 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:15747) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzoGs-0006H7-JK; Mon, 28 Jan 2013 07:57:12 -0500 X-IronPort-AV: E=Sophos;i="4.84,551,1355094000"; d="scan'208";a="191643330" Received: from unknown (HELO pluto) ([193.50.110.227]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 28 Jan 2013 13:56:43 +0100 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Mark H Weaver Subject: Re: bug#13342: [PARTIALLY SOLVED] bug#13342: Errors trying to build Guile 2.0.7 References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> <87r4m22swf.fsf@gnu.org> <69FAB6BC-CFB2-49AC-B103-D57E454091F0@me.com> <877gnsvp49.fsf@gnu.org> <895C23AD-DD0D-40FC-AD5F-6CEF52365444@me.com> <7C7443E9-9DA7-493D-8321-F5859170BAB5@me.com> <87a9ru7m23.fsf@gnu.org> <87r4l6krkh.fsf@tines.lan> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 =?utf-8?Q?Pluvi=C3=B4se?= an 221 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Mon, 28 Jan 2013 13:56:43 +0100 In-Reply-To: <87r4l6krkh.fsf@tines.lan> (Mark H. Weaver's message of "Sun, 27 Jan 2013 20:46:22 -0500") Message-ID: <87libdea9g.fsf@gnu.org> User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: 13342 Cc: 13342@debbugs.gnu.org, control@debbugs.gnu.org, Peter Teeson X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) retitle 13342 Clang, the FFI, and 8-bit signed integers merge 13342 13386 thanks Hello! Mark H Weaver skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: [...] >> I looked at Section 3.2.3 (=E2=80=9CParameter Passing=E2=80=9D) of the S= ysV ABI x86_64 >> PS but couldn=E2=80=99t find any evidence as to what the correct behavio= r is. > > I read the same section, and although it is not as clear as I'd prefer, > my interpretation is that the caller is responsible for sign-extending > signed chars to ints. What exactly in that section makes you think so? > Clang strictly requires callers to sign-extend, whereas GCC is tolerant > of callers who fail to do so. IMO, both behaviors are permitted by the > ABI. > > The problem is that libffi does *not* sign-extend arguments passed in > registers when making calls, which is IMO a bug that has gone (mostly) > unnoticed because of the tolerance and ubiquity of GCC. Oh, I see. >> However, on the caller side, both compilers emit the same code. This >> program: >> >> #include >> >> extern int64_t test_sum (int8_t a, int64_t b); >> >> int64_t >> foo (void) >> { >> return test_sum (-1, 123132); >> } >> >> leads to the following assembly with both compilers: >> >> foo: # @foo >> .cfi_startproc >> movl $-1, %edi >> movl $123132, %esi # imm =3D 0x1E0FC >> jmp test_sum # TAILCALL >> >> (And as we=E2=80=99ve seen, libffi does the same.) > > No, libffi does *not* do the same. Take a look at the relevant code: > > https://github.com/atgreen/libffi/blob/master/src/x86/ffi64.c#L488 Indeed! [...] > In summary, I think this is a bug in libffi. > > Note that it has already been reported that the libffi testsuite shows > many failures on OS X Lion, and the failures appear to be related to > this precise issue: Note that it=E2=80=99s not just Darwin: I tested with Clang on GNU/Linux. > http://sourceware.org/ml/libffi-discuss/2012/msg00162.html > > The libffi maintainer wrote "I'm going to chalk this up to compiler > bugs", based on his observation that the tests worked properly when > compiled with -O0. I think it's time to raise this issue again on the > libffi-discuss mailing list. Would you like to email them? Anyway, thanks for the thorough investigation! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 28 11:40:25 2013 Received: (at 13342) by debbugs.gnu.org; 28 Jan 2013 16:40:26 +0000 Received: from localhost ([127.0.0.1]:52770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tzrkv-000449-CN for submit@debbugs.gnu.org; Mon, 28 Jan 2013 11:40:25 -0500 Received: from nk11p08mm-asmtpout002.mac.com ([17.158.58.247]:58311 helo=nk11p08mm-asmtp002.mac.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tzrks-00043y-NJ; Mon, 28 Jan 2013 11:40:23 -0500 MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Received: from [192.168.2.10] (bas4-toronto21-1176476140.dsl.bell.ca [70.31.153.236]) by nk11p08mm-asmtp002.mac.com (Oracle Communications Messaging Server 7u4-26.01(7.0.4.26.0) 64bit (built Jul 13 2012)) with ESMTPSA id <0MHC00MW3GYAIE90@nk11p08mm-asmtp002.mac.com>; Mon, 28 Jan 2013 16:39:48 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8327,1.0.431,0.0.0000 definitions=2013-01-28_03:2013-01-28, 2013-01-28, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=3 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1301280145 Subject: Re: bug#13342: [PARTIALLY SOLVED] bug#13342: Errors trying to build Guile 2.0.7 From: Peter Teeson In-reply-to: <87libdea9g.fsf@gnu.org> Date: Mon, 28 Jan 2013 11:39:46 -0500 Content-transfer-encoding: quoted-printable Message-id: References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> <87r4m22swf.fsf@gnu.org> <69FAB6BC-CFB2-49AC-B103-D57E454091F0@me.com> <877gnsvp49.fsf@gnu.org> <895C23AD-DD0D-40FC-AD5F-6CEF52365444@me.com> <7C7443E9-9DA7-493D-8321-F5859170BAB5@me.com> <87a9ru7m23.fsf@gnu.org> <87r4l6krkh.fsf@tines.lan> <87libdea9g.fsf@gnu.org> To: =?iso-8859-1?Q?Ludovic_Court=E8s?= X-Mailer: Apple Mail (2.1283) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13342 Cc: Mark H Weaver , 13342@debbugs.gnu.org, control@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hi: Do you also need to retitle and merge 10015 and 10681? These were the similar bugs you mentioned when I first reported the = issue. Peter On 2013-01-28, at 7:56 AM, Ludovic Court=E8s wrote: > retitle 13342 Clang, the FFI, and 8-bit signed integers > merge 13342 13386 > thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 28 11:55:40 2013 Received: (at 13342) by debbugs.gnu.org; 28 Jan 2013 16:55:40 +0000 Received: from localhost ([127.0.0.1]:52784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tzrzf-0005IY-QG for submit@debbugs.gnu.org; Mon, 28 Jan 2013 11:55:40 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:34481) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TzrzZ-0005IE-97; Mon, 28 Jan 2013 11:55:35 -0500 X-IronPort-AV: E=Sophos;i="4.84,553,1355094000"; d="scan'208";a="334307" Received: from unknown (HELO pluto) ([193.50.110.227]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 28 Jan 2013 17:55:05 +0100 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Peter Teeson Subject: Re: bug#13342: [PARTIALLY SOLVED] bug#13342: Errors trying to build Guile 2.0.7 References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> <87r4m22swf.fsf@gnu.org> <69FAB6BC-CFB2-49AC-B103-D57E454091F0@me.com> <877gnsvp49.fsf@gnu.org> <895C23AD-DD0D-40FC-AD5F-6CEF52365444@me.com> <7C7443E9-9DA7-493D-8321-F5859170BAB5@me.com> <87a9ru7m23.fsf@gnu.org> <87r4l6krkh.fsf@tines.lan> <87libdea9g.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 =?utf-8?Q?Pluvi=C3=B4se?= an 221 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Mon, 28 Jan 2013 17:55:05 +0100 In-Reply-To: (Peter Teeson's message of "Mon, 28 Jan 2013 11:39:46 -0500") Message-ID: <87k3qx9riu.fsf@gnu.org> User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: 13342 Cc: Mark H Weaver , 13342@debbugs.gnu.org, control@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) merge 13342 10015 10681 thanks Peter Teeson skribis: > Do you also need to retitle and merge 10015 and 10681? Indeed, thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 30 03:34:53 2013 Received: (at 13342) by debbugs.gnu.org; 30 Jan 2013 08:34:53 +0000 Received: from localhost ([127.0.0.1]:55163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0T89-0005gl-1g for submit@debbugs.gnu.org; Wed, 30 Jan 2013 03:34:53 -0500 Received: from world.peace.net ([96.39.62.75]:55418) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0T87-0005gd-27 for 13342@debbugs.gnu.org; Wed, 30 Jan 2013 03:34:51 -0500 Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1U0T7R-0005o2-On; Wed, 30 Jan 2013 03:34:09 -0500 From: Mark H Weaver To: 13342@debbugs.gnu.org Subject: Re: bug#13342: Errors trying to build Guile 2.0.7 References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> Date: Wed, 30 Jan 2013 03:34:02 -0500 In-Reply-To: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> (Peter Teeson's message of "Wed, 02 Jan 2013 15:39:10 -0500") Message-ID: <877gmvjchx.fsf@tines.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13342 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.5 (/) FYI, I've posted about this to the libffi-discuss mailing list. http://sourceware.org/ml/libffi-discuss/2013/msg00012.html Mark From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 30 16:37:51 2013 Received: (at control) by debbugs.gnu.org; 30 Jan 2013 21:37:52 +0000 Received: from localhost ([127.0.0.1]:56333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0fLr-0005dR-Cf for submit@debbugs.gnu.org; Wed, 30 Jan 2013 16:37:51 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:16740) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0fLo-0005dD-K1; Wed, 30 Jan 2013 16:37:50 -0500 X-IronPort-AV: E=Sophos;i="4.84,572,1355094000"; d="scan'208";a="552661" Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 30 Jan 2013 22:36:06 +0100 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Mark H Weaver Subject: Re: bug#13342: Errors trying to build Guile 2.0.7 References: <548C7791-6E30-43A9-9E38-05BEC03CEF8B@me.com> <877gmvjchx.fsf@tines.lan> Date: Wed, 30 Jan 2013 22:37:07 +0100 In-Reply-To: <877gmvjchx.fsf@tines.lan> (Mark H. Weaver's message of "Wed, 30 Jan 2013 03:34:02 -0500") Message-ID: <87622egxoc.fsf@gnu.org> User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: control Cc: 13342-done@debbugs.gnu.org, control@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) tags 13342 notabug thanks Hello! Mark H Weaver skribis: > FYI, I've posted about this to the libffi-discuss mailing list. > > http://sourceware.org/ml/libffi-discuss/2013/msg00012.html Thanks! So, according to , this is an LLVM bug. Peter: would you like to report it over at LLVM? Anyway, closing this bug now. Thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 30 17:13:55 2013 Received: (at 13342) by debbugs.gnu.org; 30 Jan 2013 22:13:55 +0000 Received: from localhost ([127.0.0.1]:56369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0fuk-0007QV-Ua for submit@debbugs.gnu.org; Wed, 30 Jan 2013 17:13:55 -0500 Received: from nk11p08mm-asmtpout002.mac.com ([17.158.58.247]:36567 helo=nk11p08mm-asmtp002.mac.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0fui-0007QL-UA; Wed, 30 Jan 2013 17:13:53 -0500 MIME-version: 1.0 Content-type: text/plain; charset=windows-1252 Received: from [192.168.2.10] (bas4-toronto21-1176476140.dsl.bell.ca [70.31.153.236]) by nk11p08mm-asmtp002.mac.com (Oracle Communications Messaging Server 7u4-26.01(7.0.4.26.0) 64bit (built Jul 13 2012)) with ESMTPSA id <0MHG004IZLPSTAC0@nk11p08mm-asmtp002.mac.com>; Wed, 30 Jan 2013 22:13:05 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8327,1.0.431,0.0.0000 definitions=2013-01-30_07:2013-01-30, 2013-01-30, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=38 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1301300180 From: Peter Teeson Content-transfer-encoding: quoted-printable Subject: 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: Wed, 30 Jan 2013 17:13:05 -0500 Message-id: <50A70C8C-2AC1-47C9-8D5F-724C60DED6D4@me.com> To: 13342@debbugs.gnu.org, 13386@debbugs.gnu.org, Mark H Weaver , =?iso-8859-1?Q?Ludovic_Court=E8s?= X-Mailer: Apple Mail (2.1283) X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13342 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.7 (/) Hi guys: Thanks for closing off those bugs. I have read all the emails you linked in your close emails and=20 completely understand the conversation.=20 Specially the comment by Michael Matz. That clearly confirms that it is an LLVM compiler bug. Good job both of you for digging down deeper and making things so clear. At least now we know. Would you please report this over at LLVM since you did the work to = discover it. Thanks again for your great patience and kindness in helping my fumbling = efforts. respect=85.. Peter From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 31 15:21:43 2013 Received: (at 13342) by debbugs.gnu.org; 31 Jan 2013 20:21:43 +0000 Received: from localhost ([127.0.0.1]:58103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U10dj-0000U8-JH for submit@debbugs.gnu.org; Thu, 31 Jan 2013 15:21:43 -0500 Received: from world.peace.net ([96.39.62.75]:57294) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U10df-0000Tt-OX; Thu, 31 Jan 2013 15:21:41 -0500 Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1U10cq-0003V9-RB; Thu, 31 Jan 2013 15:20:49 -0500 From: Mark H Weaver To: Peter Teeson 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) References: <50A70C8C-2AC1-47C9-8D5F-724C60DED6D4@me.com> Date: Thu, 31 Jan 2013 15:20:39 -0500 In-Reply-To: <50A70C8C-2AC1-47C9-8D5F-724C60DED6D4@me.com> (Peter Teeson's message of "Wed, 30 Jan 2013 17:13:05 -0500") Message-ID: <87y5f9f6js.fsf@tines.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13342 Cc: 13342@debbugs.gnu.org, Ludovic =?utf-8?Q?Cour?= =?utf-8?Q?t=C3=A8s?= , 13386@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) Hi Peter, Peter Teeson writes: > Would you please report this over at LLVM since you did the work to > discover it. Okay, I'll take care of it. I'm also working with the libffi folks to work around this problem in the interim. The next libffi release (due out fairly soon) will interface properly with the existing LLVM-compiled code on your system. Thanks again for helping us track this down. Regards, Mark From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 31 21:06:22 2013 Received: (at 13342) by debbugs.gnu.org; 1 Feb 2013 02:06:22 +0000 Received: from localhost ([127.0.0.1]:58305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U161D-0000q3-5W for submit@debbugs.gnu.org; Thu, 31 Jan 2013 21:06:21 -0500 Received: from nk11p08mm-asmtp002.mac.com ([17.158.58.247]:50714) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U161A-0000ps-9C; Thu, 31 Jan 2013 21:06:17 -0500 MIME-version: 1.0 Content-type: text/plain; charset=windows-1252 Received: from [192.168.2.10] (bas4-toronto21-1176476140.dsl.bell.ca [70.31.153.236]) by nk11p08mm-asmtp002.mac.com (Oracle Communications Messaging Server 7u4-26.01(7.0.4.26.0) 64bit (built Jul 13 2012)) with ESMTPSA id <0MHI002D8R4RCC60@nk11p08mm-asmtp002.mac.com>; Fri, 01 Feb 2013 02:05:17 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8327,1.0.431,0.0.0000 definitions=2013-01-31_06:2013-01-31, 2013-01-31, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=3 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1301310206 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) From: Peter Teeson In-reply-to: <87y5f9f6js.fsf@tines.lan> Date: Thu, 31 Jan 2013 21:05:14 -0500 Content-transfer-encoding: quoted-printable Message-id: <934DF4BA-B61B-49DE-895A-7B6CB7031E82@me.com> References: <50A70C8C-2AC1-47C9-8D5F-724C60DED6D4@me.com> <87y5f9f6js.fsf@tines.lan> To: Mark H Weaver X-Mailer: Apple Mail (2.1283) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13342 Cc: 13342@debbugs.gnu.org, =?iso-8859-1?Q?Ludovic_Court=E8s?= , 13386@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hi Mark: I read the thread on libffi-discuss. When you think things are ready to test I'll be glad to do so on my Mac = setup. At present my boot system is MacOS 10.7.5 Lion. But I can boot into previous versions (Leopard 10.5, Snow Leopard 10.6) Just so you know=85. Peter On 2013-01-31, at 3:20 PM, Mark H Weaver wrote: > I'm also working with the libffi folks to work around this problem in > the interim. The next libffi release (due out fairly soon) will > interface properly with the existing LLVM-compiled code on your = system. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 02 08:12:39 2013 Received: (at 13342) by debbugs.gnu.org; 2 Feb 2013 13:12:39 +0000 Received: from localhost ([127.0.0.1]:60511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1cta-0004qR-Ub for submit@debbugs.gnu.org; Sat, 02 Feb 2013 08:12:39 -0500 Received: from world.peace.net ([96.39.62.75]:59010) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1ctY-0004qB-6r; Sat, 02 Feb 2013 08:12:37 -0500 Received: from c-98-217-64-74.hsd1.ma.comcast.net ([98.217.64.74] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1U1csZ-0001SW-Pm; Sat, 02 Feb 2013 08:11:36 -0500 From: Mark H Weaver To: Peter Teeson 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) References: <50A70C8C-2AC1-47C9-8D5F-724C60DED6D4@me.com> <87y5f9f6js.fsf@tines.lan> <934DF4BA-B61B-49DE-895A-7B6CB7031E82@me.com> Date: Sat, 02 Feb 2013 08:11:26 -0500 In-Reply-To: <934DF4BA-B61B-49DE-895A-7B6CB7031E82@me.com> (Peter Teeson's message of "Thu, 31 Jan 2013 21:05:14 -0500") Message-ID: <871ucydfnl.fsf@tines.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13342 Cc: 13342@debbugs.gnu.org, Ludovic =?utf-8?Q?Cour?= =?utf-8?Q?t=C3=A8s?= , 13386@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) --=-=-= Content-Type: text/plain Hi Peter, Peter Teeson 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=SIGN_EXTEND_SINT_ARGS.patch Content-Description: SIGN_EXTEND_SINT_ARGS.patch 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 (®_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 *)®_args->gpr[gprcount] = (SINT64) *((SINT8 *) a); + break; + case FFI_TYPE_SINT16: + *(SINT64 *)®_args->gpr[gprcount] = (SINT64) *((SINT16 *) a); + break; + case FFI_TYPE_SINT32: + *(SINT64 *)®_args->gpr[gprcount] = (SINT64) *((SINT32 *) a); + break; + default: + reg_args->gpr[gprcount] = 0; + memcpy (®_args->gpr[gprcount], a, size < 8 ? size : 8); + } gprcount++; break; case X86_64_SSE_CLASS: --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 02 19:06:20 2013 Received: (at 13342) by debbugs.gnu.org; 3 Feb 2013 00:06:20 +0000 Received: from localhost ([127.0.0.1]:33323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1n6C-0003O7-7X for submit@debbugs.gnu.org; Sat, 02 Feb 2013 19:06:20 -0500 Received: from nk11p08mm-asmtp001.mac.com ([17.158.58.246]:57025) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1n69-0003Nw-Cf; Sat, 02 Feb 2013 19:06:18 -0500 MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_T/LVmTN9a6FG0pasHGVPzw)" Received: from [192.168.2.10] (bas4-toronto21-1176476140.dsl.bell.ca [70.31.153.236]) by nk11p08mm-asmtp001.mac.com (Oracle Communications Messaging Server 7u4-26.01(7.0.4.26.0) 64bit (built Jul 13 2012)) with ESMTPSA id <0MHM00DJPAWU0S20@nk11p08mm-asmtp001.mac.com>; Sun, 03 Feb 2013 00:05:20 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8327,1.0.431,0.0.0000 definitions=2013-02-02_05:2013-02-01, 2013-02-02, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=3 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1302020231 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) From: Peter Teeson In-reply-to: <871ucydfnl.fsf@tines.lan> Date: Sat, 02 Feb 2013 19:05:17 -0500 Message-id: <9928B119-802A-4C4E-A38F-00779C1A8CFA@me.com> References: <50A70C8C-2AC1-47C9-8D5F-724C60DED6D4@me.com> <87y5f9f6js.fsf@tines.lan> <934DF4BA-B61B-49DE-895A-7B6CB7031E82@me.com> <871ucydfnl.fsf@tines.lan> To: Mark H Weaver X-Mailer: Apple Mail (2.1283) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13342 Cc: 13342@debbugs.gnu.org, =?iso-8859-1?Q?Ludovic_Court=E8s?= , 13386@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) --Boundary_(ID_T/LVmTN9a6FG0pasHGVPzw) Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: quoted-printable Hi Mark: The short answer is: make check-am =85... make check-TESTS PASS: test-system-cmds =85... PASS: test-asmobs PASS: test-ffi PASS: test-list =85=85 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D All 29 tests passed =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D In more detail the following steps: Unzipped libffi-3.0.11.tar.gz Downloaded libffi-3.0.11-includedir-1.patch Applied that patch Had to manually apply your diff file patch (I'll explain in more detail if you wish) Built and installed libffi in the usual manner. Then did the same process for guile-2.0.7.tar.gz did ./configure && make && make check got the above results. Here's the summary Totals for this test run: passes: 35268 failures: 0 unexpected passes: 0 expected failures: 6 unresolved test cases: 34 untested test cases: 1 unsupported test cases: 9 errors: 0 PASS: check-guile Anything else I can do to help? Peter --Boundary_(ID_T/LVmTN9a6FG0pasHGVPzw) Content-type: text/html; charset=windows-1252 Content-transfer-encoding: quoted-printable Hi = Mark:
The short answer is:
make =  check-am
=85...
make =  check-TESTS
PASS: = test-system-cmds
=85...
PASS: = test-asmobs
PASS: test-ffi
PASS: = test-list
=85=85
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D
All 29 tests = passed
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=


In more detail the = following = steps:
Unzipped libffi-3.0.11.tar.gz
Downloaded&n= bsp;libffi-3.0.11-includedir-1.patch
Applied that = patch
Had to manually apply your diff file = patch

(I'll explain in more detail if you = wish)

Built and installed libffi in the usual = manner.

Then did the same process = for guile-2.0.7.tar.gz
did ./configure && make = && make check
got the above = results.

Here's the = summary
Totals for this test run:
passes:       =           35268
failures:       =         0
unexpected passes:   =    0
expected failures:     =  6
unresolved test cases:  34
untested test cases:   =  1
unsupported test cases: 9
errors:       =           0

PASS: = check-guile


Anything = else I can do to = help?

Peter




= --Boundary_(ID_T/LVmTN9a6FG0pasHGVPzw)-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 02 22:23:36 2013 Received: (at 13342) by debbugs.gnu.org; 3 Feb 2013 03:23:36 +0000 Received: from localhost ([127.0.0.1]:33423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1qB3-0000yA-3q for submit@debbugs.gnu.org; Sat, 02 Feb 2013 22:23:36 -0500 Received: from world.peace.net ([96.39.62.75]:59729) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1qAz-0000xv-Uu; Sat, 02 Feb 2013 22:23:30 -0500 Received: from c-98-217-64-74.hsd1.ma.comcast.net ([98.217.64.74] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1U1q9x-0003kd-T9; Sat, 02 Feb 2013 22:22:26 -0500 From: Mark H Weaver To: Peter Teeson 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) References: <50A70C8C-2AC1-47C9-8D5F-724C60DED6D4@me.com> <87y5f9f6js.fsf@tines.lan> <934DF4BA-B61B-49DE-895A-7B6CB7031E82@me.com> <871ucydfnl.fsf@tines.lan> <9928B119-802A-4C4E-A38F-00779C1A8CFA@me.com> Date: Sat, 02 Feb 2013 22:22:16 -0500 In-Reply-To: <9928B119-802A-4C4E-A38F-00779C1A8CFA@me.com> (Peter Teeson's message of "Sat, 02 Feb 2013 19:05:17 -0500") Message-ID: <87boc2axp3.fsf@tines.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 13342 Cc: 13342@debbugs.gnu.org, Ludovic =?utf-8?Q?Cour?= =?utf-8?Q?t=C3=A8s?= , 13386@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Peter Teeson writes: > =E2=80=A6... > PASS: test-asmobs > PASS: test-ffi > PASS: test-list > =E2=80=A6=E2=80=A6 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > All 29 tests passed > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Excellent! We can now submit the libffi patch upstream. Thanks, Mark From unknown Fri Jun 20 07:10:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 03 Mar 2013 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator