From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1llv5i-00013I-Eo for mharc-grub-devel@gnu.org; Wed, 26 May 2021 11:05:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llv5g-000133-S3 for grub-devel@gnu.org; Wed, 26 May 2021 11:05:01 -0400 Received: from dibed.net-space.pl ([84.10.22.86]:55331) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_3DES_EDE_CBC_SHA1:192) (Exim 4.90_1) (envelope-from ) id 1llv5e-0004mu-Ll; Wed, 26 May 2021 11:05:00 -0400 Received: from router-fw.i.net-space.pl ([192.168.52.1]:37128 "EHLO tomti.i.net-space.pl") by router-fw-old.i.net-space.pl with ESMTP id S2101231AbhEZPEw (ORCPT + 1 other); Wed, 26 May 2021 17:04:52 +0200 X-Comment: RFC 2476 MSA function at dibed.net-space.pl logged sender identity as: dkiper Date: Wed, 26 May 2021 17:04:48 +0200 From: Daniel Kiper To: "Jan (janneke) Nieuwenhuizen" Cc: grub-devel@gnu.org Subject: Re: [PATCH v2] grub-core: Build fixes for i386 Message-ID: <20210526150448.2xqk6k2vpmxovgi6@tomti.i.net-space.pl> References: <20210518104733.23391-1-janneke@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210518104733.23391-1-janneke@gnu.org> User-Agent: NeoMutt/20170113 (1.7.2) Received-SPF: pass client-ip=84.10.22.86; envelope-from=dkiper@net-space.pl; helo=dibed.net-space.pl X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2021 15:05:01 -0000 Mostly nits... Please take a look below... On Tue, May 18, 2021 at 12:47:33PM +0200, Jan (janneke) Nieuwenhuizen wrote: > This fixes cross-compiling to x86 (e.g., the Hurd) from x86-linux. > > To reproduce, update the Grub source description in your local Guix s/Grub/GRUB/ > archive and run > > ./pre-inst-env guix build --system=i686-linux --target=i586-pc-gnu grub > > or install an x86 cross-build environment on x86-linux (32bit!) and s/32bit/32-bit/ > configure to cross build and make, e.g., do something like > > ./configure \ > CC_FOR_BUILD=gcc \ > --build=i686-unknown-linux-gnu Missing "\" at the end of the line... > --host=i586-pc-gnu > make > > * grub-core/lib/i386/relocator64.S: Avoid x86_64 instructions on i386. Hmmm... What is this? And you should add your SOB at the end of commit message: Signed-off-by: Jan (janneke) Nieuwenhuizen > --- > grub-core/lib/i386/relocator64.S | 27 +++++++++++++++++++++++++-- > 1 file changed, 25 insertions(+), 2 deletions(-) > > diff --git a/grub-core/lib/i386/relocator64.S b/grub-core/lib/i386/relocator64.S > index 148f38adb..b4675dd16 100644 > --- a/grub-core/lib/i386/relocator64.S > +++ b/grub-core/lib/i386/relocator64.S > @@ -63,8 +63,10 @@ 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 > > +#ifdef __x86_64__ > movq %rax, %rsp > +#else > + /* movq %rax, %rsp */ > + .byte 0x48 > + .byte 0x89 > + .byte 0xc4 > +#endif > > #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. */ > +#ifdef __x86_64__ > andq $~15, %rsp > +#else > + .byte 0x48 > + .byte 0x83 > + .byte 0xe4 > + .byte 0xf0 Formatting is broken here... > +#endif > > LOCAL(skip_efi_stack_align): > #endif > @@ -95,8 +111,15 @@ LOCAL(skip_efi_stack_align): > VARIABLE(grub_relocator64_rsi) > .quad 0 > > +#ifdef __x86_64__ > movq %rax, %rsi > - This and... > +#else > + /* movq %rax, %rsi */ > + .byte 0x48 > + .byte 0x89 > + .byte 0xc6 > +#endif > + ... this change look strange. Could you fix it? Or explain in the commit message you are doing a cleanup by the way... Daniel