Skip to content

Commit 9492606

Browse files
committed
Only enable the linux-raw-sys dependency in take-charge mode.
Avoid directly depending on linux-raw-sys in non-take-charge mode.
1 parent 85f3e2c commit 9492606

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include = ["src", "Cargo.toml", "COPYRIGHT", "LICENSE*", "/*.md"]
1515
rust-version = "1.84"
1616

1717
[dependencies]
18-
linux-raw-sys = { version = "0.9.2", default-features = false, features = ["general", "no_std", "elf"] }
18+
linux-raw-sys = { version = "0.9.2", default-features = false, optional = true, features = ["general", "no_std", "elf"] }
1919
rustix = { version = "1.0.0", default-features = false }
2020
bitflags = { version = "2.4.0", default-features = false }
2121
log = { version = "0.4.14", default-features = false, optional = true }
@@ -79,7 +79,7 @@ optimize_for_size = []
7979
#
8080
# To use threads, it is also necessary to enable the "thread" feature.
8181
# To use signals, it is also necessary to enable the "signal" feature.
82-
take-charge = ["rustix/use-explicitly-provided-auxv", "rustix/runtime"]
82+
take-charge = ["linux-raw-sys", "rustix/use-explicitly-provided-auxv", "rustix/runtime"]
8383

8484
# Enable "take-charge" mode using origin's `_start` definition.
8585
origin-start = ["take-charge"]

src/program/libc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
use alloc::boxed::Box;
3333
#[cfg(feature = "program-at-exit")]
3434
use core::ptr::null_mut;
35-
use linux_raw_sys::ctypes::c_int;
35+
use libc::c_int;
3636

3737
/// Register a function to be called when [`exit`] is called.
3838
#[cfg(feature = "program-at-exit")]

0 commit comments

Comments
 (0)