Skip to content

Commit

Permalink
cpufeatures: don't link std when linking libc (#1142)
Browse files Browse the repository at this point in the history
On AArch64, we link the `libc` crate to provide access to system call
wrappers which can query available CPU features from the kernel, since
those calls are protected on that CPU architecture.

We don't need `std` though, and it seems we're inadvertently linking it
on Linux, Android, and macOS.
  • Loading branch information
tarcieri authored Jan 24, 2025
1 parent 1517021 commit ca3d1c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpufeatures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ edition = "2018"
readme = "README.md"

[target.'cfg(all(target_arch = "aarch64", target_vendor = "apple"))'.dependencies]
libc = "0.2.155"
libc = { version = "0.2.155", default-features = false }

[target.'cfg(all(target_arch = "aarch64", target_os = "linux"))'.dependencies]
libc = "0.2.155"
libc = { version = "0.2.155", default-features = false }

[target.'cfg(all(target_arch = "loongarch64", target_os = "linux"))'.dependencies]
libc = "0.2.155"
libc = { version = "0.2.155", default-features = false }

[target.aarch64-linux-android.dependencies]
libc = "0.2.155"
libc = { version = "0.2.155", default-features = false }

0 comments on commit ca3d1c2

Please sign in to comment.