unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 41982@debbugs.gnu.org
Subject: bug#41982: [PATCH 0/1] gnu: grub: Cross-build fix for system i686-linux.
Date: Tue, 23 Jun 2020 14:52:46 +0200	[thread overview]
Message-ID: <87h7v2rlk1.fsf@gnu.org> (raw)
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")

Ludovic Courtès writes:

Hello,

> Jan Nieuwenhuizen <janneke@gnu.org> 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=1 -DGRUB_MACHINE=I386_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=\"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’t it happen when doing:
>
>   guix build grub-minimal -s i686-linux
>
> ?  That’s because ‘as’ supports ‘.code64’ 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 ‘.code64’ is not supported by cross
> assemblers to 32-bit Intel, right?

That could be part of the problem, I don't know.  I tested ‘.code64’ 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

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




  reply	other threads:[~2020-06-23 12:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-21 13:55 bug#41982: [PATCH 0/1] gnu: grub: Cross-build fix for system i686-linux Jan Nieuwenhuizen
2020-06-21 13:59 ` bug#41982: [PATCH 1/1] " Jan (janneke) Nieuwenhuizen
2020-06-23  9:27 ` bug#41982: [PATCH 0/1] " Ludovic Courtès
2020-06-23 12:52   ` Jan Nieuwenhuizen [this message]
2020-06-23 15:54     ` Ludovic Courtès
2020-06-25 15:52       ` Jan Nieuwenhuizen
2020-06-23 12:57 ` bug#41982: [PATCH] grub-core: Build fixes for i386 Jan Nieuwenhuizen
2020-07-08 17:29   ` bug#41982: [PATCH v2] " Jan Nieuwenhuizen
2020-07-13 13:51     ` Ludovic Courtès
2020-07-13 14:03       ` Jan Nieuwenhuizen

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=87h7v2rlk1.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=41982@debbugs.gnu.org \
    --cc=ludo@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).