projects/guix·blob python-team · refs

23 lines · 813 B

1Retrieved from nixpkgs.
2
3This causes pahole to use '-j1' (single thread) when SOURCE_DATE_EPOCH
4is set, to ensure it produces reproducible output.
5
6diff --git a/pahole.c b/pahole.c
7index 6fc4ed6..a4e306f 100644
8--- a/pahole.c
9+++ b/pahole.c
10@@ -1687,8 +1687,11 @@ static error_t pahole__options_parser(int key, char *arg,
11 class_name = arg; break;
12 case 'j':
13 #if _ELFUTILS_PREREQ(0, 178)
14- conf_load.nr_jobs = arg ? atoi(arg) :
15- sysconf(_SC_NPROCESSORS_ONLN) * 1.1;
16+ // Force single thread if reproducibility is desirable.
17+ if (!getenv("SOURCE_DATE_EPOCH")) {
18+ conf_load.nr_jobs = arg ? atoi(arg) :
19+ sysconf(_SC_NPROCESSORS_ONLN) * 1.1;
20+ }
21 #else
22 fputs("pahole: Multithreading requires elfutils >= 0.178. Continuing with a single thread...\n", stderr);
23 #endif