]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
gperf: Add a patch to work around reproducibility issues
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 4 Jul 2022 13:18:16 +0000 (14:18 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 4 Jul 2022 21:51:46 +0000 (22:51 +0100)
Add a patch to avoid writing the full pathname to gperf into source
files which leads to reproducibility issues.

This fixes issues with systemd reproducibility in particular.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-extended/gperf/gperf/reproducibility.patch [new file with mode: 0644]
meta/recipes-extended/gperf/gperf_3.1.bb

diff --git a/meta/recipes-extended/gperf/gperf/reproducibility.patch b/meta/recipes-extended/gperf/gperf/reproducibility.patch
new file mode 100644 (file)
index 0000000..9f80828
--- /dev/null
@@ -0,0 +1,26 @@
+By default gperf puts a header into generated files with the full path to
+the tool along with the commandline used. This patch removes the path to
+the binary, allowing reproducible source files (which can be included in
+debug source packages).
+
+Upstream-Status: Pending
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Index: gperf-3.1/src/options.cc
+===================================================================
+--- gperf-3.1.orig/src/options.cc
++++ gperf-3.1/src/options.cc
+@@ -280,6 +280,13 @@ Options::print_options () const
+     {
+       const char *arg = _argument_vector[i];
++      if (i == 0) {
++          const char *shortarg = strrchr(arg, '/');
++          if (shortarg) {
++              arg = shortarg + 1;
++          }
++      }
++
+       /* Escape arg if it contains shell metacharacters.  */
+       if (*arg == '-')
+         {
index 82750fca05ca4cbca1315014154d9e893e2f14db..3564ac0805bfb78aefd56e794f0edccb6c1f647b 100644 (file)
@@ -9,6 +9,8 @@ SRC_URI  = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz"
 SRC_URI[md5sum] = "9e251c0a618ad0824b51117d5d9db87e"
 SRC_URI[sha256sum] = "588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2"
 
+SRC_URI:append = " file://reproducibility.patch"
+
 inherit autotools
 
 # The nested configures don't find the parent aclocal.m4 out of the box, so tell