From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: Compiling guile-2.2.4 for mingw Date: Tue, 20 Nov 2018 15:27:53 -0500 Message-ID: <87pnuzv6hn.fsf@netris.org> References: <20181120155813.GA20667@joshua.dnsalias.com> <20181120174505.GA23955@joshua.dnsalias.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1542745627 2225 195.159.176.226 (20 Nov 2018 20:27:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Nov 2018 20:27:07 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: Christoph Buck , guile-devel@gnu.org To: Mike Gran Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Nov 20 21:27:03 2018 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPCbv-0000Tm-Ek for guile-devel@m.gmane.org; Tue, 20 Nov 2018 21:27:03 +0100 Original-Received: from localhost ([::1]:35758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPCe1-00072y-NW for guile-devel@m.gmane.org; Tue, 20 Nov 2018 15:29:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPCdm-00072p-S4 for guile-devel@gnu.org; Tue, 20 Nov 2018 15:28:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPCdg-0003rP-CR for guile-devel@gnu.org; Tue, 20 Nov 2018 15:28:56 -0500 Original-Received: from world.peace.net ([64.112.178.59]:45008) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gPCde-0003X3-Er for guile-devel@gnu.org; Tue, 20 Nov 2018 15:28:51 -0500 Original-Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gPCdQ-0007FE-KI; Tue, 20 Nov 2018 15:28:36 -0500 In-Reply-To: <20181120174505.GA23955@joshua.dnsalias.com> (Mike Gran's message of "Tue, 20 Nov 2018 09:45:05 -0800") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.112.178.59 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:19756 Archived-At: Mike Gran writes: > On Tue, Nov 20, 2018 at 06:16:32PM +0100, Christoph Buck wrote: >> Is there currently no way to get guile running under mingw-64bit? My plan >> was to integrate guile in a project of mine which currently only builds >> under 64bit. > > Well anything is possible, of course. Here is a list of my recollections, > but it has been a few months since I looked at it. > > First, as Eli Z mentions in his email, GMP may need to be fixed to not > make incorrect assumptions about the sizeof(long) and int, etc. bytevector-u64-{ref,set!} use 'mpz_import' and 'mpz_export', but I don't see any assumption in that particular code that 'long' is 64-bits. However, in general, it does seem to be the case that Guile code has often been written with the assumption that sizeof(long) == sizeof(void*). I fixed several of these instances, but I suspect that many more remain. That issue is being tracked here: https://bugs.gnu.org/22406 > Second, the Guile numbers infrastructure should probably be rejiggered > to keep using 32-bit INum immediate number types even under 64-bit > builds if long == 32-bit, or to always use int64_t instead of int. No need for rejiggering, because it's already the case. Guile currently always uses 'long' as the immediate number type, precisely because that's the C integer type that GMP's mpz_*_si functions accept. Specifically, numbers.h contains this: typedef long scm_t_inum; #define SCM_I_FIXNUM_BIT (SCM_LONG_BIT - 2) #define SCM_MOST_NEGATIVE_FIXNUM (-1L << (SCM_I_FIXNUM_BIT - 1)) #define SCM_MOST_POSITIVE_FIXNUM (- (SCM_MOST_NEGATIVE_FIXNUM + 1)) > Third, there are a few of the Guile Virtual Machine opcodes that need > to disambiguate if it means sizeof(void *) or size of an integer type. I'm not sure I understand. Can you give a specific example of an opcode that needs to be disambiguated? > I think it might be a tricky business overall. > > I only fixed that MinGW build enough to enter a game jam with Guile, > so I haven't put too much effort into it, really. But I came in > 10th place, so hooray. Nice! :) Thanks, Mark