aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2024-07-18 23:33:32 +0300
committerEfraim Flashner <efraim@flashner.co.il>2024-07-19 00:05:01 +0300
commit4ee2a660e5f1362d3a72dcdc62ba8ff5612949da (patch)
tree94b3c6ee48faffc9a363b3b1ab8c3527d804b9d8 /gnu
parent447be4aff8d40ac247f0c5bef7088229b5e20411 (diff)
downloadguix-4ee2a660e5f1362d3a72dcdc62ba8ff5612949da.tar
guix-4ee2a660e5f1362d3a72dcdc62ba8ff5612949da.tar.gz
gnu: grub: Enable building on powerpc64le-linux.
* gnu/packages/bootloaders.scm (grub)[arguments]: Adjust configure-flags when building for powerpc64le-linux to use clang. When building for powerpc64le-linux add a phase to skip 2 tests. [native-inputs]: When building for powerpc64le-linux add clang. Change-Id: I26ce37e7b864964ede5c9fd73a5a2d4cb89ada45
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/bootloaders.scm29
1 files changed, 28 insertions, 1 deletions
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 79e02056eb..4072df50d7 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -53,6 +53,7 @@
#:use-module (gnu packages gcc)
#:use-module (gnu packages gettext)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages llvm)
#:use-module (gnu packages man)
#:use-module (gnu packages mtools)
#:use-module (gnu packages ncurses)
@@ -132,7 +133,17 @@
;; Counterintuitively, this *disables* a spurious Python dependency by
;; calling the ‘true’ binary instead. Python is only needed during
;; bootstrapping (for genptl.py), not when building from a release.
- #~(list "PYTHON=true")
+ #~(append
+ (list "PYTHON=true")
+ ;; This needs to be compiled with clang for powerpc64le.
+ (if #$(and=> (%current-target-system)
+ target-ppc64le?)
+ (list "TARGET_CC=powerpc64le-linux-gnu-clang")
+ '())
+ (if #$(and (target-ppc64le? (%current-system))
+ (not (%current-target-system)))
+ (list "CC=clang")
+ '()))
;; GRUB fails to load modules stripped with --strip-unneeded.
#:strip-flags
@@ -185,6 +196,13 @@
(substitute* "Makefile.in"
(("grub_cmd_date grub_cmd_set_date grub_cmd_sleep")
"grub_cmd_date grub_cmd_sleep"))))
+ #$@(if (target-ppc64le?)
+ #~((add-before 'check 'skip-tests
+ (lambda _
+ (substitute* "Makefile.in"
+ ((" grub_cmd_date ") " ")
+ ((" pseries_test ") " ")))))
+ #~())
(add-before 'check 'disable-pixel-perfect-test
(lambda _
;; This test compares many screenshots rendered with an older
@@ -204,6 +222,15 @@
;; is required for generating alternative keyboard layouts.
console-setup)
+ ;; 64-bit PowerPC hardware boots in big-endian mode and then for
+ ;; powerpc64le it switches to little-endian mode. Therefore we
+ ;; need a compiler which can generate both big-endian and
+ ;; little-endian binaries for the bootloader and the utilities
+ ;; and building with clang is the easiest option.
+ (if (target-ppc64le?)
+ (list clang)
+ '())
+
;; Depend on LVM2 for libdevmapper, used by 'grub-probe' and
;; 'grub-install' to recognize mapped devices (LUKS, etc.)
(if (member (or (%current-target-system)