diff options
author | Stephen Crane <cranes@google.com> | 2024-03-07 01:32:52 +0000 |
---|---|---|
committer | Stephen Crane <cranes@google.com> | 2024-03-07 22:30:54 +0000 |
commit | 429141b90ba027aaf49990e9c9f07790db5df779 (patch) | |
tree | 336663a0ecff8597eee05b59b2de8530edcfacf4 | |
parent | d6ff678042b6778ae1126886edaa3533e3ccad5c (diff) | |
download | common-429141b90ba027aaf49990e9c9f07790db5df779.tar.gz |
make: Remove injected Rust panic handler
We are adding a proper Rust panic handler in
Ib01a7ffe84303f23b458a07fa3ddf2c1ecb3e702, so we should not inject a panic
handler in the top level source file. The panic_abort feature flag is only
needed for the panic_abort crate that implements a basic abort panic handler.
With our custom panic handler we don't need this dependency, so this change
removes the feature flag.
Test: build.py
Bug: 328519718
Change-Id: Ibd40ea4e2ef476237879df332350f8966852a927
-rw-r--r-- | dev/virtio/vsock-rust/rules.mk | 1 | ||||
-rw-r--r-- | make/rust-toplevel.mk | 5 |
2 files changed, 2 insertions, 4 deletions
diff --git a/dev/virtio/vsock-rust/rules.mk b/dev/virtio/vsock-rust/rules.mk index c15e9291..1cb9ac35 100644 --- a/dev/virtio/vsock-rust/rules.mk +++ b/dev/virtio/vsock-rust/rules.mk @@ -6,7 +6,6 @@ MODULE_SRCS := \ MODULE_LIBRARY_DEPS := \ trusty/user/base/lib/liballoc-rust \ - trusty/user/base/lib/libpanic_abort-rust \ trusty/user/base/lib/trusty-std \ external/rust/crates/virtio-drivers \ diff --git a/make/rust-toplevel.mk b/make/rust-toplevel.mk index 98d870df..f2f48182 100644 --- a/make/rust-toplevel.mk +++ b/make/rust-toplevel.mk @@ -39,9 +39,8 @@ WRAPPER_RUSTFLAGS += $(addprefix --extern ,$(WRAPPER_RUST_EXTERN_PATHS)) # generate a .rs source file for the wrapper crate # we must not explicitly "extern crate" core or compiler_builtins CRATES_TO_IMPORT := $(filter-out core compiler_builtins,$(ALL_KERNEL_HOST_CRATE_STEMS) $(ALLMODULE_CRATE_STEMS_SORTED)) -RUST_WRAPPER_SRC := \#![feature(panic_abort)] \#![no_std] \ - $(foreach crate, $(CRATES_TO_IMPORT), extern crate $(subst .,_,$(crate));) \ - \#[panic_handler] fn handle_panic(_: &core::panic::PanicInfo) -> ! {loop {}} +RUST_WRAPPER_SRC := \#![no_std] \ + $(foreach crate, $(CRATES_TO_IMPORT), extern crate $(subst .,_,$(crate));) RUST_WRAPPER := $(BUILDDIR)/lk-crates.rs |