Merge pull request #231768 from delroth/pahole-btf-repro
pahole: patch to force single-threaded mode if reproducibility is desired
This commit is contained in:
@@ -26,6 +26,8 @@ stdenv.mkDerivation rec {
|
||||
musl-obstack
|
||||
];
|
||||
|
||||
patches = [ ./threading-reproducibility.patch ];
|
||||
|
||||
# Put libraries in "lib" subdirectory, not top level of $out
|
||||
cmakeFlags = [ "-D__LIB=lib" "-DLIBBPF_EMBEDDED=OFF" ];
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
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
|
||||
Reference in New Issue
Block a user