Skip to content

Avoid recording -fdebug-prefix-map= from CFLAGS and CPPFLAGS

Daniel Kahn Gillmor requested to merge dkg/knot-dns:clean-cached-cflags into master

It's not particularly useful to record -fdebug-prefix-map= and friends in the list of used CFLAGS arguments. Additionally, since these compiler arguments are typically used to make reproducible binary artifacts by stripping out information about the ephemeral build path used, embedding them in the resulting binary actually re-introduces the reproducibility problem.

Note that gcc itself omits these values from the DWARF information that it generates:

https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/dwarf2out.c;h=1b17f2bc1d5eef3d3ef70abf92a4d09da285d2b8;hb=HEAD#l24396

You can see the reproducibility issue here:

https://tests.reproducible-builds.org/debian/dbd/unstable/amd64/knot_2.7.6-2.diffoscope.html

Edited by Daniel Kahn Gillmor

Merge request reports