#1151062 binutils-source: gprof-build.diff is undone by consumers' forced autoreconf

#1151062#5
Date:
2026-10-16 14:55:52 UTC
From:
To:
Dear Maintainer,

binutils-or1k-elf and binutils-sh-elf build from the patched source
tarball in binutils-source and then force an Autotools regeneration
(autoreconf2.69 -f from a dh_autoreconf override), as described on
https://wiki.debian.org/PackagingLessCommonBinutilsTargets

debian/patches/gprof-build.diff ("Fix gprof build error") changes only
the generated template gprof/gconfig.in. It deletes

  /* Version number of package */
  #undef VERSION

gprof/configure.ac is unchanged and calls AM_INIT_AUTOMAKE, which
defines VERSION, so the forced autoheader run restores the template:
--- binutils-source: gprof/gconfig.in
+++ after the consumers' autoreconf
@@ -118,4 +118,7 @@


+/* Version number of package */
+#undef VERSION
+
 /* Enable large inode numbers on Mac OS X 10.5.  */
 #ifndef _DARWIN_USE_64_BIT_INODE

I reproduced this offline on arm64, with exactly the package versions
from the official buildinfo files, for binutils-or1k-elf 1.0.13+b1 and
binutils-sh-elf 3+b1 (binutils-source 2.44-3), and for
binutils-or1k-elf 1.0.15 and binutils-sh-elf 3+b3 (binutils-source
2.47-6). In all four, autoheader's backup gprof/gconfig.in~ is
identical to the patched file, and gconfig.h ends up with
#define VERSION "2.44" (or "2.47"). The official logs run the same
commands, for example:

https://buildd.debian.org/status/fetch.php?pkg=binutils-or1k-elf&arch=arm64&ver=1.0.15&stamp=1789862670&raw=1
https://buildd.debian.org/status/fetch.php?pkg=binutils-sh-elf&arch=arm64&ver=3%2Bb3&stamp=1789898098&raw=1

This looks harmless today. bfd's config.h, which gprof includes first,
defines VERSION to the same value. Building gprof with and without the
template gave byte-identical object files and an identical gprof
binary, whose build ID matches the official packages, and no compiler
warning either way. No other patch in the series lost its effect.

Some of the options I can think of (you probably have more):

 - drop gprof-build.diff, if the build error it fixed no longer occurs;
 - make the change in a file that survives regeneration
   (gprof/configure.ac), if it is still needed;
 - note in README.cross or README.source that changes to generated
   files only do not reach consumers that regenerate.

I would be happy to provide more details.

I do not think this is a security issue. I did not test the native build, so
I cannot say whether that build still needs the patch.

Regards,
Hakan Dilek

#1151062#10
Date:
2026-10-20 11:54:47 UTC
From:
To:
binutils itself doesn't run any of the autoreconf stuff itself, and I
don't want to change this.  So adding the diff of gprof/configure.ac (?)
should be fine. Do you have a tested patch?

Matthias

#1151062#13
Date:
2026-10-20 11:54:47 UTC
From:
To:
binutils itself doesn't run any of the autoreconf stuff itself, and I
don't want to change this.  So adding the diff of gprof/configure.ac (?)
should be fine. Do you have a tested patch?

Matthias