android_system_bpf/include/vmlinux/Android.bp
Kalesh Singh 655664e3cd Add 6.12 vmlinux.h genrules
Generate vmlinux.h from the kernel prebuilt vmlinux

Bug: 421990777
Test: Manual; build bpf prog with "vmlinux_h_6_12" header
Change-Id: I5647a3c2d7d1695aa42fd9636dd7f7abd4a1dc44
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2025-06-11 15:41:44 -07:00

61 lines
2 KiB
Text

// Copyright (C) 2025 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
genrule {
name: "vmlinux_h_6_12_arm64",
cmd: "mkdir -p $(genDir)/6.12/arm64 && $(location bpftool) btf dump file $(location :vmlinux_6_12_arm64) format c > $(genDir)/6.12/arm64/vmlinux.h",
srcs: [
":vmlinux_6_12_arm64",
],
tools: ["bpftool"],
out: [
"6.12/arm64/vmlinux.h",
],
export_include_dirs: ["6.12/arm64"],
}
genrule {
name: "vmlinux_h_6_12_x86_64",
cmd: "mkdir -p $(genDir)/6.12/x86_64 && $(location bpftool) btf dump file $(location :vmlinux_6_12_x86_64) format c > $(genDir)/6.12/x86_64/vmlinux.h",
srcs: [
":vmlinux_6_12_x86_64",
],
tools: ["bpftool"],
out: [
"6.12/x86_64/vmlinux.h",
],
export_include_dirs: ["6.12/x86_64"],
}
cc_library_headers {
name: "vmlinux_h_6_12",
arch: {
arm: {
generated_headers: ["vmlinux_h_6_12_arm64"],
export_generated_headers: ["vmlinux_h_6_12_arm64"],
},
arm64: {
generated_headers: ["vmlinux_h_6_12_arm64"],
export_generated_headers: ["vmlinux_h_6_12_arm64"],
},
x86: {
generated_headers: ["vmlinux_h_6_12_x86_64"],
export_generated_headers: ["vmlinux_h_6_12_x86_64"],
},
x86_64: {
generated_headers: ["vmlinux_h_6_12_x86_64"],
export_generated_headers: ["vmlinux_h_6_12_x86_64"],
},
},
}