unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31380: [core-updates] grub fails to build on i686-linux
@ 2018-05-07 19:59 Mark H Weaver
  2018-06-14  3:43 ` bug#31380: " Mark H Weaver
  0 siblings, 1 reply; 6+ messages in thread
From: Mark H Weaver @ 2018-05-07 19:59 UTC (permalink / raw)
  To: 31380

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.

  https://hydra.gnu.org/build/2675846
  https://hydra.gnu.org/build/2684033

      Mark

--8<---------------cut here---------------start------------->8---
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)'
make[3]: *** [Makefile:28996: lib/i386/relocator_module-relocator64.o] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f lib/.deps-core/crypto_module-crypto.Tpo lib/.deps-core/crypto_module-crypto.Po
mv -f lib/i386/.deps-core/relocator_module-relocator.Tpo lib/i386/.deps-core/relocator_module-relocator.Po
mv -f fs/.deps-core/xfs_module-xfs.Tpo fs/.deps-core/xfs_module-xfs.Po
make[3]: Leaving directory '/tmp/guix-build-grub-efi-2.02.drv-0/grub-2.02/grub-core'
make[2]: *** [Makefile:23531: all] Error 2
make[2]: Leaving directory '/tmp/guix-build-grub-efi-2.02.drv-0/grub-2.02/grub-core'
make[1]: *** [Makefile:10904: all-recursive] Error 1
make[1]: Leaving directory '/tmp/guix-build-grub-efi-2.02.drv-0/grub-2.02'
make: *** [Makefile:3130: all] Error 2
--8<---------------cut here---------------end--------------->8---

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#31380: grub fails to build on i686-linux
  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
  2018-06-15 14:52   ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Mark H Weaver @ 2018-06-14  3:43 UTC (permalink / raw)
  To: 31380

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#31380: grub fails to build on i686-linux
  2018-06-14  3:43 ` bug#31380: " Mark H Weaver
@ 2018-06-15 14:52   ` Ludovic Courtès
  2018-06-15 16:45     ` Ludovic Courtès
  2018-06-16  8:22     ` Mark H Weaver
  0 siblings, 2 replies; 6+ messages in thread
From: Ludovic Courtès @ 2018-06-15 14:52 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 31380

Hello Mark,

Mark H Weaver <mhw@netris.org> skribis:

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

I tried it and it initially failed to build with:

--8<---------------cut here---------------start------------->8---
gcc -o build-grub-mkfont -I./include  -DGRUB_FILE=\"util/grub-mkfont.c\" -I. -I. -I. -I. -I./include -I./include -I./grub-core/lib/libgcrypt-grub/src/  -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1
 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/misc.c util/misc.c -I/gnu/store/gi5gzdblbyrjjrjlknhxnrkc0h6zig2q-freetype-2.9/include/freetype2 -I/gnu/store/hsq4n17f58510q0l0syw3jdb24fb6d8k-libpng-1.6.34/include/libpng16 -L/gnu/store/gi5gzdblbyrjjrjlknhxnrkc0h6zig2q-freetype-2.9/lib -lfreetype

[…]

config.status: creating grub-fs-tester
chmod a+x grub-fs-tester
./build-grub-mkfont -o unicode.pf2 ./unifont.bdf || (rm -f unicode.pf2; exit 1)
./build-grub-mkfont: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory
make[2]: *** [Makefile:12719: unicode.pf2] Error 1
make[2]: *** Waiting for unfinished jobs....
--8<---------------cut here---------------end--------------->8---

That’s because ld-wrapper was shadowed by the new binutils input.

I fixed this and pushed as a7c8716928a240ba2c36d360e4ffeb447671fa6b.

I wanted to try ‘guix system vm-image -s i686-linux’ on my x86_64 laptop
to make sure GRUB runs fine.  Unfortunately, I stumbled upon another
issue, which is that qemu-system-i386 built for i686-linux segfaults at
startup:

--8<---------------cut here---------------start------------->8---
Core was generated by `/gnu/store/wm9cimv1mxak3zp7lddj9n992yy27y3n-qemu-minimal-2.12.0/bin/qemu-system'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x566eb1aa in ?? ()
[Current thread is 1 (Thread 0xf57ffb40 (LWP 19004))]
(gdb) bt
#0  0x566eb1aa in ?? ()
#1  0x566eb303 in ?? ()
#2  0x566c10c7 in ?? ()
#3  0xf78e035b in start_thread () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libpthread.so.0
#4  0xf77f75d6 in clone () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libc.so.6
(gdb) thread apply all bt

Thread 5 (Thread 0xf6d89b40 (LWP 19000)):
#0  0xf7f0b059 in __kernel_vsyscall ()
#1  0xf78e93ea in do_futex_wait () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libpthread.so.0
#2  0xf78e95a1 in __new_sem_wait_slow () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libpthread.so.0
#3  0x56ab11c6 in ?? ()
#4  0x56aab8e0 in ?? ()
#5  0xf78e035b in start_thread () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libpthread.so.0
#6  0xf77f75d6 in clone () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libc.so.6

Thread 4 (Thread 0xf768bb40 (LWP 18999)):
#0  0xf7f0b059 in __kernel_vsyscall ()
#1  0xf78eaa0b in nanosleep () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libpthread.so.0
#2  0xf7c04fe3 in g_usleep () from /gnu/store/1k808cq1dwlcjlfqmd4p5rxjpz2vckra-glib-2.56.0/lib/libglib-2.0.so.0
#3  0x56ac337e in ?? ()
#4  0xf78e035b in start_thread () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libpthread.so.0
#5  0xf77f75d6 in clone () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libc.so.6

Thread 3 (Thread 0xf768cbc0 (LWP 18998)):
#0  0xf7f0b059 in __kernel_vsyscall ()
#1  0xf77ed5e4 in ppoll () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libc.so.6
#2  0x56aac405 in ?? ()
#3  0x56aad608 in ?? ()
#4  0x56666c2a in ?? ()
#5  0xf771df75 in __libc_start_main () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libc.so.6
#6  0x5666deb3 in ?? ()

Thread 2 (Thread 0xf61fcb40 (LWP 19003)):
#0  0xf7f0b059 in __kernel_vsyscall ()
#1  0xf77ed5e4 in ppoll () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libc.so.6
#2  0x56aac42e in ?? ()
#3  0x56aae57e in ?? ()
#4  0x567d041d in ?? ()
#5  0xf78e035b in start_thread () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libpthread.so.0
#6  0xf77f75d6 in clone () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libc.so.6

Thread 1 (Thread 0xf57ffb40 (LWP 19004)):
#0  0x566eb1aa in ?? ()
#1  0x566eb303 in ?? ()
#2  0x566c10c7 in ?? ()
#3  0xf78e035b in start_thread () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libpthread.so.0
#4  0xf77f75d6 in clone () from /gnu/store/4aka3nwppxf3z072l6vr8cxvwj3x5h9s-glibc-2.27/lib/libc.so.6
--8<---------------cut here---------------end--------------->8---

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#31380: grub fails to build on i686-linux
  2018-06-15 14:52   ` 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
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2018-06-15 16:45 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 31380

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

ludo@gnu.org (Ludovic Courtès) skribis:

> I wanted to try ‘guix system vm-image -s i686-linux’ on my x86_64 laptop
> to make sure GRUB runs fine.  Unfortunately, I stumbled upon another
> issue, which is that qemu-system-i386 built for i686-linux segfaults at
> startup:

I was able to work around it by disabling KVM:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 583 bytes --]

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 73d0191de..a675111d4 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -104,7 +104,8 @@ the #:references-graphs parameter of 'derivation'."
       ;; hardware virtualization to still use these commands.  KVM support is
       ;; still buggy on some ARM32 boards. Do not use it even if available.
       ,@(if (and (file-exists? "/dev/kvm")
-                 (not target-arm32?))
+                 (not target-arm32?)
+                 (not (string-suffix? "-i386" qemu)))
             '("-enable-kvm")
             '())
 

[-- Attachment #3: Type: text/plain, Size: 389 bytes --]


I suspect a KVM bug in Linux 4.17 though, because running the same
‘qemu-system-i386’ binary under strace works…  Perhaps worth applying
the patch above in the meantime, WDYT?

Anyway, with this patch I successfully run:

  guix system vm-image gnu/system/examples/bare-bones.tmpl -s i686-linux

and confirmed that the resulting image would boot through GRUB.

Ludo’.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#31380: grub fails to build on i686-linux
  2018-06-15 14:52   ` Ludovic Courtès
  2018-06-15 16:45     ` Ludovic Courtès
@ 2018-06-16  8:22     ` Mark H Weaver
  1 sibling, 0 replies; 6+ messages in thread
From: Mark H Weaver @ 2018-06-16  8:22 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 31380-done

Hi Ludovic,

ludo@gnu.org (Ludovic Courtès) writes:

> Mark H Weaver <mhw@netris.org> skribis:
>
>> 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?
>
> I tried it and it initially failed to build with:
[...]
> I fixed this and pushed as a7c8716928a240ba2c36d360e4ffeb447671fa6b.

Thanks very much!  Hydra has now successfully built GRUB on i686-linux,
so I'm closing this bug.

> I wanted to try ‘guix system vm-image -s i686-linux’ on my x86_64 laptop
> to make sure GRUB runs fine.  Unfortunately, I stumbled upon another
> issue, which is that qemu-system-i386 built for i686-linux segfaults at
> startup:
[...]
> I was able to work around it by disabling KVM:
> 
> diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
> index 73d0191de..a675111d4 100644
> --- a/gnu/build/vm.scm
> +++ b/gnu/build/vm.scm
> @@ -104,7 +104,8 @@ the #:references-graphs parameter of 'derivation'."
>        ;; hardware virtualization to still use these commands.  KVM support is
>        ;; still buggy on some ARM32 boards. Do not use it even if available.
>        ,@(if (and (file-exists? "/dev/kvm")
> -                 (not target-arm32?))
> +                 (not target-arm32?)
> +                 (not (string-suffix? "-i386" qemu)))
>              '("-enable-kvm")
>              '())
>  
> I suspect a KVM bug in Linux 4.17 though, because running the same
> ‘qemu-system-i386’ binary under strace works…  Perhaps worth applying
> the patch above in the meantime, WDYT?

It would be better to auto-detect the presence of KVM support at run
time, but that's a wishlist item that deserves its own ticket.  This is
good enough for now.

> Anyway, with this patch I successfully run:
>
>   guix system vm-image gnu/system/examples/bare-bones.tmpl -s i686-linux
>
> and confirmed that the resulting image would boot through GRUB.

Sounds great, thanks again!

     Mark

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#31380: grub fails to build on i686-linux
  2018-06-15 16:45     ` Ludovic Courtès
@ 2018-07-04 13:25       ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2018-07-04 13:25 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 31380

ludo@gnu.org (Ludovic Courtès) skribis:

> ludo@gnu.org (Ludovic Courtès) skribis:
>
>> I wanted to try ‘guix system vm-image -s i686-linux’ on my x86_64 laptop
>> to make sure GRUB runs fine.  Unfortunately, I stumbled upon another
>> issue, which is that qemu-system-i386 built for i686-linux segfaults at
>> startup:
>
> I was able to work around it by disabling KVM:

I reported the issue upstream:

  https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg01166.html

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-07-04 13:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-07 19:59 bug#31380: [core-updates] grub fails to build on i686-linux Mark H Weaver
2018-06-14  3:43 ` bug#31380: " Mark H Weaver
2018-06-15 14:52   ` 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

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).