From 7ce3ffaaeffe535b74ea6502faabb354ed3fc7c3 Mon Sep 17 00:00:00 2001 From: Siddharth Nayyar Date: Tue, 10 Mar 2026 13:14:43 +0000 Subject: [PATCH] ANDROID: build libbpf for x86 x86 libbpf is a dependency for pahole, required for building pahole from sources. Bug: 477549297 Change-Id: Icd19ec89ab4bd5637bb82fb6262233e31dacf1e8 Signed-off-by: Siddharth Nayyar --- BUILD.bazel | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/BUILD.bazel b/BUILD.bazel index acee03edbc3b..0ac0ff459bd7 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1276,6 +1276,29 @@ kernel_build( visibility = ["//visibility:private"], ) +# libbpf +cc_library( + name = "bpf_x86", + srcs = glob([ + "tools/arch/x86/include/**/*.h", + "tools/include/**/*.h", + "tools/lib/bpf/*.c", + ]), + hdrs = glob([ + "tools/lib/bpf/*.h", + ]), + copts = [ + "-I{}/tools/include".format(package_name()), + "-I{}/tools/lib/bpf".format(package_name()), + ], + includes = [ + "tools/include/uapi", + ], + strip_include_prefix = "tools/lib", + visibility = ["//visibility:public"], + deps = ["//prebuilts/kernel-build-tools:imported_libs"], +) + # KUnit test targets _KUNIT_DIR = "testcases/kunit"