[Reproducible-builds] Bug#819176: gcc-5: Please avoid storing -fdebug-prefix-map in DW_AT_producer (for better reproducibility)
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Thu Mar 24 14:22:33 UTC 2016
Package: gcc-5
Version: 5.3.1-12
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: buildpath
embedding the build path in binaries makes it harder to get
byte-for-byte reproducibility, because the build has to happen in the
same directory.
gcc by default embeds the build path in the debug info of C tools
(e.g. DW_AT_comp_dir and DW_AT_decl_file). This isn't useful for
distributed binary packages, because the build environment isn't on
the same machine (or necessarily in the same place).
The build path can be mangled/stripped with gcc's -fdebug-prefix-map
argument. For example:
gcc -fdebug-prefix-map=$(pwd)=. -g -o foo foo.c
however, when supplying -fdebug-prefix-map, gcc puts that string
itself into DW_AT_producer.
The attached patch (pulled from upstream gcc master) avoids storing
-fdebug-prefix-map in DW_AT_producer.
I'd like this to be backported into debian's gcc so that we can make
and test a more reproducible toolchain.
(thinking about timing: we shouldn't need the patch once we move to
gcc 6, but we should be testing a buildpath-independent reproducible
toolchain now; i'll file a bug soon to add this pattern to either dh
or dpkg-buildflags)
Regards,
--dkg
-- System Information:
Debian Release: stretch/sid
Architecture: amd64 (x86_64)
Kernel: Linux 4.4.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages gcc-5 depends on:
ii binutils 2.26-5
ii cpp-5 5.3.1-12
ii gcc-5-base 5.3.1-12
ii libc6 2.22-3
ii libcc1-0 5.3.1-12
ii libgcc-5-dev 5.3.1-12
ii libgcc1 1:5.3.1-12
ii libgmp10 2:6.1.0+dfsg-2
ii libisl15 0.16.1-1
ii libmpc3 1.0.3-1
ii libmpfr4 3.1.4-1
ii libstdc++6 5.3.1-12
ii zlib1g 1:1.2.8.dfsg-2+b1
Versions of packages gcc-5 recommends:
ii libc6-dev 2.22-3
Versions of packages gcc-5 suggests:
pn gcc-5-doc <none>
pn gcc-5-locales <none>
ii gcc-5-multilib 5.3.1-12
pn libasan2-dbg <none>
pn libatomic1-dbg <none>
pn libcilkrts5-dbg <none>
pn libgcc1-dbg <none>
pn libgomp1-dbg <none>
pn libitm1-dbg <none>
pn liblsan0-dbg <none>
pn libmpx0-dbg <none>
pn libquadmath0-dbg <none>
pn libtsan0-dbg <none>
pn libubsan0-dbg <none>
-- debconf-show failed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch
Type: text/x-diff
Size: 2686 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20160324/78a24297/attachment.patch>
More information about the Reproducible-builds
mailing list