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.
This commit is contained in:
Efraim Flashner 2022-12-22 22:09:58 +02:00
parent 1be1961a1c
commit 6ce7904a85
No known key found for this signature in database
GPG Key ID: 41AAE7DCCA3D8351

View File

@ -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