Skip to content

Commit 6bb83f5

Browse files
Yujie-Liurli9
authored andcommitted
programs/kernel-selftests: build pahole from source code
pahole v1.25 introduced the new option --skip_encoding_btf_inconsistent_proto which is required to build bpf selftest. The pahole binary provided by distribution may be lower version that cannot support this option. == fix issue == BTF [M] tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.ko pahole: unrecognized option '--skip_encoding_btf_inconsistent_proto' Signed-off-by: Yujie Liu <[email protected]> Signed-off-by: Philip Li <[email protected]>
1 parent 291c5af commit 6bb83f5

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

programs/kernel-selftests/pkg/PKGBUILD

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ pkgrel=1
44
arch=('i686' 'x86_64' 'aarch64')
55
url="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
66
license=('GPL')
7-
source=('https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git')
8-
md5sums=('SKIP')
7+
source=('https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git' 'https://git.kernel.org/pub/scm/devel/pahole/pahole.git')
8+
md5sums=('SKIP' 'SKIP')
99

1010
# Download kernel from git.kernel.org.
1111
# If the kernel has been download into the computer, you can copy it to ${srcdir}.
@@ -43,6 +43,17 @@ build_tools()
4343
make
4444
}
4545

46+
build_pahole()
47+
{
48+
cd "${srcdir}/pahole"
49+
50+
mkdir build
51+
cd build
52+
mkdir -p $pkgdir/usr
53+
cmake -D__LIB=lib -DCMAKE_INSTALL_PREFIX=$pkgdir/usr ..
54+
make install
55+
}
56+
4657
install_selftests()
4758
{
4859
cd "${srcdir}/linux"
@@ -72,6 +83,7 @@ build()
7283
benchmark_path="${pkgdir}/lkp/benchmarks/${pkgname}"
7384
mkdir -p "${benchmark_path}"
7485
build_tools
86+
build_pahole
7587
install_selftests
7688
}
7789

programs/kernel-selftests/pkg/depends

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ gcc
22
g++
33
gcc-multilib
44
xz-utils
5-
dwarves
65
libbpf-dev
76
libc6-dev
87
libc-bin
@@ -32,6 +31,8 @@ libnuma-dev
3231
libmount-dev
3332
libpci3
3433
libelf-dev
34+
libdw-dev
35+
libdwarf-dev
3536
libfuse-dev
3637
gcc-multilib
3738
pkg-config
@@ -85,6 +86,7 @@ arping
8586
linux-perf
8687
file
8788
clang
89+
lld
8890
libclang-dev
8991
llvm-dev
9092
attr

programs/kernel-selftests/pkg/depends-dev

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ libpci-dev
33
gettext
44
systemd
55
libelf-dev
6+
libdw-dev
7+
libdwarf-dev
68
libudev1
79
libudev-dev
810
pkg-config
@@ -19,3 +21,4 @@ automake
1921
libtool
2022
m4
2123
libbpf-dev
24+
cmake

0 commit comments

Comments
 (0)