[Reproducible-builds] Bug#819194: dpkg-buildflags: please add normalizedebugpath to reproducible feature set

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Mar 24 17:40:00 UTC 2016


Package: dpkg-dev
Version: 1.18.4
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: buildpath

Compilers tend to inject the current path of the filesystem into the
debug symbols, so that the debugger can find the sourcecode.  But this
isn't actually useful for packages shipped as binaries, because the
path on the build machine isn't relevant on the deployed machine.

It also causes problems for reproducible builds, because the same
source built in two different locations in the filesystem will result
in two different sets of debug symbols.

With gcc (and soon clang, see #819185), you can re-map the path stored
in the debug symbols with -fdebug-prefix-map, so it can be used to
normalize the paths stored in the debug symbols.

The attached patch adds a "normalizedebugpath" feature to the
"reproducible" feature set, which appends -fdebug-prefix-map=CWD=.
(where CWD is the actual current working directory) to CFLAGS and
CXXFLAGS.  It is off by default.

Regards,

        --dkg

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing'), (200, 'unstable'), (1, 'experimental-debug'), (1, 'experimental')
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 dpkg-dev depends on:
ii  base-files    9.6
ii  binutils      2.26-5
ii  bzip2         1.0.6-8
ii  libdpkg-perl  1.18.4
ii  make          4.1-9
ii  patch         2.7.5-1
ii  xz-utils      5.1.1alpha+20120614-2.1

Versions of packages dpkg-dev recommends:
ii  build-essential          11.7
ii  clang-3.5 [c-compiler]   1:3.5.2-3
ii  clang-3.6 [c-compiler]   1:3.6.2-3
ii  clang-3.7 [c-compiler]   1:3.7.1-2
ii  fakeroot                 1.20.2-1
ii  gcc [c-compiler]         4:5.3.1-1
ii  gcc-5 [c-compiler]       5.3.1-12
ii  gnupg                    1.4.20-4
ii  gnupg2                   2.1.11-6
ii  gpgv                     1.4.20-4
ii  gpgv2                    2.1.11-6
pn  libalgorithm-merge-perl  <none>
ii  tcc [c-compiler]         0.9.27~git20151227.933c223-1

Versions of packages dpkg-dev suggests:
ii  debian-keyring  2016.03.22

-- debconf-show failed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-add-normalizedebugpath-to-reproducible-featureset.patch
Type: text/x-diff
Size: 2541 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20160324/97f5c5ba/attachment.patch>


More information about the Reproducible-builds mailing list