From b0c4b6ef461ea4c7c75ac8f7c259247f24b4b5c7 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Thu, 2 Apr 2026 22:32:49 +0100 Subject: [PATCH] fix(std): avoid AT_MINSIGSTKSZ on uclibc targets --- library/std/src/sys/pal/unix/stack_overflow.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/sys/pal/unix/stack_overflow.rs b/library/std/src/sys/pal/unix/stack_overflow.rs index 5d53de7fb7e2..3b951899dfec 100644 --- a/library/std/src/sys/pal/unix/stack_overflow.rs +++ b/library/std/src/sys/pal/unix/stack_overflow.rs @@ -305,7 +305,7 @@ pub unsafe fn drop_handler(data: *mut libc::c_void) { } /// Modern kernels on modern hardware can have dynamic signal stack sizes. - #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg(all(any(target_os = "linux", target_os = "android"), not(target_env = "uclibc")))] fn sigstack_size() -> usize { let dynamic_sigstksz = unsafe { libc::getauxval(libc::AT_MINSIGSTKSZ) }; // If getauxval couldn't find the entry, it returns 0, @@ -315,7 +315,7 @@ fn sigstack_size() -> usize { } /// Not all OS support hardware where this is needed. - #[cfg(not(any(target_os = "linux", target_os = "android")))] + #[cfg(not(all(any(target_os = "linux", target_os = "android"), not(target_env = "uclibc"))))] fn sigstack_size() -> usize { libc::SIGSTKSZ }