https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66305

            Bug ID: 66305
           Summary: -ffat-lto-objects create unreproducible objects
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lunar at debian dot org
  Target Milestone: ---

Hi!

We are working in Debian—and I know other free software projects
care—in providing our users with a way to reproduce bit-for-bit
identical binary packages from the source and build enviroment.
See <https://wiki.debian.org/ReproducibleBuilds> for more information.

Python packages in Debian are built with `-flto -ffat-lto-objects`
on architectures that support it. Sadly, this makes the resulting
binary unreproducible.

For a trivial test case:

$ cat a.c
int a(void) {
        return 42;
}
$ gcc -flto -ffat-lto-objects -c a.c
$ strings a.o | grep lto_
.gnu.lto_.inline.4980dca9e6ae4d45
.gnu.lto_a.4980dca9e6ae4d45
.gnu.lto_.symbol_nodes.4980dca9e6ae4d45
.gnu.lto_.refs.4980dca9e6ae4d45
.gnu.lto_.decls.4980dca9e6ae4d45
.gnu.lto_.symtab.4980dca9e6ae4d45
.gnu.lto_.opts
__gnu_lto_v1
$ gcc -flto -ffat-lto-objects -c a.c
$ strings a.o | grep lto_
.gnu.lto_.inline.24c30dabb443e726
.gnu.lto_a.24c30dabb443e726
.gnu.lto_.symbol_nodes.24c30dabb443e726
.gnu.lto_.refs.24c30dabb443e726
.gnu.lto_.decls.24c30dabb443e726
.gnu.lto_.symtab.24c30dabb443e726
.gnu.lto_.opts
__gnu_lto_v1

Would it be possible to make the section names deterministic?

Reply via email to