2023-04-18 05:57:56 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchzip
|
|
|
|
, pkg-config
|
|
|
|
, libbpf
|
|
|
|
, cmake
|
|
|
|
, elfutils
|
|
|
|
, zlib
|
|
|
|
, argp-standalone
|
|
|
|
, musl-obstack
|
|
|
|
, nixosTests
|
2024-06-26 03:38:38 +00:00
|
|
|
, fetchpatch
|
2023-04-18 05:57:56 +00:00
|
|
|
}:
|
2015-07-11 11:11:14 +00:00
|
|
|
|
2018-09-19 22:28:05 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-06-27 23:54:27 +00:00
|
|
|
pname = "pahole";
|
2024-06-11 23:29:46 +00:00
|
|
|
version = "1.27";
|
2023-03-11 21:34:39 +00:00
|
|
|
src = fetchzip {
|
2023-04-17 22:06:27 +00:00
|
|
|
url = "https://git.kernel.org/pub/scm/devel/pahole/pahole.git/snapshot/pahole-${version}.tar.gz";
|
2024-06-11 23:29:46 +00:00
|
|
|
hash = "sha256-BwA17lc2yegmOzLfoIu8OmG/PVdc+4sOGzB8Jc4ZjGM=";
|
2015-07-11 11:11:14 +00:00
|
|
|
};
|
|
|
|
|
2021-12-03 23:55:48 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2022-01-11 16:26:52 +00:00
|
|
|
buildInputs = [ elfutils zlib libbpf ]
|
2022-10-06 16:38:53 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isMusl [
|
2022-01-11 16:26:52 +00:00
|
|
|
argp-standalone
|
|
|
|
musl-obstack
|
|
|
|
];
|
2018-09-19 22:28:05 +00:00
|
|
|
|
2024-06-26 03:38:38 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/acmel/dwarves/pull/51 / https://lkml.kernel.org/r/20240626032253.3406460-1-asmadeus@codewreck.org
|
|
|
|
./threading-reproducibility.patch
|
|
|
|
# https://github.com/acmel/dwarves/issues/53
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-clang-btf-generation-bug.patch";
|
|
|
|
url = "https://github.com/acmel/dwarves/commit/6a2b27c0f512619b0e7a769a18a0fb05bb3789a5.patch";
|
|
|
|
hash = "sha256-Le1BAew/a/QKkYNLgSQxEvZ9mEEglUw8URwz1kiheeE=";
|
|
|
|
})
|
2024-08-01 19:34:00 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-clang-btf-generation-bug-2.patch";
|
|
|
|
url = "https://github.com/acmel/dwarves/commit/94a01bde592c555b3eb526aeb4c2ad695c5660d8.patch";
|
|
|
|
hash = "sha256-SMIxLEBjBkprAqVNX1h7nXxAsgbwvCD/Bz7c1ekwg5w=";
|
|
|
|
})
|
2024-06-26 03:38:38 +00:00
|
|
|
];
|
2023-05-14 02:10:20 +00:00
|
|
|
|
2018-09-19 22:28:05 +00:00
|
|
|
# Put libraries in "lib" subdirectory, not top level of $out
|
2021-12-03 23:55:48 +00:00
|
|
|
cmakeFlags = [ "-D__LIB=lib" "-DLIBBPF_EMBEDDED=OFF" ];
|
2015-07-11 11:11:14 +00:00
|
|
|
|
2023-04-18 05:57:56 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) bpf;
|
|
|
|
};
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2022-06-05 15:36:26 +00:00
|
|
|
homepage = "https://git.kernel.org/pub/scm/devel/pahole/pahole.git/";
|
2023-01-25 09:43:50 +00:00
|
|
|
description = "Shows, manipulates, and pretty-prints debugging information in DWARF, CTF, and BTF formats";
|
2021-03-17 06:42:04 +00:00
|
|
|
license = licenses.gpl2Only;
|
2015-07-11 11:11:14 +00:00
|
|
|
|
|
|
|
platforms = platforms.linux;
|
2021-12-03 23:55:48 +00:00
|
|
|
maintainers = with maintainers; [ bosu martinetd ];
|
2015-07-11 11:11:14 +00:00
|
|
|
};
|
|
|
|
}
|