GNU bug report logs - #59085
[PATCH] services: Add x86_64 QEMU target.

Previous Next

Package: guix-patches;

Reported by: Leo Nikkilä <hello <at> lnikki.la>

Date: Mon, 7 Nov 2022 00:11:01 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59085 in the body.
You can then email your comments to 59085 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#59085; Package guix-patches. (Mon, 07 Nov 2022 00:11:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Nikkilä <hello <at> lnikki.la>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 07 Nov 2022 00:11:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Nikkilä <hello <at> lnikki.la>
To: guix-patches <at> gnu.org
Cc: Leo Nikkilä <hello <at> lnikki.la>
Subject: [PATCH] services: Add x86_64 QEMU target.
Date: Mon,  7 Nov 2022 02:09:45 +0200
Greetings,

I was trying to build an x86_64 binary on an aarch64 machine, and noticed that
`qemu-binfmt-service-type' was missing the x86_64 platform definition.

* gnu/services/virtualization.scm (%x86_64): Add variable.
(%qemu-platforms) Add it.
---
 gnu/packages/virtualization.scm | 1 +
 gnu/services/virtualization.scm | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 981e5e0cf3..4c8662f770 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -28,6 +28,7 @@
 ;;; Copyright © 2022 Ekaitz Zarraga <ekaitz <at> elenq.tech>
 ;;; Copyright © 2022 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;; Copyright © 2022 Zhu Zihao <all_but_last <at> 163.com>
+;;; Copyright © 2022 Leo Nikkilä <hello <at> lnikki.la>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
index cb6227403b..b3dc9d2114 100644
--- a/gnu/services/virtualization.scm
+++ b/gnu/services/virtualization.scm
@@ -611,6 +611,13 @@ (define %i386
    (magic (bv "\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00"))
    (mask (bv "\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"))))
 
+(define %x86_64
+  (qemu-platform
+   (name "x86_64")
+   (family "i386")
+   (magic (bv "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00"))
+   (mask (bv "\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"))))
+
 (define %alpha
   (qemu-platform
    (name "alpha")
@@ -767,7 +774,7 @@ (define %hppa
    (mask (bv "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"))))
 
 (define %qemu-platforms
-  (list %i386 %alpha %arm %sparc32plus %ppc %ppc64 %ppc64le %m68k
+  (list %i386 %x86_64 %alpha %arm %sparc32plus %ppc %ppc64 %ppc64le %m68k
         %mips %mipsel %mipsn32 %mipsn32el %mips64 %mips64el
         %riscv32 %riscv64 %sh4 %sh4eb %s390x %aarch64 %hppa))
 
-- 
2.38.0





Information forwarded to guix-patches <at> gnu.org:
bug#59085; Package guix-patches. (Mon, 07 Nov 2022 20:06:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Leo Nikkilä <hello <at> lnikki.la>
Cc: 59085-done <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#59085] [PATCH] services: Add x86_64 QEMU target.
Date: Mon, 07 Nov 2022 21:03:12 +0100
[Message part 1 (text/plain, inline)]
Leo Nikkilä <hello <at> lnikki.la> writes:

> Greetings,
>
> I was trying to build an x86_64 binary on an aarch64 machine, and noticed that
> `qemu-binfmt-service-type' was missing the x86_64 platform definition.
>
> * gnu/services/virtualization.scm (%x86_64): Add variable.
> (%qemu-platforms) Add it.
> ---
>  gnu/packages/virtualization.scm | 1 +
>  gnu/services/virtualization.scm | 9 ++++++++-
>  2 files changed, 9 insertions(+), 1 deletion(-)

This sounds reasonable to me, I haven't checked the exact values are
correct but I'm assuming they're sensible.

Pushed to master as 9ad311ec15c05efc78f74252e7eb6cddfb0b5cea.

Thanks,

Chris
[signature.asc (application/pgp-signature, inline)]

Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Mon, 07 Nov 2022 20:06:02 GMT) Full text and rfc822 format available.

Notification sent to Leo Nikkilä <hello <at> lnikki.la>:
bug acknowledged by developer. (Mon, 07 Nov 2022 20:06:03 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#59085; Package guix-patches. (Mon, 07 Nov 2022 20:57:01 GMT) Full text and rfc822 format available.

Message #16 received at 59085 <at> debbugs.gnu.org (full text, mbox):

From: Leo Nikkilä <hello <at> lnikki.la>
To: 59085 <at> debbugs.gnu.org
Cc: Leo Nikkilä <hello <at> lnikki.la>, mail <at> cbaines.net
Subject: [PATCH] gnu: Fix copyright line
Date: Mon,  7 Nov 2022 22:55:08 +0200
Thanks Chris,

> This sounds reasonable to me, I haven't checked the exact values are
> correct but I'm assuming they're sensible.

I retrieved these values from QEMU, in `scripts/qemu-binfmt-conf.sh'
as described in the source file. I've also tested that they work on my
aarch64 machine at least.

I also noticed that I added the copyright line to the packages file by
mistake, I've attached another patch to correct this below.

--

This is a follow-up to commit 9ad311ec15c05efc78f74252e7eb6cddfb0b5cea.

* gnu/packages/virtualization.scm: Remove copyright line.
* gnu/services/virtualization.scm: Add copyright line.
---
 gnu/packages/virtualization.scm | 1 -
 gnu/services/virtualization.scm | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 4c8662f770..981e5e0cf3 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -28,7 +28,6 @@
 ;;; Copyright © 2022 Ekaitz Zarraga <ekaitz <at> elenq.tech>
 ;;; Copyright © 2022 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;; Copyright © 2022 Zhu Zihao <all_but_last <at> 163.com>
-;;; Copyright © 2022 Leo Nikkilä <hello <at> lnikki.la>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
index b3dc9d2114..601c11b0d1 100644
--- a/gnu/services/virtualization.scm
+++ b/gnu/services/virtualization.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2020,2021 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2021 Timotej Lazar <timotej.lazar <at> araneo.si>
 ;;; Copyright © 2022 Oleg Pykhalov <go.wigust <at> gmail.com>
+;;; Copyright © 2022 Leo Nikkilä <hello <at> lnikki.la>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
-- 
2.38.0





Information forwarded to guix-patches <at> gnu.org:
bug#59085; Package guix-patches. (Sun, 20 Nov 2022 12:09:02 GMT) Full text and rfc822 format available.

Message #19 received at 59085 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Leo Nikkilä <hello <at> lnikki.la>
Cc: 59085 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: Fix copyright line
Date: Sun, 20 Nov 2022 12:07:24 +0000
[Message part 1 (text/plain, inline)]
Leo Nikkilä <hello <at> lnikki.la> writes:

> Thanks Chris,
>
>> This sounds reasonable to me, I haven't checked the exact values are
>> correct but I'm assuming they're sensible.
>
> I retrieved these values from QEMU, in `scripts/qemu-binfmt-conf.sh'
> as described in the source file. I've also tested that they work on my
> aarch64 machine at least.

Great :)

> I also noticed that I added the copyright line to the packages file by
> mistake, I've attached another patch to correct this below.

Awesome, thanks, I've finally got around to pushing this now as
d072bcebbf884c68573aeb999db3ae296a7cf939.

Chris
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 18 Dec 2022 12:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.