libs/avb: Introduce libavb_baremetal
Introduce a no_std variant of the libavb_bindgen library that links
against the baremetal variants of libavb and libcrypto.
Move the usespace libavb_bindgen back to depending on the debug-printing
libavb as it isn't as constrained with logging.
Bug: 267447272
Test: m pvmfw_img
Change-Id: Ic713e4ac5e31b41b233a8791e77325a1a61d888b
diff --git a/libs/avb/Android.bp b/libs/avb/Android.bp
index c173f1c..7bfea3f 100644
--- a/libs/avb/Android.bp
+++ b/libs/avb/Android.bp
@@ -2,9 +2,8 @@
default_applicable_licenses: ["Android-Apache-2.0"],
}
-rust_bindgen {
- name: "libavb_bindgen",
- host_supported: true,
+rust_defaults {
+ name: "libavb_bindgen.defaults",
wrapper_src: "bindgen/avb.h",
crate_name: "avb_bindgen",
edition: "2021",
@@ -19,13 +18,28 @@
"--raw-line=#![no_std]",
"--ctypes-prefix=core::ffi",
],
+ cflags: ["-DBORINGSSL_NO_CXX"],
+}
+
+rust_bindgen {
+ name: "libavb_bindgen",
+ defaults: ["libavb_bindgen.defaults"],
+ host_supported: true,
static_libs: [
- "libavb_non_debug",
+ "libavb",
],
shared_libs: [
"libcrypto",
],
- cflags: ["-DBORINGSSL_NO_CXX"],
+}
+
+rust_bindgen {
+ name: "libavb_bindgen_nostd",
+ defaults: ["libavb_bindgen.defaults"],
+ static_libs: [
+ "libavb_baremetal",
+ "libcrypto_baremetal",
+ ],
}
rust_test {
diff --git a/pvmfw/avb/Android.bp b/pvmfw/avb/Android.bp
index 0c1e392..7ed4895 100644
--- a/pvmfw/avb/Android.bp
+++ b/pvmfw/avb/Android.bp
@@ -8,11 +8,11 @@
srcs: ["src/lib.rs"],
prefer_rlib: true,
rustlibs: [
- "libavb_bindgen",
+ "libavb_bindgen_nostd",
"libtinyvec_nostd",
],
whole_static_libs: [
- "libavb_non_debug",
+ "libavb_baremetal",
],
}