This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/66305] -ffat-lto-objects create unreproducible objects
- From: "lunar at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 27 May 2015 18:24:22 +0000
- Subject: [Bug lto/66305] -ffat-lto-objects create unreproducible objects
- Auto-submitted: auto-generated
- References: <bug-66305-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66305
--- Comment #3 from lunar at debian dot org ---
Richard Biener:
> I think they become deterministic with -frandom-seed=0 for example.
> They are not deterministic to support partial linking of LTO objects as far
> as I know.
They are indeed reproducible with `-frandom-seed=0`. But I guess there's a
downside to that, right?
Andi:
> In theory it would be possible to use the hash of the full output path name or
> similar, which would be a bit more deterministic, but there are still
> ways this could break (e.g. if someone copies object files around)
Would using a hash over the section content work? In any cases, in the context
of Debian (this applies for FreeBSD as well), we have a canonical build path
so it would probably be fine to use it as the source of the hash.
I guess one could already do this without further help by giving the
build path to `-frandom-seed=`. This only would need some Makefile trickery.
> How about your "deterministic build" tools just learn to ignore that
> suffix?
I am not sure I understand what you are talking about. We want to get
byte-for-byte identical packages on each build (provided the same software
versions are used), so we need a given version of GCC to always produce the
same output.