From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Cross-compiling Guile 2.0 Date: Fri, 27 May 2011 16:32:47 +0200 Message-ID: References: <87hbbhbb99.fsf@ossau.uklinux.net> <87k4gb99uv.fsf@gnu.org> <87bp18pwbi.fsf@gnu.org> <87mxkp2958.fsf@gnu.org> <87ipvdzdg7.fsf@gnu.org> <87ipvcmeim.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1306506784 1204 80.91.229.12 (27 May 2011 14:33:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 27 May 2011 14:33:04 +0000 (UTC) Cc: guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri May 27 16:33:00 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QPy5z-0008T5-RY for guile-devel@m.gmane.org; Fri, 27 May 2011 16:33:00 +0200 Original-Received: from localhost ([::1]:38859 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPy5z-0006Td-4N for guile-devel@m.gmane.org; Fri, 27 May 2011 10:32:59 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:38583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPy5v-0006TU-GJ for guile-devel@gnu.org; Fri, 27 May 2011 10:32:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QPy5u-0005k1-7Q for guile-devel@gnu.org; Fri, 27 May 2011 10:32:55 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:55032 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPy5u-0005jV-3M; Fri, 27 May 2011 10:32:54 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id E4C512E00; Fri, 27 May 2011 10:34:59 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=6jXoj75E2IXF UkXKB5HBWlMI0mY=; b=QNaJx11x6qPMeV5v+u+clEzsKjuNPyriW62r1suBelTN ztfszFu88FXS9Z+0Sm45+YrfKavFvyC4cQcmKLBm5SlD9OIDfFXq6w1MJ/qg6uR4 ZujfwB1pvTTJ9aOdrjCZnLCRgS8WsQ/fJIKtKzF1v1+b1ayNCbLTiZBP6RLr9kI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=vdA5CS ESbMDt5BLGxoU1HR0H5W+yH6ZIwUCTTp8C5pMwjtzvnCUBHluIjsv1GrI1MrYWL+ pwwUJ5iS3iQ6B6tfoum2AWFqe7Xopm6rxU+T/Dm9TC4+cyFWAsHiNDcja7ksblx2 GVLW+sQpZ2c3vaqrDCcyt693BB40WYDW35SxY= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id D20292DFF; Fri, 27 May 2011 10:34:58 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [91.117.99.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 2236A2DFE; Fri, 27 May 2011 10:34:56 -0400 (EDT) In-Reply-To: (Andy Wingo's message of "Mon, 21 Mar 2011 21:42:31 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 7F750D7A-886E-11E0-BFAF-D6B6226F3D4C-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12544 Archived-At: So! On Mon 21 Mar 2011 21:42, Andy Wingo writes: > On Mon 21 Mar 2011 20:58, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> At some point there will have to be a triplet =E2=86=92 arch =E2=86=92 e= ndianness >> conversion. > > Indeed. > >> I=E2=80=99d rather have that conversion occur as close to the UI as >> possible=E2=80=94i.e., close to =E2=80=98scripts/compile.scm=E2=80=99=E2= =80=94rather than deep down in >> (system base compile) because the triplet string is really a UI notion I= MO. > > Actually I think it's more fundamental than that. The compilation > process tries, generically, to find a path through the language tower > path from the source language to the target language. There is nothing > bytecode-specific in (scripts compile), except for a couple default > target languages. > > It seems to me that the value of the target-type fluid at the time that > `compile-passes' is called should be what determines the compilation > path and target-specific settings. For example, to continue the ARM > compilation example, perhaps it would cause a different target language > to be selected. > > Dunno. All of that could just be too complicated, and maybe you are > right. To re-take this topic... I looked at this, and had a patch that looked for a #:target-endianness option in the compile options. I'm fairly sure that it does the bytecode compilation OK, but then to write the objcode out to disk we need to attach the right cookie on the beginning (word size and endianness), and we don't have the #:target-endianness at that point. After having read "Using System Type" again in the autoconf manual, I am convinced again that the right thing to do is to add a %target-type fluid or mutable parameter, defaulting to the %host-type. We select how to compile for the target by making decisions based on %target-type. Since in Guile those decisions don't currently need to be made anywhere except in compile-bytecode.scm and in bytecode->objcode in objcodes.c, this is easy. In the future when the %target-type could select an entirely different assembler et al, the "where" of the decisions could be moved somewhat; but I think that the mechanism sounds right to me. Let me know if you have objections. Thanks! Andy --=20 http://wingolog.org/