diff options
author | Alan Stokes <alanstokes@google.com> | 2023-04-24 16:25:20 +0100 |
---|---|---|
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | 2023-05-09 09:09:33 +0000 |
commit | 8cd9cd14689ccf4e1f0885a24c98d8317883fdd2 (patch) | |
tree | 2d41440de78728e182162a06c9cfff7b380c164d | |
parent | fffa7531fac641e7d9d5447a1c872c398389c4cd (diff) | |
download | half-8cd9cd14689ccf4e1f0885a24c98d8317883fdd2.tar.gz |
Create no_std builds of ciborium and dependenciesandroid14-dev
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
(cherry picked from https://android-review.googlesource.com/q/commit:03842cff6fcb5d00e38a6744c6e49aa7f688f965)
Merged-In: I8117e7ce2bbcdc2def994196693efa51399fddac
Change-Id: I8117e7ce2bbcdc2def994196693efa51399fddac
-rw-r--r-- | Android.bp | 25 | ||||
-rw-r--r-- | cargo2android.json | 7 | ||||
-rw-r--r-- | cargo2android_nostd.bp | 22 |
3 files changed, 48 insertions, 6 deletions
@@ -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", + ], +} |