From patchwork Wed May 27 22:54:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 22415 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 199E627BBE1; Wed, 27 May 2020 23:55:12 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id F1E9527BBE3 for ; Wed, 27 May 2020 23:55:08 +0100 (BST) Received: from localhost ([::1]:46718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1je4x2-0004ik-FW for patchwork@mira.cbaines.net; Wed, 27 May 2020 18:55:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1je4ww-0004iN-TX for guix-patches@gnu.org; Wed, 27 May 2020 18:55:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1je4ww-0002TY-KU for guix-patches@gnu.org; Wed, 27 May 2020 18:55:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1je4ww-0003uP-J2 for guix-patches@gnu.org; Wed, 27 May 2020 18:55:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41350] [PATCH v2 3/3] system: vm: Build vm-image using native qemu, for the Hurd. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 May 2020 22:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41350 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 41350@debbugs.gnu.org, "Jan \(janneke\) Nieuwenhuizen" Received: via spool by 41350-submit@debbugs.gnu.org id=B41350.159062007314985 (code B ref 41350); Wed, 27 May 2020 22:55:02 +0000 Received: (at 41350) by debbugs.gnu.org; 27 May 2020 22:54:33 +0000 Received: from localhost ([127.0.0.1]:50292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1je4wE-0003tQ-V0 for submit@debbugs.gnu.org; Wed, 27 May 2020 18:54:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1je4wC-0003t5-2o for 41350@debbugs.gnu.org; Wed, 27 May 2020 18:54:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47700) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1je4w5-0002Bt-DD; Wed, 27 May 2020 18:54:09 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=37264 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1je4w3-0003I8-L1; Wed, 27 May 2020 18:54:08 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= References: <20200519072302.9202-1-janneke@gnu.org> <20200519072302.9202-3-janneke@gnu.org> <87367ue09v.fsf@gnu.org> <87pnavu611.fsf@gnu.org> Date: Thu, 28 May 2020 00:54:05 +0200 In-Reply-To: <87pnavu611.fsf@gnu.org> (Mathieu Othacehe's message of "Fri, 22 May 2020 21:24:42 +0200") Message-ID: <87zh9tf0qa.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi! Mathieu Othacehe skribis: >> 1. When cross-compiling, can the ‘qemu-image’ procedure to its job by >> running exclusively native software (in particular using a native >> QEMU, native kernel, etc.)? > > I think the answer is yes, but I raised a concern about being able to > run grub-install from an ARM system to build a cross-compiled x86-64 > system (for instance). > > For now, running this command shows: > > ls $(guix build --system=aarch64-linux grub)/lib/grub/ > arm64-efi > > So, the native aarch64-linux is only able to install itself on the same > system. I think can be fixed though (same as for grub-hybrid package). > >> As for (2), I’d say that when cross-compiling, it should just run native >> software but simply preserve references to cross-compiled software, >> which is what janneke’s patch does. > > Yes, I agree. So it took me the whole day, but I ended up with the following patches addressing these two points. With that on master, I can do: guix system vm --target=arm-linux-gnueabihf --no-grafts \ gnu/system/examples/bare-bones.tmpl and get a usable script that spawns an ARM VM (I still need to add ‘-M virt -nographic’ and remove ‘-enable-kvm’, but that’s a secondary issue.) Likewise, this produces what looks like a valid image, except probably for the bootloader (I used GRUB in bare-bones, which didn’t complain, but the result doesn’t work): guix system vm-image --target=arm-linux-gnueabihf … Thoughts? I’ll see if I can test it with ‘wip-hurd-vm’ on top but I’m not sure I’ll do it before the week-end. > However, I think I found a way to install Grub, without root > permissions, from the host system (see: > https://lists.gnu.org/archive/html/guix-patches/2020-05/msg00988.html). Yay! > This should allow to deprecate the whole (gnu system vm) module. Yeah, using the new image API will be nicer. We still need to keep some of the API in (guix system vm), at least for the ‘guix system vm’ command. Thanks, Ludo’. From 6e936131ca85aba24f82d35c4616afe835ac7da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 27 May 2020 23:57:41 +0200 Subject: [PATCH 7/7] gnu: guile-static: Disable JIT on ARMv7. * gnu/packages/make-bootstrap.scm (make-guile-static): Pass "--disable-jit" when 'target-arm32?' is true. --- gnu/packages/make-bootstrap.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index fe86f810bf..b2d3e2a326 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -706,7 +706,12 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." ;; When `configure' checks for ltdl availability, it ;; doesn't try to link using libtool, and thus fails ;; because of a missing -ldl. Work around that. - ''("LDFLAGS=-ldl")) + + ;; XXX: On ARMv7, disable JIT: it causes crashes with 3.0.2, + ;; possibly related to . + (if (target-arm32?) + ''("LDFLAGS=-ldl" "--disable-jit") + ''("LDFLAGS=-ldl"))) ((#:phases phases '%standard-phases) `(modify-phases ,phases -- 2.26.2