Skip to content

Commit

Permalink
Remove unecessary "unwinding" features from runtime crates
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Spinale <[email protected]>
  • Loading branch information
nspin committed Oct 31, 2024
1 parent 878b179 commit 9fddfdb
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 45 deletions.
4 changes: 2 additions & 2 deletions crates/examples/root-task/spawn-task/child/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ mk {
sel4-ctors-dtors
;
sel4-panicking = localCrates.sel4-panicking // {
features = [ "unwinding" "alloc" ];
features = [ "alloc" ];
};
sel4-runtime-common = localCrates.sel4-runtime-common // {
features = [ "start" "tls" "unwinding" ];
features = [ "start" "tls" ];
};
};
}
7 changes: 2 additions & 5 deletions crates/examples/root-task/spawn-task/child/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ cfg-if = "1.0.0"
sel4 = { path = "../../../../sel4" }
sel4-ctors-dtors = { path = "../../../../sel4-ctors-dtors" }
sel4-dlmalloc = { path = "../../../../sel4-dlmalloc" }
sel4-panicking = { path = "../../../../sel4-panicking", features = ["unwinding", "alloc"] }
sel4-panicking = { path = "../../../../sel4-panicking", features = ["alloc"] }
sel4-panicking-env = { path = "../../../../sel4-panicking/env" }
sel4-runtime-common = { path = "../../../../sel4-runtime-common", features = ["start", "tls"] }
sel4-sync = { path = "../../../../sel4-sync" }

[dependencies.sel4-runtime-common]
path = "../../../../sel4-runtime-common"
features = ["start", "tls", "unwinding"]
2 changes: 1 addition & 1 deletion crates/private/support/sel4-root-task-with-std/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mk {
sel4-panicking-env
sel4-ctors-dtors
;
sel4-runtime-common = localCrates.sel4-runtime-common // { features = [ "start" "tls" "unwinding" ]; };
sel4-runtime-common = localCrates.sel4-runtime-common // { features = [ "start" "tls" ]; };
};
features = {
single-threaded = [
Expand Down
5 changes: 1 addition & 4 deletions crates/private/support/sel4-root-task-with-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,4 @@ single-threaded = ["sel4/single-threaded"]
sel4 = { path = "../../../sel4" }
sel4-ctors-dtors = { path = "../../../sel4-ctors-dtors" }
sel4-panicking-env = { path = "../../../sel4-panicking/env" }

[dependencies.sel4-runtime-common]
path = "../../../sel4-runtime-common"
features = ["start", "tls", "unwinding"]
sel4-runtime-common = { path = "../../../sel4-runtime-common", features = ["start", "tls"] }
2 changes: 1 addition & 1 deletion crates/private/support/sel4-simple-task/runtime/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mk {
sel4-sync
sel4-ctors-dtors
;
sel4-runtime-common = localCrates.sel4-runtime-common // { features = [ "tls" "unwinding" ]; };
sel4-runtime-common = localCrates.sel4-runtime-common // { features = [ "tls" ]; };
};
target."cfg(not(target_arch = \"arm\"))".dependencies = {
sel4-backtrace = localCrates.sel4-backtrace // { features = [ "unwinding" "postcard" ]; };
Expand Down
2 changes: 1 addition & 1 deletion crates/private/support/sel4-simple-task/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sel4-dlmalloc = { path = "../../../../sel4-dlmalloc" }
sel4-immediate-sync-once-cell = { path = "../../../../sel4-immediate-sync-once-cell" }
sel4-panicking = { path = "../../../../sel4-panicking" }
sel4-panicking-env = { path = "../../../../sel4-panicking/env" }
sel4-runtime-common = { path = "../../../../sel4-runtime-common", features = ["tls", "unwinding"] }
sel4-runtime-common = { path = "../../../../sel4-runtime-common", features = ["tls"] }
sel4-simple-task-runtime-config-types = { path = "config/types" }
sel4-simple-task-runtime-macros = { path = "macros" }
sel4-simple-task-threading = { path = "../threading" }
Expand Down
2 changes: 1 addition & 1 deletion crates/private/tests/root-task/backtrace/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mk {
sel4
sel4-backtrace-embedded-debug-info
;
sel4-root-task = localCrates.sel4-root-task // { features = [ "unwinding" "alloc" ]; };
sel4-root-task = localCrates.sel4-root-task // { features = [ "alloc" ]; };
sel4-backtrace-simple = localCrates.sel4-backtrace-simple // { features = [ "alloc" ]; };
sel4-backtrace = localCrates.sel4-backtrace // { features = [ "full" ]; };
sel4-backtrace-types = localCrates.sel4-backtrace-types // { features = [ "full" ]; };
Expand Down
2 changes: 1 addition & 1 deletion crates/private/tests/root-task/backtrace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ sel4-backtrace = { path = "../../../../sel4-backtrace", features = ["full"] }
sel4-backtrace-embedded-debug-info = { path = "../../../../sel4-backtrace/embedded-debug-info" }
sel4-backtrace-simple = { path = "../../../../sel4-backtrace/simple", features = ["alloc"] }
sel4-backtrace-types = { path = "../../../../sel4-backtrace/types", features = ["full"] }
sel4-root-task = { path = "../../../../sel4-root-task", features = ["unwinding", "alloc"] }
sel4-root-task = { path = "../../../../sel4-root-task", features = ["alloc"] }
2 changes: 1 addition & 1 deletion crates/private/tests/root-task/panicking/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ mk {
inherit (versions) cfg-if;
inherit (localCrates)
sel4
sel4-root-task
;
sel4-root-task = localCrates.sel4-root-task // { features = [ "unwinding" ]; };
};
features = {
alloc = [ "sel4-root-task/alloc" ];
Expand Down
2 changes: 1 addition & 1 deletion crates/private/tests/root-task/panicking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ panic-unwind = []
[dependencies]
cfg-if = "1.0.0"
sel4 = { path = "../../../../sel4" }
sel4-root-task = { path = "../../../../sel4-root-task", features = ["unwinding"] }
sel4-root-task = { path = "../../../../sel4-root-task" }
5 changes: 0 additions & 5 deletions crates/sel4-microkit/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,8 @@ mk {
};
features = {
full = [
"unwinding"
"alloc"
];
unwinding = [
"sel4-panicking/unwinding"
"sel4-runtime-common/unwinding"
];
alloc = [
"sel4-panicking/alloc"
];
Expand Down
3 changes: 1 addition & 2 deletions crates/sel4-microkit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ license = "BSD-2-Clause"

[features]
alloc = ["sel4-panicking/alloc"]
full = ["unwinding", "alloc"]
unwinding = ["sel4-panicking/unwinding", "sel4-runtime-common/unwinding"]
full = ["alloc"]

[dependencies]
cfg-if = "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/sel4-microkit/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ unsafe extern "C" fn sel4_runtime_rust_entry() -> ! {

#[allow(unreachable_code)]
fn inner_entry() -> ! {
#[cfg(all(feature = "unwinding", panic = "unwind"))]
#[cfg(panic = "unwind")]
{
sel4_runtime_common::set_eh_frame_finder().unwrap();
}
Expand Down
4 changes: 2 additions & 2 deletions crates/sel4-panicking/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ mk {
build-dependencies = {
inherit (versions) rustc_version;
};
target."cfg(not(target_arch = \"arm\"))".dependencies = {
unwinding = unwindingWith [ "personality" ] // { optional = true; };
target."cfg(all(panic = \"unwind\", not(target_arch = \"arm\")))".dependencies = {
unwinding = unwindingWith [ "personality" ];
};
features = {
alloc = [];
Expand Down
3 changes: 1 addition & 2 deletions crates/sel4-panicking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ sel4-panicking-env = { path = "env" }
[build-dependencies]
rustc_version = "0.4.0"

[target."cfg(not(target_arch = \"arm\"))".dependencies.unwinding]
[target."cfg(all(panic = \"unwind\", not(target_arch = \"arm\")))".dependencies.unwinding]
version = "0.2.3"
default-features = false
features = ["unwinder", "fde-custom", "hide-trace", "personality"]
optional = true
2 changes: 1 addition & 1 deletion crates/sel4-panicking/src/strategy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//

cfg_if::cfg_if! {
if #[cfg(all(feature = "unwinding", panic = "unwind"))] {
if #[cfg(panic = "unwind")] {
mod unwind;
use unwind as imp;
} else {
Expand Down
5 changes: 0 additions & 5 deletions crates/sel4-root-task/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,8 @@ mk {
};
features = {
full = [
"unwinding"
"alloc"
];
unwinding = [
"sel4-panicking/unwinding"
"sel4-runtime-common/unwinding"
];
alloc = [
"sel4-panicking/alloc"
];
Expand Down
3 changes: 1 addition & 2 deletions crates/sel4-root-task/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ license = "BSD-2-Clause"

[features]
alloc = ["sel4-panicking/alloc"]
full = ["unwinding", "alloc"]
full = ["alloc"]
single-threaded = ["sel4/single-threaded"]
unwinding = ["sel4-panicking/unwinding", "sel4-runtime-common/unwinding"]

[dependencies]
sel4 = { path = "../sel4" }
Expand Down
2 changes: 1 addition & 1 deletion crates/sel4-root-task/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ unsafe extern "C" fn sel4_runtime_rust_entry(bootinfo: *const sel4::BootInfo) ->

#[allow(unreachable_code)]
fn inner_entry(bootinfo: *const sel4::BootInfo) -> ! {
#[cfg(all(feature = "unwinding", panic = "unwind"))]
#[cfg(panic = "unwind")]
{
sel4_runtime_common::set_eh_frame_finder().unwrap();
}
Expand Down
4 changes: 2 additions & 2 deletions crates/sel4-runtime-common/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ mk {
sel4 = localCrates.sel4 // { default-features = false; optional = true; };
sel4-initialize-tls = localCrates.sel4-initialize-tls // { features = [ "on-stack" ]; optional = true; };
};
target."cfg(not(target_arch = \"arm\"))".dependencies = {
unwinding = unwindingWith [] // { optional = true; };
target."cfg(all(panic = \"unwind\", not(target_arch = \"arm\")))".dependencies = {
unwinding = unwindingWith [];
};
features = {
tls = [ "dep:sel4-initialize-tls" "dep:sel4" ];
Expand Down
3 changes: 1 addition & 2 deletions crates/sel4-runtime-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ sel4-initialize-tls = { path = "../sel4-initialize-tls", features = ["on-stack"]
sel4-panicking-env = { path = "../sel4-panicking/env" }
sel4-stack = { path = "../sel4-stack" }

[target."cfg(not(target_arch = \"arm\"))".dependencies.unwinding]
[target."cfg(all(panic = \"unwind\", not(target_arch = \"arm\")))".dependencies.unwinding]
version = "0.2.3"
default-features = false
features = ["unwinder", "fde-custom", "hide-trace"]
optional = true
4 changes: 2 additions & 2 deletions crates/sel4-runtime-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ mod tls;
#[cfg(all(feature = "tls", target_thread_local))]
pub use tls::{initialize_tls_on_stack_and_continue, ContArg, ContFn};

#[cfg(all(feature = "unwinding", panic = "unwind"))]
#[cfg(panic = "unwind")]
mod unwinding;

#[cfg(all(feature = "unwinding", panic = "unwind"))]
#[cfg(panic = "unwind")]
pub use self::unwinding::set_eh_frame_finder;

#[allow(dead_code)]
Expand Down

0 comments on commit 9fddfdb

Please sign in to comment.