From 2e61afb442fd83a9102def7ca0a6673716b07869 Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Wed, 11 Jun 2025 15:50:53 -0700 Subject: [PATCH] Add 6.1 vmlinux.h genrules Generate vmlinux.h from the kernel prebuilt vmlinux Bug: 421990777 Test: Manual; build bpf prog with "vmlinux_h_6_1" header Change-Id: Ib1b7a24c470610ea6d1ee6c84f1c656e7139340b Signed-off-by: Kalesh Singh --- include/vmlinux/Android.bp | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/include/vmlinux/Android.bp b/include/vmlinux/Android.bp index 345441e..0e4b4b3 100644 --- a/include/vmlinux/Android.bp +++ b/include/vmlinux/Android.bp @@ -107,3 +107,51 @@ cc_library_headers { }, }, } + +genrule { + name: "vmlinux_h_6_1_arm64", + cmd: "mkdir -p $(genDir)/6.1/arm64 && $(location bpftool) btf dump file $(location :vmlinux_6_1_arm64) format c > $(genDir)/6.1/arm64/vmlinux.h", + srcs: [ + ":vmlinux_6_1_arm64", + ], + tools: ["bpftool"], + out: [ + "6.1/arm64/vmlinux.h", + ], + export_include_dirs: ["6.1/arm64"], +} + +genrule { + name: "vmlinux_h_6_1_x86_64", + cmd: "mkdir -p $(genDir)/6.1/x86_64 && $(location bpftool) btf dump file $(location :vmlinux_6_1_x86_64) format c > $(genDir)/6.1/x86_64/vmlinux.h", + srcs: [ + ":vmlinux_6_1_x86_64", + ], + tools: ["bpftool"], + out: [ + "6.1/x86_64/vmlinux.h", + ], + export_include_dirs: ["6.1/x86_64"], +} + +cc_library_headers { + name: "vmlinux_h_6_1", + arch: { + arm: { + generated_headers: ["vmlinux_h_6_1_arm64"], + export_generated_headers: ["vmlinux_h_6_1_arm64"], + }, + arm64: { + generated_headers: ["vmlinux_h_6_1_arm64"], + export_generated_headers: ["vmlinux_h_6_1_arm64"], + }, + x86: { + generated_headers: ["vmlinux_h_6_1_x86_64"], + export_generated_headers: ["vmlinux_h_6_1_x86_64"], + }, + x86_64: { + generated_headers: ["vmlinux_h_6_1_x86_64"], + export_generated_headers: ["vmlinux_h_6_1_x86_64"], + }, + }, +}