about summary refs log tree commit diff
path: root/pkgs/by-name/pa
diff options
context:
space:
mode:
authorDominique Martinet2024-06-12 21:52:15 +0900
committerDominique Martinet2024-06-26 12:40:15 +0900
commitd354c891fbb0587a6a05fe3b67a902cfb3d8543c (patch)
treeadf8997dd3daf43323376da07099b5cba7f2f0b0 /pkgs/by-name/pa
parent8a826cb8f8de93b4b494e12808e2b87fcc7fe611 (diff)
pahole: reproducibility: use --reproducible_build instead of -j1
New version brought in the --reproducible_build option, which is more
efficient than forcing a single thread, and produces the same output
(tested on linux kernel's vmlinux BTF extraction)
Diffstat (limited to 'pkgs/by-name/pa')
-rw-r--r--pkgs/by-name/pa/pahole/package.nix1
-rw-r--r--pkgs/by-name/pa/pahole/threading-reproducibility.patch27
2 files changed, 13 insertions, 15 deletions
diff --git a/pkgs/by-name/pa/pahole/package.nix b/pkgs/by-name/pa/pahole/package.nix
index bc4647eb833d..0f7422587d43 100644
--- a/pkgs/by-name/pa/pahole/package.nix
+++ b/pkgs/by-name/pa/pahole/package.nix
@@ -26,6 +26,7 @@ stdenv.mkDerivation rec {
     musl-obstack
   ];
 
+  # https://github.com/acmel/dwarves/pull/51
   patches = [ ./threading-reproducibility.patch ];
 
   # Put libraries in "lib" subdirectory, not top level of $out
diff --git a/pkgs/by-name/pa/pahole/threading-reproducibility.patch b/pkgs/by-name/pa/pahole/threading-reproducibility.patch
index 15893ce2d035..3c76d9c8521e 100644
--- a/pkgs/by-name/pa/pahole/threading-reproducibility.patch
+++ b/pkgs/by-name/pa/pahole/threading-reproducibility.patch
@@ -1,18 +1,15 @@
 diff --git a/pahole.c b/pahole.c
-index 6fc4ed6..a4e306f 100644
+index 954498d2ad4f..2b010658330c 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
+@@ -3705,6 +3705,10 @@ int main(int argc, char *argv[])
+ 		goto out;
+ 	}
+ 
++	/* This being set means whoever called us tries to do a reproducible build */
++	if (getenv("SOURCE_DATE_EPOCH"))
++		conf_load.reproducible_build = true;
++
+ 	if (languages.str && parse_languages())
+ 		return rc;
+