Extend small stack workaround to netbsd

This commit is contained in:
Fabian Boehm 2024-08-15 18:29:06 +02:00
parent 835f907cd4
commit 980ef6f2f1

View File

@ -184,9 +184,13 @@ fn have_gettext(target: &Target) -> Result<bool, Box<dyn Error>> {
/// 0.5 MiB is small enough that we'd have to drastically reduce MAX_STACK_DEPTH to less than 10, so
/// we instead use a workaround to increase the main thread size.
fn has_small_stack(_: &Target) -> Result<bool, Box<dyn Error>> {
#[cfg(not(target_os = "macos"))]
#[cfg(not(any(target_os = "macos", target_os = "netbsd")))]
return Ok(false);
// NetBSD 10 also needs this but can't find pthread_get_stacksize_np.
#[cfg(target_os = "netbsd")]
return Ok(true);
#[cfg(target_os = "macos")]
{
use core::ffi;