From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mGMrEK8CBl+oDAAA0tVLHw (envelope-from ) for ; Wed, 08 Jul 2020 17:30:23 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id BIL/C68CBl97TwAA1q6Kng (envelope-from ) for ; Wed, 08 Jul 2020 17:30:23 +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 860839408E2 for ; Wed, 8 Jul 2020 17:30:22 +0000 (UTC) Received: from localhost ([::1]:39474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtDtj-0001ji-T6 for larch@yhetil.org; Wed, 08 Jul 2020 13:30:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtDtV-0001jb-Bd for bug-guix@gnu.org; Wed, 08 Jul 2020 13:30:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jtDtS-0005WY-Lv for bug-guix@gnu.org; Wed, 08 Jul 2020 13:30:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jtDtS-0001Jw-Ge for bug-guix@gnu.org; Wed, 08 Jul 2020 13:30:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41982: [PATCH v2] grub-core: Build fixes for i386 Resent-From: Jan Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 08 Jul 2020 17:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41982 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: bug-grub@gnu.org Received: via spool by 41982-submit@debbugs.gnu.org id=B41982.15942293835023 (code B ref 41982); Wed, 08 Jul 2020 17:30:02 +0000 Received: (at 41982) by debbugs.gnu.org; 8 Jul 2020 17:29:43 +0000 Received: from localhost ([127.0.0.1]:39006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jtDt9-0001Ix-3f for submit@debbugs.gnu.org; Wed, 08 Jul 2020 13:29:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jtDt7-0001Ii-AC for 41982@debbugs.gnu.org; Wed, 08 Jul 2020 13:29:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40366) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtDt1-0005SV-B1; Wed, 08 Jul 2020 13:29:35 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=40300 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jtDsz-0004jP-M9; Wed, 08 Jul 2020 13:29:34 -0400 From: Jan Nieuwenhuizen Organization: AvatarAcademy.nl References: <87ftamrlcz.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Wed, 08 Jul 2020 19:29:31 +0200 In-Reply-To: <87ftamrlcz.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Tue, 23 Jun 2020 14:57:00 +0200") Message-ID: <87imexncec.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 41982@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: 5wovUNsL4t/D --=-=-= Content-Type: text/plain Jan Nieuwenhuizen writes: Hello! > When cross-compiling Grub-2.04 from i386-linux-gnu to i586-pc-hurd on > GNU Guix, I got this error Today, we found* that my patch introduced a regression: a native, EFI build on i686-linux-gnu failed with lib/i386/relocator64.S:97: Error: bad register name `%rsp' The attached v2 fixes that. Greetings, Janneke *) http://logs.guix.gnu.org/guix/2020-07-08.log#104852 --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=v2-0001-grub-core-Build-fixes-for-i386.patch Content-Transfer-Encoding: quoted-printable >From 17b242e7b80108f1467037e15b605595e4823b2e Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sun, 21 Jun 2020 15:10:40 +0200 Subject: [PATCH v2] grub-core: Build fixes for i386 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=3DUTF-8 * grub-core/lib/i386/relocator64.S: Avoid x86_64 instructions on i386. --- grub-core/lib/i386/relocator64.S | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/grub-core/lib/i386/relocator64.S b/grub-core/lib/i386/relocato= r64.S index 148f38adb..ea39908c1 100644 --- a/grub-core/lib/i386/relocator64.S +++ b/grub-core/lib/i386/relocator64.S @@ -63,7 +63,9 @@ VARIABLE(grub_relocator64_cr3) movq %rax, %cr3 #endif =20 +#ifdef __x86_64__ .code64 +#endif =20 /* mov imm64, %rax */ .byte 0x48 @@ -71,7 +73,14 @@ VARIABLE(grub_relocator64_cr3) VARIABLE(grub_relocator64_rsp) .quad 0 =20 +#ifndef __x86_64__ + /* movq %rax, %rsp */ + .byte 0x48 + .byte 0x89 + .byte 0xc4 +#else movq %rax, %rsp +#endif =20 #ifdef GRUB_MACHINE_EFI jmp LOCAL(skip_efi_stack_align) @@ -85,7 +94,14 @@ VARIABLE(grub_relocator64_rsp) */ VARIABLE(grub_relocator64_efi_start) /* Align the stack as UEFI spec requires. */ +#ifndef __x86_64__ + .byte 0x48 + .byte 0x83 + .byte 0xe4 + .byte 0xf0 +#else andq $~15, %rsp +#endif =20 LOCAL(skip_efi_stack_align): #endif @@ -95,8 +111,15 @@ LOCAL(skip_efi_stack_align): VARIABLE(grub_relocator64_rsi) .quad 0 =20 +#ifndef __x86_64__ + /* movq %rax, %rsi */ + .byte 0x48 + .byte 0x89 + .byte 0xc6 +#else movq %rax, %rsi -=09 +#endif + /* mov imm64, %rax */ .byte 0x48 .byte 0xb8 @@ -128,6 +151,14 @@ VARIABLE(grub_relocator64_rdx) #ifdef __APPLE__ .byte 0xff, 0x25 .quad 0 +#elif !defined (__x86_64__) + /* jmp *LOCAL(jump_addr) (%rip) */ + .byte 0xff + .byte 0x25 + .byte 0 + .byte 0 + .byte 0 + .byte 0 #else jmp *LOCAL(jump_addr) (%rip) #endif --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com --=-=-=--