aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Stokes <alanstokes@google.com>2023-04-24 16:25:20 +0100
committerAlan Stokes <alanstokes@google.com>2023-04-25 13:25:15 +0100
commit03842cff6fcb5d00e38a6744c6e49aa7f688f965 (patch)
tree2d41440de78728e182162a06c9cfff7b380c164d
parenta86abd5b1d9c950d649c20643684e4d6252dda59 (diff)
downloadhalf-03842cff6fcb5d00e38a6744c6e49aa7f688f965.tar.gz
Create no_std builds of ciborium and dependencies
pvmfw, which is no_std (but with alloc) needs to be able to read & write CBOR (for the DICE chain), so we need a no_std version of ciborium. Bug: 266172411 Test: atest MicrodroidTests Change-Id: I8117e7ce2bbcdc2def994196693efa51399fddac
-rw-r--r--Android.bp25
-rw-r--r--cargo2android.json7
-rw-r--r--cargo2android_nostd.bp22
3 files changed, 48 insertions, 6 deletions
diff --git a/Android.bp b/Android.bp
index 12334aa..48ad351 100644
--- a/Android.bp
+++ b/Android.bp
@@ -52,8 +52,31 @@ rust_library {
],
apex_available: [
"//apex_available:platform",
- "com.android.virt",
+ "//apex_available:anyapex",
],
product_available: true,
vendor_available: true,
}
+
+rust_library_rlib {
+ name: "libhalf_nostd",
+ crate_name: "half",
+ cargo_env_compat: true,
+ cargo_pkg_version: "2.2.1",
+ srcs: ["src/lib.rs"],
+ edition: "2021",
+ prefer_rlib: true,
+ no_stdlibs: true,
+ stdlibs: [
+ "liballoc.rust_sysroot",
+ "libcompiler_builtins.rust_sysroot",
+ "libcore.rust_sysroot",
+ ],
+ features: [
+ "alloc",
+ ],
+ apex_available: [
+ "//apex_available:platform",
+ "//apex_available:anyapex",
+ ],
+}
diff --git a/cargo2android.json b/cargo2android.json
index 84618e2..2f73971 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -1,9 +1,6 @@
{
- "apex-available": [
- "//apex_available:platform",
- "com.android.virt"
- ],
+ "add-toplevel-block": "cargo2android_nostd.bp",
"device": true,
"run": true,
"vendor-available": true
-} \ No newline at end of file
+}
diff --git a/cargo2android_nostd.bp b/cargo2android_nostd.bp
new file mode 100644
index 0000000..db81b1a
--- /dev/null
+++ b/cargo2android_nostd.bp
@@ -0,0 +1,22 @@
+rust_library_rlib {
+ name: "libhalf_nostd",
+ crate_name: "half",
+ cargo_env_compat: true,
+ cargo_pkg_version: "2.2.1",
+ srcs: ["src/lib.rs"],
+ edition: "2021",
+ prefer_rlib: true,
+ no_stdlibs: true,
+ stdlibs: [
+ "liballoc.rust_sysroot",
+ "libcompiler_builtins.rust_sysroot",
+ "libcore.rust_sysroot",
+ ],
+ features: [
+ "alloc",
+ ],
+ apex_available: [
+ "//apex_available:platform",
+ "//apex_available:anyapex",
+ ],
+}