guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: grub: Cross-build fix for system i686-linux.


From: guix-commits
Subject: branch master updated: gnu: grub: Cross-build fix for system i686-linux.
Date: Thu, 25 Jun 2020 11:51:17 -0400

This is an automated email from the git hooks/post-receive script.

janneke pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new d613991  gnu: grub: Cross-build fix for system i686-linux.
d613991 is described below

commit d613991a8ebe5d4b3a7706f8f0dd52f16fc1c50a
Author: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Sun Jun 21 15:18:18 2020 +0200

    gnu: grub: Cross-build fix for system i686-linux.
    
    * 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                      |  6 +-
 gnu/packages/patches/grub-cross-system-i686.patch | 79 +++++++++++++++++++++++
 3 files changed, 83 insertions(+), 3 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index a321575..c92eff3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1048,6 +1048,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 ea80cf0..07b406b 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès 
<ludo@gnu.org>
 ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
-;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2016, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym@scratchpost.org>
 ;;; Copyright © 2016, 2017 David Craven <david@craven.ch>
@@ -11,7 +11,6 @@
 ;;; Copyright © 2019 nee <nee@cock.li>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
-;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2018, 2019, 2020 Vagrant Cascadian <vagrant@debian.org>
 ;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com>
 ;;;
@@ -97,7 +96,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 0000000..a376cae
--- /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 <https://bugs.gnu.org/41982>.
+
+From 270667540146f8ef9ea7a44258a71b3837a7af4a Mon Sep 17 00:00:00 2001
+From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
+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 <janneke@gnu.org> | GNU LilyPond http://lilypond.org
+Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]