unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: guix-devel@gnu.org
Subject: Fwd: diverse double compilation: using $ORIGIN?
Date: Thu, 02 Nov 2017 09:41:07 +0100	[thread overview]
Message-ID: <87r2thgjj0.fsf@elephly.net> (raw)
In-Reply-To: 87wp3agd60.fsf@elephly.net

[resending to guix-devel@gnu.org because of mail problems / delays]

Hi Guix,
hi bootstrappers!

When building packages, Guix embeds the absolute file name of the output
directory in the resulting binary.  That’s usually fine and what we
want.

Now let’s assume that we’d like to build the GCC sources with diverse
double compilation: we’d have a “gcc” package that’s built with
“gcc-core”; we’d also have a “gcc-from-clang” package that uses Clang as
its input.  Since the GCC build procedure is performed at least two
times (once with the bootstrap compiler, and then again with the GCC
variant this produces), the resulting GCC binaries should be identical.

Except that they are not.  One of the reasons is that the binaries that
Guix produces embed the target output directories.  This means that the
two compiler binaries that result from diverse double compilation will
*always* differ in at least the embedded paths, such as paths to itself
(e.g. to binaries in the libexec directory) and paths to.

I wonder if we can use $ORIGIN in the compiler binaries, so that we can
avoid (most) references to the output directories, thereby making the
equality check between the diversely built compiler binaries simpler.

Is this at all possible?  Or do we need to accept that the equality
check for diverse double compilation for binaries built with Guix must
be aware of /gnu/store references and ignore those?

Alternatively, could we move all of these store references into a
wrapper script that would tell the binary about them via environment
variables?  The equality check would only need to exclude the wrapper
script then and compare the two sets of compiler binaries naively.

Does this make any sense?

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

  reply	other threads:[~2017-11-02  8:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 16:46 diverse double compilation: using $ORIGIN? Ricardo Wurmus
2017-11-02  8:41 ` Ricardo Wurmus [this message]
2017-11-02  8:46 ` [bootstrappable] " Jan Nieuwenhuizen
2017-11-05 16:09   ` Ludovic Courtès
2017-11-05 16:27     ` Jan Nieuwenhuizen
2017-11-10 19:19       ` Jan Nieuwenhuizen
2017-11-05 16:11 ` Ludovic Courtès
2017-11-10  4:53 ` Chris Marusich
2017-11-11 21:56   ` 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=87r2thgjj0.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=guix-devel@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).