[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/15: gnu: grub: Add support for Loongson-based machines.
From: |
Mark H. Weaver |
Subject: |
07/15: gnu: grub: Add support for Loongson-based machines. |
Date: |
Thu, 20 Aug 2015 06:55:03 +0000 |
mhw pushed a commit to branch wip-loongson2f
in repository guix.
commit fae467f240425d17924a08ccd5927c4eec8f21e4
Author: Mark H Weaver <address@hidden>
Date: Sat Aug 15 01:31:50 2015 -0400
gnu: grub: Add support for Loongson-based machines.
* gnu/packages/patches/grub-mips-abi.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
* gnu/packages/grub.scm (grub)[source]: Add patch.
[arguments]: Disable tests on MIPS.
[native-inputs]: Remove qemu and xorriso (for tests) on MIPS.
---
gnu-system.am | 1 +
gnu/packages/grub.scm | 21 +++++++--
gnu/packages/patches/grub-mips-abi.patch | 68 ++++++++++++++++++++++++++++++
3 files changed, 86 insertions(+), 4 deletions(-)
diff --git a/gnu-system.am b/gnu-system.am
index 0dc6fab..2717681 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -472,6 +472,7 @@ dist_patch_DATA =
\
gnu/packages/patches/gobject-introspection-cc.patch \
gnu/packages/patches/gobject-introspection-girepository.patch \
gnu/packages/patches/grep-CVE-2015-1345.patch \
+ gnu/packages/patches/grub-mips-abi.patch \
gnu/packages/patches/gsl-poly-test-fix-pt1.patch \
gnu/packages/patches/gsl-poly-test-fix-pt2.patch \
gnu/packages/patches/guile-1.8-cpp-4.5.patch \
diff --git a/gnu/packages/grub.scm b/gnu/packages/grub.scm
index c76fa22..f1b05df 100644
--- a/gnu/packages/grub.scm
+++ b/gnu/packages/grub.scm
@@ -85,10 +85,17 @@
(commit (last (string-split version #\g)))))
(sha256
(base32
- "0g7kg4286w84ib31fb52jxpljn345wl3i91xsfizh9b5adcpi9fq"))))
+ "0g7kg4286w84ib31fb52jxpljn345wl3i91xsfizh9b5adcpi9fq"))
+ (patches (list (search-patch "grub-mips-abi.patch")))))
(build-system gnu-build-system)
(arguments
- '(#:configure-flags '("--disable-werror")
+ `(,@(if (string-prefix? "mips" (or (%current-target-system)
+ (%current-system)))
+ ;; XXX Disable tests on MIPS, to work around the fact that our
+ ;; QEMU package is currently broken on MIPS.
+ '(#:tests? #f)
+ '())
+ #:configure-flags '("--disable-werror")
#:phases (modify-phases %standard-phases
(add-after
'unpack 'patch-stuff
@@ -129,8 +136,14 @@
;; Dependencies for the test suite. The "real" QEMU is needed here,
;; because several targets are used.
- ("qemu" ,qemu-for-tests)
- ("xorriso" ,xorriso)))
+ ;;
+ ;; XXX Don't add these on MIPS, since our QEMU package is currently
+ ;; broken on MIPS.
+ ,@(if (not (string-prefix? "mips" (or (%current-target-system)
+ (%current-system))))
+ '(("qemu" ,qemu-for-tests)
+ ("xorriso" ,xorriso))
+ '())))
(home-page "http://www.gnu.org/software/grub/")
(synopsis "GRand Unified Boot loader")
(description
diff --git a/gnu/packages/patches/grub-mips-abi.patch
b/gnu/packages/patches/grub-mips-abi.patch
new file mode 100644
index 0000000..7ed2fa2
--- /dev/null
+++ b/gnu/packages/patches/grub-mips-abi.patch
@@ -0,0 +1,68 @@
+From b397fa4834b4552e3a7c99ee783aff2ee264b290 Mon Sep 17 00:00:00 2001
+From: Mark H Weaver <address@hidden>
+Date: Sun, 16 Aug 2015 23:44:11 -0400
+Subject: [PATCH] Ensure that MIPS target code is compiled for the O32 ABI.
+
+Include -mabi=32 in CFLAGS_PLATFORM and CCASFLAGS_PLATFORM to compile
+code for the O32 ABI when targetting MIPS, since the MIPS assembly code
+in GRUB assumes this. This flag is also needed when compiling
+asm-tests/mips.S from configure, because GNU as rejects MIPS register
+names such as $t2 unless the O32 ABI is selected.
+---
+ conf/Makefile.common | 4 ++++
+ configure.ac | 7 +++++--
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/conf/Makefile.common b/conf/Makefile.common
+index fcb8d2e..bd125da 100644
+--- a/conf/Makefile.common
++++ b/conf/Makefile.common
+@@ -20,6 +20,10 @@ endif
+ if COND_powerpc_ieee1275
+ CFLAGS_PLATFORM += -mcpu=powerpc
+ endif
++if COND_mips
++ CFLAGS_PLATFORM += -mabi=32
++ CCASFLAGS_PLATFORM = -mabi=32
++endif
+
+ #FIXME: discover and check XEN headers
+ CPPFLAGS_XEN = -I/usr/include
+diff --git a/configure.ac b/configure.ac
+index c864311..1f5e8a2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2,7 +2,8 @@
+
+ # Process this file with autoconf to produce a configure script.
+
+-# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software
Foundation, Inc.
++# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,
++# 2012,2013,2014,2015 Free Software Foundation, Inc.
+ #
+ # This configure.ac is free software; the author
+ # gives unlimited permission to copy and/or distribute it,
+@@ -599,9 +600,11 @@ fi
+
+ AC_CACHE_CHECK([for options to compile assembly],
[grub_cv_cc_target_asm_compile], [
+ test_program=
++test_ccasflags=
+ case "x$target_cpu-$platform" in
+ xmips-* | xmipsel-*)
+ test_program=mips
++ test_ccasflags=-mabi=32
+ ;;
+ xi386-pc)
+ test_program=i386-pc
+@@ -618,7 +621,7 @@ if test x"$test_program" = x ; then
+ else
+ found=no
+ for arg in "" "-no-integrated-as"; do
+- cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $arg
$TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
++ cmdline="$TARGET_CC -c -o /dev/null $TARGET_CCASFLAGS $test_ccasflags
$arg $TARGET_CPPFLAGS $srcdir/asm-tests/$test_program.S"
+ echo "Running $cmdline" >&AS_MESSAGE_LOG_FD
+ if $cmdline >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
+ grub_cv_cc_target_asm_compile="$arg"
+--
+2.4.3
+
- branch wip-loongson2f created (now efd15f9), Mark H. Weaver, 2015/08/20
- 08/15: system: grub: On MIPS, the linux image name is vmlinuz, not bzImage., Mark H. Weaver, 2015/08/20
- 01/15: gnu: linux-libre: Add case for ARCH=mips., Mark H. Weaver, 2015/08/20
- 05/15: gnu: grub: Update to 2.02-beta2-500-gba218c1., Mark H. Weaver, 2015/08/20
- 03/15: gnu: grub: Use modify-phases and other minor cleanups., Mark H. Weaver, 2015/08/20
- 02/15: gnu: Add linux-libre-loongson2f., Mark H. Weaver, 2015/08/20
- 06/15: gnu: grub: Install documentation., Mark H. Weaver, 2015/08/20
- 04/15: gnu: grub: Add comment noting that 'fuse' would be a desirable input., Mark H. Weaver, 2015/08/20
- 14/15: MIPS_ONLY: services: xorg: Remove several drivers (for Yeeloong)., Mark H. Weaver, 2015/08/20
- 13/15: MIPS_ONLY: Don't try to copy modules that don't exist in the loongson2f kernel., Mark H. Weaver, 2015/08/20
- 07/15: gnu: grub: Add support for Loongson-based machines.,
Mark H. Weaver <=
- 11/15: gnu: gst-plugins-base: Disable tests on MIPS and ARM., Mark H. Weaver, 2015/08/20
- 10/15: system: grub: Adjust eye-candy to work on non-Intel systems., Mark H. Weaver, 2015/08/20
- 15/15: MIPS_ONLY: file-systems: Remove hugetlb cgroup filesystem., Mark H. Weaver, 2015/08/20
- 12/15: PRELIMINARY: Fix problem with 'guix system init --nogrub'., Mark H. Weaver, 2015/08/20
- 09/15: system: grub: Convert grub background using rsvg-convert, not inkscape., Mark H. Weaver, 2015/08/20