From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MGG6J5Gg7WBP1gAAgWs5BA (envelope-from ) for ; Tue, 13 Jul 2021 16:17:53 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 0GRXI5Gg7WAXSQAAB5/wlQ (envelope-from ) for ; Tue, 13 Jul 2021 14:17:53 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5D67F26D20 for ; Tue, 13 Jul 2021 16:17:53 +0200 (CEST) Received: from localhost ([::1]:36236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3JEO-0000LJ-58 for larch@yhetil.org; Tue, 13 Jul 2021 10:17:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3IlW-000414-TA for guix-patches@gnu.org; Tue, 13 Jul 2021 09:48:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56559) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3IlW-00010s-LR for guix-patches@gnu.org; Tue, 13 Jul 2021 09:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m3IlW-0007cg-LL for guix-patches@gnu.org; Tue, 13 Jul 2021 09:48:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v5 20/20] meson: Support cross-compilation. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Jul 2021 13:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 49025@debbugs.gnu.org Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162618403029232 (code B ref 49025); Tue, 13 Jul 2021 13:48:02 +0000 Received: (at 49025) by debbugs.gnu.org; 13 Jul 2021 13:47:10 +0000 Received: from localhost ([127.0.0.1]:39871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3Ikf-0007bQ-T6 for submit@debbugs.gnu.org; Tue, 13 Jul 2021 09:47:10 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:36114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3Ike-0007af-AO for 49025@debbugs.gnu.org; Tue, 13 Jul 2021 09:47:08 -0400 Received: from butterfly.local ([5.23.188.225]) by michel.telenet-ops.be with bizsmtp id Udn72500E4sDL4M06dn7eq; Tue, 13 Jul 2021 15:47:07 +0200 Message-ID: From: Maxime Devos In-Reply-To: <87tukzhffo.fsf@gnu.org> References: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> <20210711114723.27568-1-maximedevos@telenet.be> <20210711114723.27568-21-maximedevos@telenet.be> <87tukzhffo.fsf@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-ZQJ76Roook6Oh6fqDYgW" Date: Tue, 13 Jul 2021 15:36:14 +0200 MIME-Version: 1.0 User-Agent: Evolution 3.34.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626184028; bh=ozO6148uPefjuAo5a4OrNSwve5Woj1LTmFQ1IOmwYcA=; h=Subject:From:To:Cc:In-Reply-To:References:Date; b=ijKO0wURzh5KMGjRKmwVLAy2tD0zy4UZX9PbMPX4eeXi4B4xZUSNA6F9bi2XL9YGM zmKKBiPAXE+7TtvoJO628i7F12jvbqAql0fBfHT7I55jsAC/BcZKCyQ6kwoQ63DG2w lZ+CcpRwBjGQ/FltlatxMilj6y6vqa7fQ7TWOm0Z+koy6jxZ+0K8UfCJHWzoBf7UO2 ad+QEa6GdTdXKajuwRrH3YBjJxKCtC3xlTwdYVTSZKDR8+6kbuldVaV4jofyi3iueA 1AX51i+C/s7dq1qjLJUxDGXZTBNt0UYKVMlohBGfvmPFtQndmzSayZkTPdc+K97qeR ZFevSVWv2K3Ig== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626185873; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=ozO6148uPefjuAo5a4OrNSwve5Woj1LTmFQ1IOmwYcA=; b=kiW+5IEw3bBU+cSsTiRsCfRXYpuuN830dlZCKhNCftHuwI5sU+yK6UOuxpoCevCQYSuZae EvnOOKvfwAJ7ky9Xnesib7jOO8FUmrDiWEwWb03M+a7Ely0VuQVepychwBm7kqm7g7UeF6 mxDndTgs73TTZEOPBtIM36WPsjf0EvL3Z3qTxxK0QqDB8WdpLWfK4Eh7cElBf5W9P1t5Pp 6LDrdtesNkT4zxZVXHAqJqFr3wlcu4RbWNgCfFLEbl893CNioeEDK3BbZl4s5yNGOjeRRd AjcQfiTwbVFQ+hqMqBv435OSiDzFFv4r1FpYGJwTBMRU1AxaogFBjXh/O/7emA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626185873; a=rsa-sha256; cv=none; b=SVTtdai3hGWDJ6VEuHeOCYCCZfWlqk6oqgA1Z4EYa70R5FJyYo7VcbKC1bitIjC7bWCbFW Zkdj+0jEyBOizmb10pKer6rW527hPsgV6rvPYh0D08k4MSJrijht9o4mRyUKtcVLrDoiDv z+gRJ8oyPrCqZHIZB/3ZG6NPFkx8jIrSj1XAn61Pqzd8rLR8BxbS8vToKkt529k0RIS/5B EkT0g8ToJPph+qatoMauqxSboxK/Xu3EL36riqE79eZOwcW2/RUuGjwS1hHrCIiAK8r6tQ 2aEfdTnOPp7EZhYTiTOguouaLF//+juldNbLlDDzh08WZ9iiS+p5cXOPMOrpbw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=ijKO0wUR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=ijKO0wUR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 5D67F26D20 X-Spam-Score: -1.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: W/nTfhkPzJwd --=-ZQJ76Roook6Oh6fqDYgW Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mathieu Othacehe schreef op ma 12-07-2021 om 14:42 [+0200]: > Hey, >=20 > > This has been tested with: > >=20 > > $ ./pre-inst-env guix build glib --target=3Daarch64-linux-gnu > >=20 > > on a x86_64-linux system. =E2=80=98If it compiles, it should work.=E2= =80=99 >=20 > Nice you added aarch64 support :). >=20 > > +(define (target-hurd? triplet) > > + (and (string-suffix? "-gnu" triplet) > > + (not (string-contains triplet "linux")))) >=20 > Maybe it should go in the (guix utils) module. I placed it there, and adjusted (gnu packages hurd) and other modules to use it instead of hurd-triplet?. >=20 > > + (cpu . ,(cond ((target-x86-32? triplet) ; i386, ..., i686 > > + (substring triplet 0 4)) > > + ((target-x86-64? triplet) "x86_64") > > + ((target-aarch64? triplet) "armv8-a") >=20 > We could add: >=20 > --8<---------------cut here---------------start------------->8--- > ((target-arm32? triplet) "armv7") > --8<---------------cut here---------------end--------------->8--- >=20 > for arm32 support. Added in the v5! I assume arm32 is little-endian in Guix. > > + (call-with-output-file #$output > > + (lambda (f) > > + (parameterize ((configuration-port f)) >=20 > Why don't you pass the port parameter to the build side procedures like > so: >=20 > --8<---------------cut here---------------start------------->8--- > (call-with-output-file #$output > (lambda (port) > (write-section-header port "host_machine") > ... > --8<---------------cut here---------------end--------------->8--- No reason in particular. I'll eliminate the 'configuration-port' parameter in the v5. > > +(define* (make-machine-alist #:key system cpu-family cpu endian) > > + "Make an association list for the [host_machine] section." > > + `((system . ,system) > > + (cpu-family . ,cpu-family) > > + (cpu . ,cpu) > > + (endian . ,endian))) >=20 > This one is unused, right? Yes. I'll remove it in the v5. I'll send the v5 once it is tested (with --target=3Darmhf-linux-gnu). Greetings, Maxime. --=-ZQJ76Roook6Oh6fqDYgW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYO2WzRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7uurAP9NeIPAKHfwN/X9PAsXnOafD1D5 d/Q5CyDP1hokr7TQKQEA0OGWLjq3GIhnoq9iugeFq5Hslz7l6eOxux3gGmHU7Qk= =glaM -----END PGP SIGNATURE----- --=-ZQJ76Roook6Oh6fqDYgW--