From: Mark H Weaver <mhw@netris.org>
To: 31380@debbugs.gnu.org
Subject: bug#31380: grub fails to build on i686-linux
Date: Wed, 13 Jun 2018 23:43:18 -0400 [thread overview]
Message-ID: <874li6rq21.fsf@netris.org> (raw)
In-Reply-To: <87d0y7grsz.fsf@netris.org> (Mark H. Weaver's message of "Mon, 07 May 2018 15:59:56 -0400")
[-- Attachment #1: Type: text/plain, Size: 3287 bytes --]
retitle 31380 grub fails to build on i686-linux
severity 31380 serious
thanks
Mark H Weaver <mhw@netris.org> writes:
> On the 'core-updates' branch, both 'grub' and 'grub-efi' fail to build
> on i686-linux. See below for the relevant excerpt from the build log
> of 'grub-efi', but the error is the same for both.
core-updates has since been merged to master, so this is now a serious
problem for i686 users. It prevents building any system, and therefore
prevents i686 users from applying security updates.
> gcc -DHAVE_CONFIG_H -I. -I.. -Wall -W -DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=I386_EFI -m32 -nostdinc -isystem /gnu/store/w55k6qc17s6nf7rv4agap9lsas4hb50l-gcc-5.5.0-lib/lib/gcc/i686-unknown-linux-gnu/5.5.0/include -I../include -I../include -DGRUB_FILE=\"lib/i386/relocator.c\" -I. -I. -I.. -I.. -I../include -I../include -I../grub-core/lib/libgcrypt-grub/src/ -D_FILE_OFFSET_BITS=64 -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -march=i386 -m32 -falign-jumps=1 -falign-loops=1 -falign-functions=1 -freg-struct-return -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -msoft-float -fno-dwarf2-cfi-asm -mno-stack-arg-probe -fno-asynchronous-unwind-tables -fno-unwind-tables -Qn -fno-stack-protector -Wtrampolines -Werror -ffreestanding -MT lib/i386/relocator_module-relocator.o -MD -MP -MF lib/i386/.deps-core/relocator_module-relocator.Tpo -c -o lib/i386/relocator_module-relocator.o `test -f 'lib/i386/relocator.c' || echo './'`lib/i386/relocator.c
> lib/i386/relocator64.S: Assembler messages:
> lib/i386/relocator64.S:66: Error: unknown pseudo-op: `.code64'
> lib/i386/relocator64.S:74: Error: bad register name `%rax'
> lib/i386/relocator64.S:88: Error: bad register name `%rsp'
> lib/i386/relocator64.S:98: Error: bad register name `%rax'
> lib/i386/relocator64.S:132: Error: bad register name `%rip)'
I looked into this, and the problem is that our 'binutils' package on
i686-linux is not configured to support 64-bit instructions.
Here's a proposed patch that I hope will fix the problem, although I'm
unable to easily test it because I no longer use binary substitutes, and
I have not yet built the core packages for i686-linux.
However, I've applied this patch to my x86_64 system, and verified that
it does not cause any problems there.
Would someone be willing to test it and report back?
Mark
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] UNTESTED: gnu: grub: Fix build on 32-bit x86 --]
[-- Type: text/x-patch, Size: 1617 bytes --]
From 6fb0495569846b6399583a6c32ee341dde2e1785 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Mon, 11 Jun 2018 19:21:39 -0400
Subject: [PATCH] UNTESTED: gnu: grub: Fix build on 32-bit x86.
---
gnu/packages/bootloaders.scm | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index a86c73731..8c8588973 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -61,7 +61,8 @@
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (srfi srfi-1)
- #:use-module (srfi srfi-26))
+ #:use-module (srfi srfi-26)
+ #:use-module (ice-9 regex))
(define unifont
;; GNU Unifont, <http://gnu.org/s/unifont>.
@@ -144,6 +145,19 @@
("texinfo" ,texinfo)
("help2man" ,help2man)
+ ;; FIXME: When building GRUB 2.02 on 32-bit x86, we need a binutils
+ ;; capable of assembling 64-bit instructions. However, our default
+ ;; binutils on 32-bit x86 is not 64-bit capable.
+ ,@(if (string-match "^i[3456]86-" (%current-system))
+ `(("binutils"
+ ,(package/inherit
+ binutils
+ (arguments
+ (substitute-keyword-arguments (package-arguments binutils)
+ ((#:configure-flags flags ''())
+ `(cons "--enable-64-bit-bfd" ,flags)))))))
+ '())
+
;; Dependencies for the test suite. The "real" QEMU is needed here,
;; because several targets are used.
("parted" ,parted)
--
2.17.1
next prev parent reply other threads:[~2018-06-14 3:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-07 19:59 bug#31380: [core-updates] grub fails to build on i686-linux Mark H Weaver
2018-06-14 3:43 ` Mark H Weaver [this message]
2018-06-15 14:52 ` bug#31380: " Ludovic Courtès
2018-06-15 16:45 ` Ludovic Courtès
2018-07-04 13:25 ` Ludovic Courtès
2018-06-16 8:22 ` Mark H Weaver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874li6rq21.fsf@netris.org \
--to=mhw@netris.org \
--cc=31380@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).