BPF: Create rust bpfloader

In preparation for adding libbpf support via libbpf-rs, replace the
existing cpp bpfloader with a rust application calling into the
libbpf_android bindings to the legacy code.

Test: treehugger
Change-Id: I79eff1fece3372727c700308ff9a35029d0e34d3
Signed-off-by: Neill Kapron <nkapron@google.com>
diff --git a/loader/Android.bp b/loader/Android.bp
index ae664df..5854f86 100644
--- a/loader/Android.bp
+++ b/loader/Android.bp
@@ -111,29 +111,14 @@
     require_root: true,
 }
 
-cc_binary {
+rust_binary {
     name: "bpfloader",
-
-    defaults: ["bpf_defaults"],
-    cflags: [
-        "-Wall",
-        "-Werror",
-        "-Wthread-safety",
-    ],
-    sanitize: {
-        integer_overflow: true,
-    },
-
-    header_libs: ["bpf_headers"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-    ],
-    static_libs: ["libbpf_android"],
     srcs: [
-        "BpfLoader.cpp",
+        "bpfloader.rs",
     ],
-
+    rustlibs: [
+        "libbpf_android_bindgen",
+    ],
     required: [
         "timeInState.o",
     ],