From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#31380: grub fails to build on i686-linux Date: Fri, 15 Jun 2018 16:52:17 +0200 Message-ID: <87d0wst84e.fsf@gnu.org> References: <87d0y7grsz.fsf@netris.org> <874li6rq21.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTq64-0008KA-DR for bug-guix@gnu.org; Fri, 15 Jun 2018 10:53:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTq62-0001Pw-Nt for bug-guix@gnu.org; Fri, 15 Jun 2018 10:53:04 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:42635) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTq62-0001Pb-Io for bug-guix@gnu.org; Fri, 15 Jun 2018 10:53:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <874li6rq21.fsf@netris.org> (Mark H. Weaver's message of "Wed, 13 Jun 2018 23:43:18 -0400") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Mark H Weaver Cc: 31380@debbugs.gnu.org Hello Mark, Mark H Weaver skribis: > retitle 31380 grub fails to build on i686-linux > severity 31380 serious > thanks > > Mark H Weaver 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=3D1 -DGRUB_MA= CHINE=3DI386_EFI -m32 -nostdinc -isystem /gnu/store/w55k6qc17s6nf7rv4agap9l= sas4hb50l-gcc-5.5.0-lib/lib/gcc/i686-unknown-linux-gnu/5.5.0/include -I../i= nclude -I../include -DGRUB_FILE=3D\"lib/i386/relocator.c\" -I. -I. -I.. -I.= . -I../include -I../include -I../grub-core/lib/libgcrypt-grub/src/ -D_FI= LE_OFFSET_BITS=3D64 -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-su= bscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-= by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -W= implicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-br= aces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Ws= equence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragma= s -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-val= ue -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-ca= st -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-si= gn -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wfor= mat=3D2 -march=3Di386 -m32 -falign-jumps=3D1 -falign-loops=3D1 -falign-func= tions=3D1 -freg-struct-return -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3d= now -msoft-float -fno-dwarf2-cfi-asm -mno-stack-arg-probe -fno-asynchronous= -unwind-tables -fno-unwind-tables -Qn -fno-stack-protector -Wtrampolines -W= error -ffreestanding -MT lib/i386/relocator_module-relocator.o -MD -MP = -MF lib/i386/.deps-core/relocator_module-relocator.Tpo -c -o lib/i386/reloc= ator_module-relocator.o `test -f 'lib/i386/relocator.c' || echo './'`lib/i3= 86/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=3D\"util/grub-mkfont.c\" = -I. -I. -I. -I. -I./include -I./include -I./grub-core/lib/libgcrypt-grub/sr= c/ -DGRUB_MKFONT=3D1 -DGRUB_BUILD=3D1 -DGRUB_UTIL=3D1 -DGRUB_BUILD_PROGRAM_NAME=3D\"build-grub-mkfont\" util/grub-mkfont.c grub-= core/unidata.c grub-core/kern/emu/misc.c util/misc.c -I/gnu/store/gi5gzdblb= yrjjrjlknhxnrkc0h6zig2q-freetype-2.9/include/freetype2 -I/gnu/store/hsq4n17= f58510q0l0syw3jdb24fb6d8k-libpng-1.6.34/include/libpng16 -L/gnu/store/gi5gz= dblbyrjjrjlknhxnrkc0h6zig2q-freetype-2.9/lib -lfreetype [=E2=80=A6] config.status: creating grub-fs-tester chmod a+x grub-fs-tester ./build-grub-mkfont -o unicode.pf2 ./unifont.bdf || (rm -f unicode.pf2; exi= t 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=E2=80=99s because ld-wrapper was shadowed by the new binutils input. I fixed this and pushed as a7c8716928a240ba2c36d360e4ffeb447671fa6b. I wanted to try =E2=80=98guix system vm-image -s i686-linux=E2=80=99 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-min= imal-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/4aka3nwppxf3z072l6vr8cxvw= j3x5h9s-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/4aka3nwppxf3z072l6vr8cxv= wj3x5h9s-glibc-2.27/lib/libpthread.so.0 #2 0xf78e95a1 in __new_sem_wait_slow () from /gnu/store/4aka3nwppxf3z072l6= vr8cxvwj3x5h9s-glibc-2.27/lib/libpthread.so.0 #3 0x56ab11c6 in ?? () #4 0x56aab8e0 in ?? () #5 0xf78e035b in start_thread () from /gnu/store/4aka3nwppxf3z072l6vr8cxvw= j3x5h9s-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/4aka3nwppxf3z072l6vr8cxvwj3x= 5h9s-glibc-2.27/lib/libpthread.so.0 #2 0xf7c04fe3 in g_usleep () from /gnu/store/1k808cq1dwlcjlfqmd4p5rxjpz2vc= kra-glib-2.56.0/lib/libglib-2.0.so.0 #3 0x56ac337e in ?? () #4 0xf78e035b in start_thread () from /gnu/store/4aka3nwppxf3z072l6vr8cxvw= j3x5h9s-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/4aka3nwppxf3z072l6vr= 8cxvwj3x5h9s-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/4aka3nwppxf3z072l6vr8cxvw= j3x5h9s-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/4aka3nwppxf3z072l6vr8cxvw= j3x5h9s-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=E2=80=99.