unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Ricardo Wurmus <rekado@elephly.net>
Cc: guix-devel@gnu.org, bootstrappable@freelists.org
Subject: Re: [bootstrappable] diverse double compilation: using $ORIGIN?
Date: Sun, 05 Nov 2017 17:11:22 +0100	[thread overview]
Message-ID: <87375sr9hx.fsf@gnu.org> (raw)
In-Reply-To: <87wp3agd60.fsf@elephly.net> (Ricardo Wurmus's message of "Wed, 01 Nov 2017 17:46:15 +0100")

Hello!

Ricardo Wurmus <rekado@elephly.net> skribis:

> 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.

Assuming we can add a phase to replace absolute file names in RUNPATH &
co. with $ORIGIN references where applicable (should be doable), we
still have a problem with multiple-output derivations: we’d still have
the hash of the other outputs.

I’m not sure how to avoid that.

When the goal is just to compare things, we could build static
binaries.  Or we could have a comparison tool that compares modulo file
names or something…

Thoughts?

Ludo’.

  parent reply	other threads:[~2017-11-05 16:11 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 ` Fwd: " Ricardo Wurmus
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 [this message]
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=87375sr9hx.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=bootstrappable@freelists.org \
    --cc=guix-devel@gnu.org \
    --cc=rekado@elephly.net \
    /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).