From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wDWxMPVn7177YwAA0tVLHw (envelope-from ) for ; Sun, 21 Jun 2020 14:00:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2C6LLPVn715bJQAAB5/wlQ (envelope-from ) for ; Sun, 21 Jun 2020 14:00:21 +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 36904940655 for ; Sun, 21 Jun 2020 14:00:21 +0000 (UTC) Received: from localhost ([::1]:52866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jn0WB-0006b7-Qs for larch@yhetil.org; Sun, 21 Jun 2020 10:00:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jn0Vu-0006b1-Ke for bug-guix@gnu.org; Sun, 21 Jun 2020 10:00:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49140) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jn0Vu-0003UB-Ao for bug-guix@gnu.org; Sun, 21 Jun 2020 10:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jn0Vu-00050j-6h for bug-guix@gnu.org; Sun, 21 Jun 2020 10:00:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41982: [PATCH 1/1] gnu: grub: Cross-build fix for system i686-linux. References: <87pn9sy14x.fsf@gnu.org> In-Reply-To: <87pn9sy14x.fsf@gnu.org> Resent-From: "Jan (janneke) Nieuwenhuizen" Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 21 Jun 2020 14:00: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: 41982@debbugs.gnu.org Received: via spool by 41982-submit@debbugs.gnu.org id=B41982.159274796019184 (code B ref 41982); Sun, 21 Jun 2020 14:00:02 +0000 Received: (at 41982) by debbugs.gnu.org; 21 Jun 2020 13:59:20 +0000 Received: from localhost ([127.0.0.1]:60686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jn0VA-0004zI-46 for submit@debbugs.gnu.org; Sun, 21 Jun 2020 09:59:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jn0V5-0004z1-Q7 for 41982@debbugs.gnu.org; Sun, 21 Jun 2020 09:59:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53149) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jn0V0-0003Pt-Eq; Sun, 21 Jun 2020 09:59:06 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=37530 helo=dundal.fritz.box) by fencepost.gnu.org with esmtpa (Exim 4.82) (envelope-from ) id 1jn0Uy-0008G1-UH; Sun, 21 Jun 2020 09:59:05 -0400 From: "Jan (janneke) Nieuwenhuizen" Date: Sun, 21 Jun 2020 15:59:03 +0200 Message-Id: <20200621135904.29195-1-janneke@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: , 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: -0.01 X-TUID: nOGQTvKF2X8D * gnu/packages/patches/grub-cross-system-i686.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/bootloaders.scm (grub): Use it. --- gnu/local.mk | 1 + gnu/packages/bootloaders.scm | 3 +- .../patches/grub-cross-system-i686.patch | 79 +++++++++++++++++++ 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/grub-cross-system-i686.patch diff --git a/gnu/local.mk b/gnu/local.mk index 347d4bbb17..1a061f43f8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1044,6 +1044,7 @@ dist_patch_DATA = \ %D%/packages/patches/grocsvs-dont-use-admiral.patch \ %D%/packages/patches/gromacs-tinyxml2.patch \ %D%/packages/patches/groovy-add-exceptionutilsgenerator.patch \ + %D%/packages/patches/grub-cross-system-i686.patch \ %D%/packages/patches/grub-efi-fat-serial-number.patch \ %D%/packages/patches/grub-setup-root.patch \ %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \ diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index ea80cf020e..efbe488bc3 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -97,7 +97,8 @@ (patches (search-patches "grub-efi-fat-serial-number.patch" "grub-setup-root.patch" - "grub-verifiers-Blocklist-fallout-cleanup.patch")))) + "grub-verifiers-Blocklist-fallout-cleanup.patch" + "grub-cross-system-i686.patch")))) (build-system gnu-build-system) (arguments `(#:configure-flags diff --git a/gnu/packages/patches/grub-cross-system-i686.patch b/gnu/packages/patches/grub-cross-system-i686.patch new file mode 100644 index 0000000000..a376cae1db --- /dev/null +++ b/gnu/packages/patches/grub-cross-system-i686.patch @@ -0,0 +1,79 @@ +Not upstreamed. +Fixes cross-build for the Hurd, from i686-linux, +see . + +From 270667540146f8ef9ea7a44258a71b3837a7af4a Mon Sep 17 00:00:00 2001 +From: "Jan (janneke) Nieuwenhuizen" +Date: Sun, 21 Jun 2020 15:10:40 +0200 +Subject: [PATCH] grub-core: Build fixes for i386 + +* grub-core/lib/i386/relocator64.S: Avoid x86_64 instructions on i386. +--- + grub-core/lib/i386/relocator64.S | 26 +++++++++++++++++++++++++- + 1 file changed, 25 insertions(+), 1 deletion(-) + +diff --git a/grub-core/lib/i386/relocator64.S b/grub-core/lib/i386/relocator64.S +index 148f38adb..45fed9444 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 + ++#ifdef __x86_64__ + .code64 ++#endif + + /* mov imm64, %rax */ + .byte 0x48 +@@ -71,7 +73,14 @@ VARIABLE(grub_relocator64_cr3) + VARIABLE(grub_relocator64_rsp) + .quad 0 + ++#ifndef __x86_64__ ++ /* movq %rax, %rsp */ ++ .byte 0x48 ++ .byte 0x89 ++ .byte 0xc4 ++#else + movq %rax, %rsp ++#endif + + #ifdef GRUB_MACHINE_EFI + jmp LOCAL(skip_efi_stack_align) +@@ -95,8 +104,15 @@ LOCAL(skip_efi_stack_align): + VARIABLE(grub_relocator64_rsi) + .quad 0 + ++#ifndef __x86_64__ ++ /* movq %rax, %rsi */ ++ .byte 0x48 ++ .byte 0x89 ++ .byte 0xc6 ++#else + movq %rax, %rsi +- ++#endif ++ + /* mov imm64, %rax */ + .byte 0x48 + .byte 0xb8 +@@ -128,6 +144,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 +-- +Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org +Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com + -- Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com