From ca3d1c2e8db9bc10e36ac991a31183ced4590a28 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Fri, 24 Jan 2025 14:13:01 -0700 Subject: [PATCH] cpufeatures: don't link `std` when linking `libc` (#1142) 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. --- cpufeatures/Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpufeatures/Cargo.toml b/cpufeatures/Cargo.toml index be64e4da..93e8b8e3 100644 --- a/cpufeatures/Cargo.toml +++ b/cpufeatures/Cargo.toml @@ -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 }