summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/gperf/gperf/reproducibility.patch
blob: 9f80828dbd7a9538e0ee9d5bdc2e65ffe381fee0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 == '-')
         {