From: Jan Nieuwenhuizen <janneke@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 43668@debbugs.gnu.org
Subject: bug#43668: Daemon tries to build GNU/Hurd derivations on GNU/Linux
Date: Mon, 28 Sep 2020 13:11:09 +0200 [thread overview]
Message-ID: <87lfgurwaa.fsf@gnu.org> (raw)
In-Reply-To: <875z7ychvp.fsf@gnu.org> ("Ludovic Courtès"'s message of "Mon, 28 Sep 2020 12:31:22 +0200")
Ludovic Courtès writes:
Hi!
> Ludovic Courtès <ludo@gnu.org> skribis:
>
>> It’s no wonder that the GNU/Hurd executable fails to run on GNU/Linux.
>> The reason the daemon tries to run it anyway is because of the hack
>> introduced in 7bf2a70a4ffd976d50638d3b9f2ec409763157df, in support of
>> transparent emulation via binfmt_misc.
>
> The thing is that x86 GNU/Hurd and GNU/Linux ELF binaries are
> indistinguishable AFAICS since they both use ELFOSABI_NONE:
>
> scheme@(guile-user)> ,use(guix elf)
> scheme@(guile-user)> ,use(rnrs io ports)
> scheme@(guile-user)> (define e (parse-elf (call-with-input-file "/gnu/store/vq7zyb4hmlrafflmrcjbqccxp4dsx0s3-bash" get-bytevector-all)))
> scheme@(guile-user)> (elf-abi e)
> $6 = 0
> scheme@(guile-user)> ELFOSABI_GNU
> $7 = 3
> scheme@(guile-user)> (define e2 (parse-elf (call-with-input-file "/bin/sh" get-bytevector-all)))
> scheme@(guile-user)> (elf-abi e2)
> $8 = 0
>
> (The ‘file’ command does manage to recognize GNU/Hurd binaries, but I
> don’t know how it does it.)
Looking at the file sources, it uses do_os_note, look:
--8<---------------cut here---------------start------------->8---
$ readelf -a $(guix build --target=i586-pc-gnu hello)bin/hello
Displaying notes found in: .note.ABI-tag
Owner Data size Description
GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag)
OS: Hurd, ABI: 0.0.0
--8<---------------cut here---------------end--------------->8---
> So I think we can’t count on an ‘execve’ error and thus have to treat
> this case (same architecture but different OS kernel) specially, as
> shown below.
>
> Thoughts?
If that really doesn't work...then yeah (yuck ;-)
Greetigs,
Janneke
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
next prev parent reply other threads:[~2020-09-28 11:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-28 8:43 bug#43668: Daemon tries to build GNU/Hurd derivations on GNU/Linux Ludovic Courtès
2020-09-28 10:31 ` Ludovic Courtès
2020-09-28 11:11 ` Jan Nieuwenhuizen [this message]
2020-09-28 20:45 ` Ludovic Courtès
2020-09-29 11:55 ` Jan Nieuwenhuizen
2020-10-01 10:51 ` Ludovic Courtès
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=87lfgurwaa.fsf@gnu.org \
--to=janneke@gnu.org \
--cc=43668@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).