Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getauxval isn't defined on uclibc, so disable dynamic feature detection #1805

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub(crate) fn features() -> Features {
any(
target_os = "android",
target_os = "fuchsia",
target_os = "linux",
all(target_os = "linux", not(target_env = "uclibc")),
target_os = "windows"
)
))]
Expand Down
15 changes: 12 additions & 3 deletions src/cpu/arm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,18 @@
allow(dead_code)
)]

// uclibc: When linked statically, uclibc doesn't provide getauxval.
// When linked dynamically, recent versions do provide it, but we
// want to support older versions too. Assume that if uclibc is being
// used, this is an embedded target where the user cares a lot about
// minimizing code size and also that they know in advance exactly
// what target features are supported, so rely only on static feature
// detection.

#[cfg(all(
briansmith marked this conversation as resolved.
Show resolved Hide resolved
any(target_os = "android", target_os = "linux"),
any(target_arch = "aarch64", target_arch = "arm")
any(target_arch = "aarch64", target_arch = "arm"),
not(target_env = "uclibc")
))]
fn detect_features() -> u32 {
use libc::c_ulong;
Expand Down Expand Up @@ -196,7 +205,7 @@
any(
target_os = "android",
target_os = "fuchsia",
target_os = "linux",
all(target_os = "linux", not(target_env = "uclibc")),

Check warning on line 208 in src/cpu/arm.rs

View check run for this annotation

Codecov / codecov/patch

src/cpu/arm.rs#L208

Added line #L208 was not covered by tests
target_os = "windows"
),
any(target_arch = "arm", target_arch = "aarch64")
Expand Down Expand Up @@ -251,7 +260,7 @@
any(
target_os = "android",
target_os = "fuchsia",
target_os = "linux",
all(target_os = "linux", not(target_env = "uclibc")),
target_os = "windows"
)
))]
Expand Down
Loading