From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 21 09:55:25 2020 Received: (at submit) by debbugs.gnu.org; 21 Jun 2020 13:55:25 +0000 Received: from localhost ([127.0.0.1]:60113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jn0RN-0004lR-7t for submit@debbugs.gnu.org; Sun, 21 Jun 2020 09:55:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:51078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jn0RI-0004iR-6w for submit@debbugs.gnu.org; Sun, 21 Jun 2020 09:55:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jn0RH-0005GR-QY for bug-guix@gnu.org; Sun, 21 Jun 2020 09:55:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53137) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jn0RH-0002tr-HH; Sun, 21 Jun 2020 09:55:15 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=37526 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jn0RF-000611-NT; Sun, 21 Jun 2020 09:55:14 -0400 From: Jan Nieuwenhuizen To: bug-guix@gnu.org Subject: [PATCH 0/1] gnu: grub: Cross-build fix for system i686-linux. Organization: AvatarAcademy.nl X-Url: http://AvatarAcademy.nl Date: Sun, 21 Jun 2020 15:55:10 +0200 Message-ID: <87pn9sy14x.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! Attempting to reconfigure a i686-linux guix system to a Hurd system, I found that the Grub(-minimal) cross build fails like this --8<---------------cut here---------------start------------->8--- i586-pc-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -Wall -W -DGRUB_MACHINE_PCBIOS= =3D1 -DGRUB_MACHINE=3DI386_PC -m32 -nostdinc -isystem /gnu/store/5s0ldm3110= 0d9ix15d1lmbsvi0aa77pq-gcc-cross-i586-pc-gnu-7.5.0-lib/lib/gcc/i586-pc-gnu/= 7.5.0/include -I../include -I../include -DGRUB_FILE=3D\"lib/cmos_datetime.c= \" -I. -I. -I.. -I.. -I../include -I../include -I../grub-core/lib/libgcrypt= -grub/src/ -D_FILE_OFFSET_BITS=3D64 -Os -Wall -W -Wshadow -Wpointer-arit= h -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-= optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-secur= ity -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int = -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparenthese= s -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigrap= hs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-par= ameter -Wunused-value -Wunused-variable -Wwrite-strings -Wnested-externs -= Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-decl= arations -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-regist= er-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing= -declarations -Wformat=3D2 -march=3Di386 -m32 -mrtd -mregparm=3D3 -falign-j= umps=3D1 -falign-loops=3D1 -falign-functions=3D1 -freg-struct-return -mno-m= mx -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 -f= no-stack-protector -Wtrampolines -Werror -ffreestanding -MT lib/datetim= e_module-cmos_datetime.o -MD -MP -MF lib/.deps-core/datetime_module-cmos_da= tetime.Tpo -c -o lib/datetime_module-cmos_datetime.o `test -f 'lib/cmos_dat= etime.c' || echo './'`lib/cmos_datetime.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:98: Error: bad register name `%rax' lib/i386/relocator64.S:132: Error: bad register name `%rip)' make[3]: *** [Makefile:32165: lib/i386/relocator_module-relocator64.o] Erro= r 1 make[3]: *** Waiting for unfinished jobs.... mv -f lib/i386/.deps-core/relocator_module-relocator_common_c.Tpo lib/i386/= .deps-core/relocator_module-relocator_common_c.Po mv -f lib/i386/.deps-core/relocator_module-relocator.Tpo lib/i386/.deps-cor= e/relocator_module-relocator.Po mv -f kern/.deps-core/elf_module-elf.Tpo kern/.deps-core/elf_module-elf.Po mv -f lib/.deps-core/datetime_module-cmos_datetime.Tpo lib/.deps-core/datet= ime_module-cmos_datetime.Po mv -f fs/.deps-core/xfs_module-xfs.Tpo fs/.deps-core/xfs_module-xfs.Po mv -f lib/.deps-core/crypto_module-crypto.Tpo lib/.deps-core/crypto_module-= crypto.Po mv -f lib/.deps-core/relocator_module-relocator.Tpo lib/.deps-core/relocato= r_module-relocator.Po make[3]: Leaving directory '/tmp/guix-build-grub-minimal-2.04.drv-0/grub-2.= 04/grub-core' make[2]: *** [Makefile:26403: all] Error 2 make[2]: Leaving directory '/tmp/guix-build-grub-minimal-2.04.drv-0/grub-2.= 04/grub-core' make[1]: *** [Makefile:11304: all-recursive] Error 1 make[1]: Leaving directory '/tmp/guix-build-grub-minimal-2.04.drv-0/grub-2.= 04' make: *** [Makefile:3343: all] Error 2 command "make" "-j" "8" failed with status 2 --8<---------------cut here---------------end--------------->8--- It is non-Hurd specific, it can be reproduced by running --8<---------------cut here---------------start------------->8--- ./pre-inst-env guix build --system=3Di686-linux --target=3Di686-linux-gnu g= rub-minimal --8<---------------cut here---------------end--------------->8--- I am not sure if and how to report this upstream. Ideas for a bug description? Apparently, non-cross builds "just" work (how?!). Greetings, Janneke Jan (janneke) Nieuwenhuizen (1): gnu: grub: Cross-build fix for system-i686. gnu/local.mk | 1 + gnu/packages/bootloaders.scm | 3 +- .../patches/grub-cross-system-i686.patch | 73 +++++++++++++++++++ 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/grub-cross-system-i686.patch --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 21 09:59:20 2020 Received: (at 41982) by debbugs.gnu.org; 21 Jun 2020 13:59:20 +0000 Received: from localhost ([127.0.0.1]:60686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jn0VA-0004zI-46 for submit@debbugs.gnu.org; Sun, 21 Jun 2020 09:59:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jn0V5-0004z1-Q7 for 41982@debbugs.gnu.org; Sun, 21 Jun 2020 09:59:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53149) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jn0V0-0003Pt-Eq; Sun, 21 Jun 2020 09:59:06 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=37530 helo=dundal.fritz.box) by fencepost.gnu.org with esmtpa (Exim 4.82) (envelope-from ) id 1jn0Uy-0008G1-UH; Sun, 21 Jun 2020 09:59:05 -0400 From: "Jan (janneke) Nieuwenhuizen" To: 41982@debbugs.gnu.org Subject: [PATCH 1/1] gnu: grub: Cross-build fix for system i686-linux. Date: Sun, 21 Jun 2020 15:59:03 +0200 Message-Id: <20200621135904.29195-1-janneke@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41982 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/patches/grub-cross-system-i686.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/bootloaders.scm (grub): Use it. --- gnu/local.mk | 1 + gnu/packages/bootloaders.scm | 3 +- .../patches/grub-cross-system-i686.patch | 79 +++++++++++++++++++ 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/grub-cross-system-i686.patch diff --git a/gnu/local.mk b/gnu/local.mk index 347d4bbb17..1a061f43f8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1044,6 +1044,7 @@ dist_patch_DATA = \ %D%/packages/patches/grocsvs-dont-use-admiral.patch \ %D%/packages/patches/gromacs-tinyxml2.patch \ %D%/packages/patches/groovy-add-exceptionutilsgenerator.patch \ + %D%/packages/patches/grub-cross-system-i686.patch \ %D%/packages/patches/grub-efi-fat-serial-number.patch \ %D%/packages/patches/grub-setup-root.patch \ %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \ diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index ea80cf020e..efbe488bc3 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -97,7 +97,8 @@ (patches (search-patches "grub-efi-fat-serial-number.patch" "grub-setup-root.patch" - "grub-verifiers-Blocklist-fallout-cleanup.patch")))) + "grub-verifiers-Blocklist-fallout-cleanup.patch" + "grub-cross-system-i686.patch")))) (build-system gnu-build-system) (arguments `(#:configure-flags diff --git a/gnu/packages/patches/grub-cross-system-i686.patch b/gnu/packages/patches/grub-cross-system-i686.patch new file mode 100644 index 0000000000..a376cae1db --- /dev/null +++ b/gnu/packages/patches/grub-cross-system-i686.patch @@ -0,0 +1,79 @@ +Not upstreamed. +Fixes cross-build for the Hurd, from i686-linux, +see . + +From 270667540146f8ef9ea7a44258a71b3837a7af4a Mon Sep 17 00:00:00 2001 +From: "Jan (janneke) Nieuwenhuizen" +Date: Sun, 21 Jun 2020 15:10:40 +0200 +Subject: [PATCH] grub-core: Build fixes for i386 + +* grub-core/lib/i386/relocator64.S: Avoid x86_64 instructions on i386. +--- + grub-core/lib/i386/relocator64.S | 26 +++++++++++++++++++++++++- + 1 file changed, 25 insertions(+), 1 deletion(-) + +diff --git a/grub-core/lib/i386/relocator64.S b/grub-core/lib/i386/relocator64.S +index 148f38adb..45fed9444 100644 +--- a/grub-core/lib/i386/relocator64.S ++++ b/grub-core/lib/i386/relocator64.S +@@ -63,7 +63,9 @@ VARIABLE(grub_relocator64_cr3) + movq %rax, %cr3 + #endif + ++#ifdef __x86_64__ + .code64 ++#endif + + /* mov imm64, %rax */ + .byte 0x48 +@@ -71,7 +73,14 @@ VARIABLE(grub_relocator64_cr3) + VARIABLE(grub_relocator64_rsp) + .quad 0 + ++#ifndef __x86_64__ ++ /* movq %rax, %rsp */ ++ .byte 0x48 ++ .byte 0x89 ++ .byte 0xc4 ++#else + movq %rax, %rsp ++#endif + + #ifdef GRUB_MACHINE_EFI + jmp LOCAL(skip_efi_stack_align) +@@ -95,8 +104,15 @@ LOCAL(skip_efi_stack_align): + VARIABLE(grub_relocator64_rsi) + .quad 0 + ++#ifndef __x86_64__ ++ /* movq %rax, %rsi */ ++ .byte 0x48 ++ .byte 0x89 ++ .byte 0xc6 ++#else + movq %rax, %rsi +- ++#endif ++ + /* mov imm64, %rax */ + .byte 0x48 + .byte 0xb8 +@@ -128,6 +144,14 @@ VARIABLE(grub_relocator64_rdx) + #ifdef __APPLE__ + .byte 0xff, 0x25 + .quad 0 ++#elif !defined (__x86_64__) ++ /* jmp *LOCAL(jump_addr) (%rip) */ ++ .byte 0xff ++ .byte 0x25 ++ .byte 0 ++ .byte 0 ++ .byte 0 ++ .byte 0 + #else + jmp *LOCAL(jump_addr) (%rip) + #endif +-- +Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org +Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com + -- Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 23 05:28:10 2020 Received: (at 41982) by debbugs.gnu.org; 23 Jun 2020 09:28:10 +0000 Received: from localhost ([127.0.0.1]:35451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jnfDu-0003vf-5D for submit@debbugs.gnu.org; Tue, 23 Jun 2020 05:28:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jnfDs-0003vQ-9r for 41982@debbugs.gnu.org; Tue, 23 Jun 2020 05:28:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58871) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnfDl-0006mW-KL; Tue, 23 Jun 2020 05:28:01 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=52810 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jnfDj-0005y3-WE; Tue, 23 Jun 2020 05:28:00 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Jan Nieuwenhuizen Subject: Re: bug#41982: [PATCH 0/1] gnu: grub: Cross-build fix for system i686-linux. References: <87pn9sy14x.fsf@gnu.org> Date: Tue, 23 Jun 2020 11:27:58 +0200 In-Reply-To: <87pn9sy14x.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Sun, 21 Jun 2020 15:55:10 +0200") Message-ID: <87366m3zdt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41982 Cc: 41982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Jan Nieuwenhuizen skribis: > Attempting to reconfigure a i686-linux guix system to a Hurd system, I > found that the Grub(-minimal) cross build fails like this > > i586-pc-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -Wall -W -DGRUB_MACHINE_PCBIOS= =3D1 -DGRUB_MACHINE=3DI386_PC -m32 -nostdinc -isystem /gnu/store/5s0ldm3110= 0d9ix15d1lmbsvi0aa77pq-gcc-cross-i586-pc-gnu-7.5.0-lib/lib/gcc/i586-pc-gnu/= 7.5.0/include -I../include -I../include -DGRUB_FILE=3D\"lib/cmos_datetime.c= \" -I. -I. -I.. -I.. -I../include -I../include -I../grub-core/lib/libgcrypt= -grub/src/ -D_FILE_OFFSET_BITS=3D64 -Os -Wall -W -Wshadow -Wpointer-arit= h -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-= optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-secur= ity -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int = -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparenthese= s -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigrap= hs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-par= ameter -Wunused-value -Wunused-variable -Wwrite-strings -Wnested-externs -= Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-decl= arations -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-regist= er-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing= -declarations -Wformat=3D2 -march=3Di386 -m32 -mrtd -mregparm=3D3 -falign-j= umps=3D1 -falign-loops=3D1 -falign-functions=3D1 -freg-struct-return -mno-m= mx -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 -f= no-stack-protector -Wtrampolines -Werror -ffreestanding -MT lib/datetim= e_module-cmos_datetime.o -MD -MP -MF lib/.deps-core/datetime_module-cmos_da= tetime.Tpo -c -o lib/datetime_module-cmos_datetime.o `test -f 'lib/cmos_dat= etime.c' || echo './'`lib/cmos_datetime.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:98: Error: bad register name `%rax' > lib/i386/relocator64.S:132: Error: bad register name `%rip)' Interesting. Why doesn=E2=80=99t it happen when doing: guix build grub-minimal -s i686-linux ? That=E2=80=99s because =E2=80=98as=E2=80=99 supports =E2=80=98.code64=E2= =80=99 there? > I am not sure if and how to report this upstream. Ideas for a bug > description? Apparently, non-cross builds "just" work (how?!). The issue seems to be that =E2=80=98.code64=E2=80=99 is not supported by cr= oss assemblers to 32-bit Intel, right? Is this a defect of cross-as in general, or a misconfiguration in our Guix package? Or is this normal behavior that should be fixed in GRUB? Anyway, the patch LGTM! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 23 08:53:00 2020 Received: (at 41982) by debbugs.gnu.org; 23 Jun 2020 12:53:00 +0000 Received: from localhost ([127.0.0.1]:35672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jniQ7-0006oW-Ru for submit@debbugs.gnu.org; Tue, 23 Jun 2020 08:53:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jniQ4-0006oJ-Pd for 41982@debbugs.gnu.org; Tue, 23 Jun 2020 08:52:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60926) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jniPy-0006P9-CG; Tue, 23 Jun 2020 08:52:50 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=42704 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jniPx-0001fn-Q9; Tue, 23 Jun 2020 08:52:50 -0400 From: Jan Nieuwenhuizen To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#41982: [PATCH 0/1] gnu: grub: Cross-build fix for system i686-linux. Organization: AvatarAcademy.nl References: <87pn9sy14x.fsf@gnu.org> <87366m3zdt.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Tue, 23 Jun 2020 14:52:46 +0200 In-Reply-To: <87366m3zdt.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 23 Jun 2020 11:27:58 +0200") Message-ID: <87h7v2rlk1.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41982 Cc: 41982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ludovic Court=C3=A8s writes: Hello, > Jan Nieuwenhuizen skribis: > >> Attempting to reconfigure a i686-linux guix system to a Hurd system, I >> found that the Grub(-minimal) cross build fails like this >> >> i586-pc-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -Wall -W >> -DGRUB_MACHINE_PCBIOS=3D1 -DGRUB_MACHINE=3DI386_PC -m32 -nostdinc >> -isystem >> /gnu/store/5s0ldm31100d9ix15d1lmbsvi0aa77pq-gcc-cross-i586-pc-gnu-7.5.0-= lib/lib/gcc/i586-pc-gnu/7.5.0/include >> -I../include -I../include -DGRUB_FILE=3D\"lib/cmos_datetime.c\" [..] >> lib/.deps-core/datetime_module-cmos_datetime.Tpo -c -o >> lib/datetime_module-cmos_datetime.o `test -f 'lib/cmos_datetime.c' >> || echo './'`lib/cmos_datetime.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:98: Error: bad register name `%rax' >> lib/i386/relocator64.S:132: Error: bad register name `%rip)' > > Interesting. Why doesn=E2=80=99t it happen when doing: > > guix build grub-minimal -s i686-linux > > ? That=E2=80=99s because =E2=80=98as=E2=80=99 supports =E2=80=98.code64= =E2=80=99 there? Ah, that could be a switch! I imagined ".code64" was not supported, "just like" using 64-bit registers. >> I am not sure if and how to report this upstream. Ideas for a bug >> description? Apparently, non-cross builds "just" work (how?!). > > The issue seems to be that =E2=80=98.code64=E2=80=99 is not supported by = cross > assemblers to 32-bit Intel, right? That could be part of the problem, I don't know. I tested =E2=80=98.code64= =E2=80=99 on a 32-bit machine and get --8<---------------cut here---------------start------------->8--- gcc -c foo-64.S foo-64.S: Assembler messages: foo-64.S:23: Error: unknown pseudo-op: `.code64' foo-64.S:24: Error: bad register name `%rax' foo-64.S:48: Error: unknown pseudo-op: `.code64' foo-64.S:49: Error: bad register name `%rip)' --8<---------------cut here---------------end--------------->8--- so, I'm not sure what's the idea here. > Is this a defect of cross-as in general, or a misconfiguration in our > Guix package? Or is this normal behavior that should be fixed in GRUB? Good question. I will send the patch upstream (to Grub), maybe they can share some light on this? > Anyway, the patch LGTM! Pushed to master as cd6b0910dc471afb76677109625af0a42ce3056a Thanks! Janneke --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 23 08:57:14 2020 Received: (at 41982) by debbugs.gnu.org; 23 Jun 2020 12:57:15 +0000 Received: from localhost ([127.0.0.1]:35680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jniUE-0006ux-FQ for submit@debbugs.gnu.org; Tue, 23 Jun 2020 08:57:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jniUC-0006ul-BJ for 41982@debbugs.gnu.org; Tue, 23 Jun 2020 08:57:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60987) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jniU5-0000Sq-NC; Tue, 23 Jun 2020 08:57:05 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=42706 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jniU2-0002MA-MU; Tue, 23 Jun 2020 08:57:04 -0400 From: Jan Nieuwenhuizen To: bug-grub@gnu.org Subject: [PATCH] grub-core: Build fixes for i386 Organization: AvatarAcademy.nl X-Url: http://AvatarAcademy.nl Date: Tue, 23 Jun 2020 14:57:00 +0200 Message-ID: <87ftamrlcz.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41982 Cc: 41982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! When cross-compiling Grub-2.04 from i386-linux-gnu to i586-pc-hurd on GNU Guix, I got this error --8<---------------cut here---------------start------------->8--- i586-pc-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -Wall -W -DGRUB_MACHINE_PCBIOS= =3D1 -DGRUB_MACHINE=3DI386_PC -m32 -nostdinc -isystem /gnu/store/5s0ldm3110= 0d9ix15d1lmbsvi0aa77pq-gcc-cross-i586-pc-gnu-7.5.0-lib/lib/gcc/i586-pc-gnu/= 7.5.0/include -I../include -I../include -DGRUB_FILE=3D\"lib/cmos_datetime.c= \" -I. -I. -I.. -I.. -I../include -I../include -I../grub-core/lib/libgcrypt= -grub/src/ -D_FILE_OFFSET_BITS=3D64 -Os -Wall -W -Wshadow -Wpointer-arit= h -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-= optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-secur= ity -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int = -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparenthese= s -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigrap= hs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-par= ameter -Wunused-value -Wunused-variable -Wwrite-strings -Wnested-externs -= Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-decl= arations -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-regist= er-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing= -declarations -Wformat=3D2 -march=3Di386 -m32 -mrtd -mregparm=3D3 -falign-j= umps=3D1 -falign-loops=3D1 -falign-functions=3D1 -freg-struct-return -mno-m= mx -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 -f= no-stack-protector -Wtrampolines -Werror -ffreestanding -MT lib/datetim= e_module-cmos_datetime.o -MD -MP -MF lib/.deps-core/datetime_module-cmos_da= tetime.Tpo -c -o lib/datetime_module-cmos_datetime.o `test -f 'lib/cmos_dat= etime.c' || echo './'`lib/cmos_datetime.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:98: Error: bad register name `%rax' lib/i386/relocator64.S:132: Error: bad register name `%rip)' make[3]: *** [Makefile:32165: lib/i386/relocator_module-relocator64.o] Erro= r 1 make[3]: *** Waiting for unfinished jobs.... mv -f lib/i386/.deps-core/relocator_module-relocator_common_c.Tpo lib/i386/= .deps-core/relocator_module-relocator_common_c.Po mv -f lib/i386/.deps-core/relocator_module-relocator.Tpo lib/i386/.deps-cor= e/relocator_module-relocator.Po mv -f kern/.deps-core/elf_module-elf.Tpo kern/.deps-core/elf_module-elf.Po mv -f lib/.deps-core/datetime_module-cmos_datetime.Tpo lib/.deps-core/datet= ime_module-cmos_datetime.Po mv -f fs/.deps-core/xfs_module-xfs.Tpo fs/.deps-core/xfs_module-xfs.Po mv -f lib/.deps-core/crypto_module-crypto.Tpo lib/.deps-core/crypto_module-= crypto.Po mv -f lib/.deps-core/relocator_module-relocator.Tpo lib/.deps-core/relocato= r_module-relocator.Po make[3]: Leaving directory '/tmp/guix-build-grub-minimal-2.04.drv-0/grub-2.= 04/grub-core' make[2]: *** [Makefile:26403: all] Error 2 make[2]: Leaving directory '/tmp/guix-build-grub-minimal-2.04.drv-0/grub-2.= 04/grub-core' make[1]: *** [Makefile:11304: all-recursive] Error 1 make[1]: Leaving directory '/tmp/guix-build-grub-minimal-2.04.drv-0/grub-2.= 04' make: *** [Makefile:3343: all] Error 2 command "make" "-j" "8" failed with status 2 --8<---------------cut here---------------end--------------->8--- In Guix we are now using the patch attached, which seems to fix this for us. We are not entirely sure if this is the proper fix though, see . Paraphrasing the questions raised there: why does this seem to compile on i386? Is that because the non-cross 32-bit =E2=80=98as=E2=80=99 support= s =E2=80=98.code64=E2=80=99? Is the Guix's cross-assembler =E2=80=98i586-pc-gnu-as=E2=80=99 configured w= rong and should it support this? (FWIW, this is not specific for the Hurd, cross compiling from i686-linux-gnu to i686-linux-gnu show the same error. The use case for that may be a bit thin to warrant a bug report.) Ideas welcome! Greetings, Janneke --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-grub-core-Build-fixes-for-i386.patch Content-Transfer-Encoding: quoted-printable >From 270667540146f8ef9ea7a44258a71b3837a7af4a Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sun, 21 Jun 2020 15:10:40 +0200 Subject: [PATCH] grub-core: Build fixes for i386 * grub-core/lib/i386/relocator64.S: Avoid x86_64 instructions on i386. --- grub-core/lib/i386/relocator64.S | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/grub-core/lib/i386/relocator64.S b/grub-core/lib/i386/relocato= r64.S index 148f38adb..45fed9444 100644 --- a/grub-core/lib/i386/relocator64.S +++ b/grub-core/lib/i386/relocator64.S @@ -63,7 +63,9 @@ VARIABLE(grub_relocator64_cr3) movq %rax, %cr3 #endif =20 +#ifdef __x86_64__ .code64 +#endif =20 /* mov imm64, %rax */ .byte 0x48 @@ -71,7 +73,14 @@ VARIABLE(grub_relocator64_cr3) VARIABLE(grub_relocator64_rsp) .quad 0 =20 +#ifndef __x86_64__ + /* movq %rax, %rsp */ + .byte 0x48 + .byte 0x89 + .byte 0xc4 +#else movq %rax, %rsp +#endif =20 #ifdef GRUB_MACHINE_EFI jmp LOCAL(skip_efi_stack_align) @@ -95,8 +104,15 @@ LOCAL(skip_efi_stack_align): VARIABLE(grub_relocator64_rsi) .quad 0 =20 +#ifndef __x86_64__ + /* movq %rax, %rsi */ + .byte 0x48 + .byte 0x89 + .byte 0xc6 +#else movq %rax, %rsi -=09 +#endif + /* mov imm64, %rax */ .byte 0x48 .byte 0xb8 @@ -128,6 +144,14 @@ VARIABLE(grub_relocator64_rdx) #ifdef __APPLE__ .byte 0xff, 0x25 .quad 0 +#elif !defined (__x86_64__) + /* jmp *LOCAL(jump_addr) (%rip) */ + .byte 0xff + .byte 0x25 + .byte 0 + .byte 0 + .byte 0 + .byte 0 #else jmp *LOCAL(jump_addr) (%rip) #endif --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 23 11:54:54 2020 Received: (at 41982) by debbugs.gnu.org; 23 Jun 2020 15:54:54 +0000 Received: from localhost ([127.0.0.1]:36991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jnlG9-0007Hk-VW for submit@debbugs.gnu.org; Tue, 23 Jun 2020 11:54:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jnlG7-0007HY-QK for 41982@debbugs.gnu.org; Tue, 23 Jun 2020 11:54:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35788) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnlG1-00086O-O1; Tue, 23 Jun 2020 11:54:45 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57534 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jnlG1-0006OC-8n; Tue, 23 Jun 2020 11:54:45 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Jan Nieuwenhuizen Subject: Re: bug#41982: [PATCH 0/1] gnu: grub: Cross-build fix for system i686-linux. References: <87pn9sy14x.fsf@gnu.org> <87366m3zdt.fsf@gnu.org> <87h7v2rlk1.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 Messidor an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 23 Jun 2020 17:54:43 +0200 In-Reply-To: <87h7v2rlk1.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Tue, 23 Jun 2020 14:52:46 +0200") Message-ID: <87lfkdzsjg.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41982 Cc: 41982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Jan Nieuwenhuizen skribis: > Ludovic Court=C3=A8s writes: > > Hello, > >> Jan Nieuwenhuizen skribis: >> >>> Attempting to reconfigure a i686-linux guix system to a Hurd system, I >>> found that the Grub(-minimal) cross build fails like this >>> >>> i586-pc-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -Wall -W >>> -DGRUB_MACHINE_PCBIOS=3D1 -DGRUB_MACHINE=3DI386_PC -m32 -nostdinc >>> -isystem >>> /gnu/store/5s0ldm31100d9ix15d1lmbsvi0aa77pq-gcc-cross-i586-pc-gnu-7.5.0= -lib/lib/gcc/i586-pc-gnu/7.5.0/include >>> -I../include -I../include -DGRUB_FILE=3D\"lib/cmos_datetime.c\" > > [..] >>> lib/.deps-core/datetime_module-cmos_datetime.Tpo -c -o >>> lib/datetime_module-cmos_datetime.o `test -f 'lib/cmos_datetime.c' >>> || echo './'`lib/cmos_datetime.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:98: Error: bad register name `%rax' >>> lib/i386/relocator64.S:132: Error: bad register name `%rip)' >> >> Interesting. Why doesn=E2=80=99t it happen when doing: >> >> guix build grub-minimal -s i686-linux >> >> ? That=E2=80=99s because =E2=80=98as=E2=80=99 supports =E2=80=98.code64= =E2=80=99 there? > > Ah, that could be a switch! I imagined ".code64" was not supported, > "just like" using 64-bit registers. Yeah I didn=E2=80=99t know about the existence of such a thing but the manu= al has it (info "(as) i386-16bit"). > Pushed to master as cd6b0910dc471afb76677109625af0a42ce3056a Cool, thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 25 11:52:22 2020 Received: (at 41982-done) by debbugs.gnu.org; 25 Jun 2020 15:52:22 +0000 Received: from localhost ([127.0.0.1]:40943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1joUAo-0002OJ-HH for submit@debbugs.gnu.org; Thu, 25 Jun 2020 11:52:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1joUAl-0002O3-N9 for 41982-done@debbugs.gnu.org; Thu, 25 Jun 2020 11:52:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41032) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joUAe-00046u-T6; Thu, 25 Jun 2020 11:52:12 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=45918 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1joUAe-0002b3-EH; Thu, 25 Jun 2020 11:52:12 -0400 From: Jan Nieuwenhuizen To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#41982: [PATCH 0/1] gnu: grub: Cross-build fix for system i686-linux. Organization: AvatarAcademy.nl References: <87pn9sy14x.fsf@gnu.org> <87366m3zdt.fsf@gnu.org> <87h7v2rlk1.fsf@gnu.org> <87lfkdzsjg.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Thu, 25 Jun 2020 17:52:10 +0200 In-Reply-To: <87lfkdzsjg.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 23 Jun 2020 17:54:43 +0200") Message-ID: <87mu4rgn2t.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41982-done Cc: 41982-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ludovic Court=C3=A8s writes: Hello, >> Pushed to master as cd6b0910dc471afb76677109625af0a42ce3056a > > Cool, thanks! Well, preparing a new patch I found the commit above didn't make it to master yet, I'm puzzled. I'm pretty sure that I send this mail after (I believe that) the push was successful. A new attempt: pushed to master as d613991a8ebe5d4b3a7706f8f0dd52f16fc1c50a And closing (forgot that too). Greetings, Janneke --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 08 13:29:43 2020 Received: (at 41982) by debbugs.gnu.org; 8 Jul 2020 17:29:43 +0000 Received: from localhost ([127.0.0.1]:39006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jtDt9-0001Ix-3f for submit@debbugs.gnu.org; Wed, 08 Jul 2020 13:29:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jtDt7-0001Ii-AC for 41982@debbugs.gnu.org; Wed, 08 Jul 2020 13:29:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40366) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtDt1-0005SV-B1; Wed, 08 Jul 2020 13:29:35 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=40300 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jtDsz-0004jP-M9; Wed, 08 Jul 2020 13:29:34 -0400 From: Jan Nieuwenhuizen To: bug-grub@gnu.org Subject: [PATCH v2] grub-core: Build fixes for i386 Organization: AvatarAcademy.nl References: <87ftamrlcz.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Wed, 08 Jul 2020 19:29:31 +0200 In-Reply-To: <87ftamrlcz.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Tue, 23 Jun 2020 14:57:00 +0200") Message-ID: <87imexncec.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41982 Cc: 41982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Jan Nieuwenhuizen writes: Hello! > When cross-compiling Grub-2.04 from i386-linux-gnu to i586-pc-hurd on > GNU Guix, I got this error Today, we found* that my patch introduced a regression: a native, EFI build on i686-linux-gnu failed with lib/i386/relocator64.S:97: Error: bad register name `%rsp' The attached v2 fixes that. Greetings, Janneke *) http://logs.guix.gnu.org/guix/2020-07-08.log#104852 --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=v2-0001-grub-core-Build-fixes-for-i386.patch Content-Transfer-Encoding: quoted-printable >From 17b242e7b80108f1467037e15b605595e4823b2e Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sun, 21 Jun 2020 15:10:40 +0200 Subject: [PATCH v2] grub-core: Build fixes for i386 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=3DUTF-8 * grub-core/lib/i386/relocator64.S: Avoid x86_64 instructions on i386. --- grub-core/lib/i386/relocator64.S | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/grub-core/lib/i386/relocator64.S b/grub-core/lib/i386/relocato= r64.S index 148f38adb..ea39908c1 100644 --- a/grub-core/lib/i386/relocator64.S +++ b/grub-core/lib/i386/relocator64.S @@ -63,7 +63,9 @@ VARIABLE(grub_relocator64_cr3) movq %rax, %cr3 #endif =20 +#ifdef __x86_64__ .code64 +#endif =20 /* mov imm64, %rax */ .byte 0x48 @@ -71,7 +73,14 @@ VARIABLE(grub_relocator64_cr3) VARIABLE(grub_relocator64_rsp) .quad 0 =20 +#ifndef __x86_64__ + /* movq %rax, %rsp */ + .byte 0x48 + .byte 0x89 + .byte 0xc4 +#else movq %rax, %rsp +#endif =20 #ifdef GRUB_MACHINE_EFI jmp LOCAL(skip_efi_stack_align) @@ -85,7 +94,14 @@ VARIABLE(grub_relocator64_rsp) */ VARIABLE(grub_relocator64_efi_start) /* Align the stack as UEFI spec requires. */ +#ifndef __x86_64__ + .byte 0x48 + .byte 0x83 + .byte 0xe4 + .byte 0xf0 +#else andq $~15, %rsp +#endif =20 LOCAL(skip_efi_stack_align): #endif @@ -95,8 +111,15 @@ LOCAL(skip_efi_stack_align): VARIABLE(grub_relocator64_rsi) .quad 0 =20 +#ifndef __x86_64__ + /* movq %rax, %rsi */ + .byte 0x48 + .byte 0x89 + .byte 0xc6 +#else movq %rax, %rsi -=09 +#endif + /* mov imm64, %rax */ .byte 0x48 .byte 0xb8 @@ -128,6 +151,14 @@ VARIABLE(grub_relocator64_rdx) #ifdef __APPLE__ .byte 0xff, 0x25 .quad 0 +#elif !defined (__x86_64__) + /* jmp *LOCAL(jump_addr) (%rip) */ + .byte 0xff + .byte 0x25 + .byte 0 + .byte 0 + .byte 0 + .byte 0 #else jmp *LOCAL(jump_addr) (%rip) #endif --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 13 09:51:39 2020 Received: (at 41982) by debbugs.gnu.org; 13 Jul 2020 13:51:39 +0000 Received: from localhost ([127.0.0.1]:47817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1juyrq-00084n-UC for submit@debbugs.gnu.org; Mon, 13 Jul 2020 09:51:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1juyrp-00084a-0Z for 41982@debbugs.gnu.org; Mon, 13 Jul 2020 09:51:37 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36147) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1juyrj-0003on-N6; Mon, 13 Jul 2020 09:51:31 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=34790 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1juyrj-0003Ti-2q; Mon, 13 Jul 2020 09:51:31 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Jan Nieuwenhuizen Subject: Re: bug#41982: [PATCH v2] grub-core: Build fixes for i386 References: <87ftamrlcz.fsf@gnu.org> <87imexncec.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 26 Messidor an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 13 Jul 2020 15:51:29 +0200 In-Reply-To: <87imexncec.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Wed, 08 Jul 2020 19:29:31 +0200") Message-ID: <87r1tfplpa.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41982 Cc: bug-grub@gnu.org, 41982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! Jan Nieuwenhuizen skribis: > Jan Nieuwenhuizen writes: > > Hello! > >> When cross-compiling Grub-2.04 from i386-linux-gnu to i586-pc-hurd on >> GNU Guix, I got this error > > Today, we found* that my patch introduced a regression: a native, EFI > build on i686-linux-gnu failed with > > lib/i386/relocator64.S:97: Error: bad register name `%rsp' > > The attached v2 fixes that. On the Guix side I guess you can go ahead and apply it. Well done! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 13 10:03:25 2020 Received: (at 41982) by debbugs.gnu.org; 13 Jul 2020 14:03:25 +0000 Received: from localhost ([127.0.0.1]:48959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1juz3E-0000Bx-9i for submit@debbugs.gnu.org; Mon, 13 Jul 2020 10:03:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1juz39-0000Bh-CY for 41982@debbugs.gnu.org; Mon, 13 Jul 2020 10:03:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36309) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1juz33-0005MD-AV; Mon, 13 Jul 2020 10:03:13 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=38256 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1juz32-0005QR-Om; Mon, 13 Jul 2020 10:03:13 -0400 From: Jan Nieuwenhuizen To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#41982: [PATCH v2] grub-core: Build fixes for i386 Organization: AvatarAcademy.nl References: <87ftamrlcz.fsf@gnu.org> <87imexncec.fsf@gnu.org> <87r1tfplpa.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Mon, 13 Jul 2020 16:03:09 +0200 In-Reply-To: <87r1tfplpa.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 13 Jul 2020 15:51:29 +0200") Message-ID: <87pn8zms0y.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41982 Cc: bug-grub@gnu.org, 41982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ludovic Court=C3=A8s writes: Hi! > Jan Nieuwenhuizen skribis: > >> Jan Nieuwenhuizen writes: >> >> lib/i386/relocator64.S:97: Error: bad register name `%rsp' >> >> The attached v2 fixes that. > > On the Guix side I guess you can go ahead and apply it. > > Well done! Thanks! Ah, I already done in 54e70a70f2cb6336b02ed3ac4256f6b44da5c769 after discussing with Mathieu on IRC. I wanted to keep a line to upstream, being cautious for continuing to carry a diff here. Janneke --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com From unknown Sat Jun 14 14:25:46 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 11 Aug 2020 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator