Commit 804f29a6 authored by Daniel Kahn Gillmor's avatar Daniel Kahn Gillmor

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

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
parent f66d0076
......@@ -646,11 +646,14 @@ AM_CONDITIONAL([HAVE_SPHINXBUILD], test "$SPHINXBUILD" != "false")
AM_CONDITIONAL([HAVE_PDFLATEX], test "$PDFLATEX" != "false")
AM_CONDITIONAL([HAVE_MAKEINFO], test "$MAKEINFO" != "false")
filtered_cflags=$(echo -n "$CFLAGS" | sed 's/\W-f\S*-prefix-map=\S*\W/ /g')
filtered_cppflags=$(echo -n "$CPPFLAGS" | sed 's/\W-f\S*-prefix-map=\S*\W/ /g')
result_msg_base=" Knot DNS $VERSION
Target: $host_os $host_cpu
Compiler: ${CC}
CFLAGS: ${CFLAGS} ${CPPFLAGS}
CFLAGS: ${filtered_cflags} ${filtered_cppflags}
LIBS: ${LIBS} ${LDFLAGS}
LibURCU: ${liburcu_LIBS} ${liburcu_CFLAGS}
GnuTLS: ${gnutls_LIBS} ${gnutls_CFLAGS}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment