summary refs log tree commit diff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2022-12-22 22:09:58 +0200
committerEfraim Flashner <efraim@flashner.co.il>2022-12-22 22:09:58 +0200
commit6ce7904a85154fece2c159d26b39bfa54b36101a (patch)
treedc4e6260c8ef0cb5348be17a1abd5896cb5e66db
parent1be1961a1c28c7e7231683199061ba87f6a088e1 (diff)
downloadguix-6ce7904a85154fece2c159d26b39bfa54b36101a.tar.gz
gnu: ipxe-qemu: Fix building on 32-bit systems.
* gnu/packages/bootloaders.scm (ipxe-qemu)[native-inputs]: When building
from a 32-bit system add a binutils variant capable of assembling 64-bit
instructions and an ld-wrapper using it.
-rw-r--r--gnu/packages/bootloaders.scm25
1 files changed, 21 insertions, 4 deletions
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 464a6f54c1..57705cf596 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -1547,10 +1547,27 @@ the features of iPXE without the hassle of reflashing.")
      (if (target-x86-64?)
          (modify-inputs (package-native-inputs ipxe)
            (prepend edk2-tools))
-         (modify-inputs (package-native-inputs ipxe)
-           (prepend edk2-tools
-                    (cross-gcc "x86_64-linux-gnu")
-                    (cross-binutils "x86_64-linux-gnu")))))
+         (if (target-64bit?)
+           (modify-inputs (package-native-inputs ipxe)
+             (prepend edk2-tools
+                      (cross-gcc "x86_64-linux-gnu")
+                      (cross-binutils "x86_64-linux-gnu")))
+           ;; Our default 32-bit binutils is not 64-bit capable.
+           (let ((binutils-64-bit-bfd
+                   (package/inherit
+                     binutils
+                     (name "binutils-64-bit-bfd")
+                     (arguments
+                       (substitute-keyword-arguments (package-arguments binutils)
+                        ((#:configure-flags flags ''())
+                         `(cons "--enable-64-bit-bfd" ,flags)))))))
+             (modify-inputs (package-native-inputs ipxe)
+               (prepend edk2-tools
+                        (make-ld-wrapper "ld-wrapper-64-bit-bfd"
+                                         #:binutils binutils)
+                        binutils-64-bit-bfd
+                        (cross-gcc "x86_64-linux-gnu")
+                        (cross-binutils "x86_64-linux-gnu")))))))
     (arguments
      (let ((roms
             ;; Alist of ROM -> (VID . DID) entries.  This list and below