diff options
author | Khyber Sen <khyber@google.com> | 2024-01-31 08:47:35 +0000 |
---|---|---|
committer | Khyber Sen <khyber@google.com> | 2024-02-05 06:24:33 +0000 |
commit | 1aab01da491b8a453645fffdbbdd44f06beebb76 (patch) | |
tree | 747a8c1520181dbbda47d06d39166f587f428598 | |
parent | 564d36be1b739aadf5f5088026499365e719530a (diff) | |
download | serde-1aab01da491b8a453645fffdbbdd44f06beebb76.tar.gz |
Disable std in trusty kernel buildsemu-34-3-release
Rust in the trusty kernel is `#[no_std]`,
so we need to disable all features that depend on std.
Change-Id: I56ca2f4d4acfc0b9a9f3cf54c76a5f2c566e998c
-rw-r--r-- | patches/rules.mk.diff | 18 | ||||
-rw-r--r-- | rules.mk | 6 |
2 files changed, 19 insertions, 5 deletions
diff --git a/patches/rules.mk.diff b/patches/rules.mk.diff index 34a66ce..019e2d9 100644 --- a/patches/rules.mk.diff +++ b/patches/rules.mk.diff @@ -1,13 +1,21 @@ diff --git a/rules.mk b/rules.mk -index 5e5b3d4..5aeddb1 100644 +index 442c6fc..6c64bf9 100644 --- a/rules.mk +++ b/rules.mk -@@ -15,4 +15,8 @@ MODULE_RUSTFLAGS += \ +@@ -13,9 +13,16 @@ MODULE_RUSTFLAGS += \ + --cfg 'feature="default"' \ + --cfg 'feature="derive"' \ --cfg 'feature="serde_derive"' \ ++ ++ifeq ($(call TOBOOL,$(TRUSTY_USERSPACE)),true) ++ ++MODULE_RUSTFLAGS += \ --cfg 'feature="std"' \ -+MODULE_LIBRARY_DEPS := \ -+ trusty/user/base/lib/liballoc-rust \ -+ external/rust/crates/serde_derive \ ++endif + + MODULE_LIBRARY_DEPS := \ ++ trusty/user/base/lib/liballoc-rust \ + external/rust/crates/serde_derive \ + include make/library.mk @@ -13,8 +13,14 @@ MODULE_RUSTFLAGS += \ --cfg 'feature="default"' \ --cfg 'feature="derive"' \ --cfg 'feature="serde_derive"' \ + +ifeq ($(call TOBOOL,$(TRUSTY_USERSPACE)),true) + +MODULE_RUSTFLAGS += \ --cfg 'feature="std"' \ +endif + MODULE_LIBRARY_DEPS := \ trusty/user/base/lib/liballoc-rust \ external/rust/crates/serde_derive \ |