From d8c2e9a027d264c571c2e27916f6de591f3f1d29 Mon Sep 17 00:00:00 2001 From: Connor O'Brien Date: Mon, 14 Feb 2022 17:49:38 -0800 Subject: Add Android.bp for bpftool Build bpftool for host so we can use it to generate BPF skeleton headers when building libbpf-tools. For now, set -DBPFTOOL_WITHOUT_SKELETONS to avoid a multi-step build process involving an intermediate "bootstrap" bpftool used to embed BPF skeletons in the bpftool binary itself to support newer features not needed for this use case. Test: m bpftool Bug: 203823368 Signed-off-by: Connor O'Brien Change-Id: I8b4e2056dfb18761ac775819c30f9bd5f199db04 --- Android.bp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Android.bp diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..78ac00a --- /dev/null +++ b/Android.bp @@ -0,0 +1,30 @@ + +cc_binary_host { + name: "bpftool", + srcs: [ + "src/*.c", + "src/kernel/bpf/disasm.c", + ], + exclude_srcs: [ + "src/jit_disasm.c", + ], + local_include_dirs: [ + "include", + "include/uapi", + "src/kernel/bpf" + ], + static_libs: [ + "libbpf", + "libcap", + "libelf", + "libz", + ], + cflags: [ + "-DBPFTOOL_WITHOUT_SKELETONS", + "-DBPFTOOL_VERSION=\"5.16.0-c446fdacb10d\"", + "-DUSE_LIBCAP", + "-Wno-missing-field-initializers", + "-Wno-pointer-arith", + "-Wno-unused-parameter", + ] +} -- cgit v1.2.3