RFC: dpkg patch to using -ffile-prefix-map

Vagrant Cascadian vagrant at debian.org
Tue Jul 31 01:29:33 BST 2018


With gcc 8 being the default compiler in debian now, we should be able
to use -ffile-prefix-map, which should handle *some* of the cases that
BUILD_PATH_PREFIX_MAP is intended to solve. It definitely won't help
with things that embed the gcc commandline into arguments.

But since we've been unable to convince gcc on the merits of
BUILD_PATH_PREFIX_MAP using an environment variable, rebasing the gcc
patches to support it takes a lot of effort, perhaps we should explore
other options.

I've got a dpkg patch which makes use of -ffile-prefix-map. I haven't
found a good test case yet... package that fails to build reproducibly
due to using __FILE__, __BASE_FILE__, or __builtin_FILE() and builds
fast enough that it's easy to test (holger suggested trying "dtkwm", but
I haven't had a chance to try yet). Figured I'd at least publish my
patch to get some review and/or testers.

The patch largely just copy-and-pastes the -fdebug-prefix-map code,
though arguably could obsolete it entirely, since -ffile-prefix-map
effectivly sets both -fdebug-prefix-map and -fmacro-prefix-map. But
having the two features independently allows enabling or disabling one
or the other easily for now.

If nothing else, carrying a patch on dpkg builds *much* faster than gcc,
and rebasing it periodically will be a lot less effort. Though if it
works, hopefully we can get it into dpkg directly.

Thanks!


live well,
  vagrant

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dpkg-ffile-prefix-map.patch
Type: text/x-diff
Size: 2162 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/reproducible-builds/attachments/20180731/ecc76add/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/reproducible-builds/attachments/20180731/ecc76add/attachment.sig>


More information about the Reproducible-builds mailing list