| 1 | Retrieved from nixpkgs.
|
| 2 |
|
| 3 | This causes pahole to use '-j1' (single thread) when SOURCE_DATE_EPOCH
|
| 4 | is set, to ensure it produces reproducible output.
|
| 5 |
|
| 6 | diff --git a/pahole.c b/pahole.c
|
| 7 | index 6fc4ed6..a4e306f 100644
|
| 8 | |
| 9 | |
| 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
|