BPF: add rust bindgen for libbpf_android

Add bindgen rules to create rust bindings for libbpf_android. This will
be used to provide the legacy bpf support in the new rust bpfloader.

Test: treehugger
Change-Id: I22f7b38d6ccb25d4d1f61d9f6e672ab6f6abe42e
Signed-off-by: Neill Kapron <nkapron@google.com>
diff --git a/loader/Android.bp b/loader/Android.bp
index 1e7ece8..ae664df 100644
--- a/loader/Android.bp
+++ b/loader/Android.bp
@@ -59,6 +59,28 @@
     ],
 }
 
+rust_bindgen {
+    name: "libbpf_android_bindgen",
+    crate_name: "bpf_android_bindgen",
+    wrapper_src: "include/libbpf_android.h",
+    source_stem: "bindings",
+    bindgen_flags: [
+        "--verbose",
+    ],
+    cflags: [
+        "-Werror",
+        "-Wall",
+        "-Wextra",
+        "-Wno-pragma-once-outside-header",
+    ],
+    shared_libs: [
+        "libbase",
+        "libutils",
+        "liblog",
+        "libbpf_android",
+    ],
+}
+
 cc_test {
     name: "libbpf_load_test",
     test_suites: ["general-tests"],