guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bootstrappable] diverse double compilation: using $ORIGIN?


From: Ludovic Courtès
Subject: Re: [bootstrappable] diverse double compilation: using $ORIGIN?
Date: Sun, 05 Nov 2017 17:11:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello!

Ricardo Wurmus <address@hidden> 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’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]