all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 8771ca6b0d219a7a292968c0b61b7f597b9962f5 813 bytes (raw)
name: gnu/packages/patches/dwarves-threading-reproducibility.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
Retrieved from nixpkgs.

This causes pahole to use '-j1' (single thread) when SOURCE_DATE_EPOCH
is set, to ensure it produces reproducible output.

diff --git a/pahole.c b/pahole.c
index 6fc4ed6..a4e306f 100644
--- a/pahole.c
+++ b/pahole.c
@@ -1687,8 +1687,11 @@ static error_t pahole__options_parser(int key, char *arg,
 		  class_name = arg;			break;
 	case 'j':
 #if _ELFUTILS_PREREQ(0, 178)
-		  conf_load.nr_jobs = arg ? atoi(arg) :
-					    sysconf(_SC_NPROCESSORS_ONLN) * 1.1;
+		  // Force single thread if reproducibility is desirable.
+		  if (!getenv("SOURCE_DATE_EPOCH")) {
+			  conf_load.nr_jobs = arg ? atoi(arg) :
+						    sysconf(_SC_NPROCESSORS_ONLN) * 1.1;
+		  }
 #else
 		  fputs("pahole: Multithreading requires elfutils >= 0.178. Continuing with a single thread...\n", stderr);
 #endif

debug log:

solving 8771ca6b0d ...
found 8771ca6b0d in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.