From 7cd4ae0deb994afbb025c4e667df7a30e04b609b Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Wed, 9 Aug 2023 23:47:25 -0400 Subject: [PATCH] Fix link error with multiply-defined stack size We don't want to define __stacksize__ more than once, since the linker will reject it even if the definition is the same. For some reason this seems to link fine with devkitARM release 62, but not 61 (which is the version in the latest upstream docker images). This is probably safer anyway, since there are technically two copies of `ctru-rs` at play here. --- ctru-rs/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 87e1343..aeda735 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -18,7 +18,6 @@ #![crate_type = "rlib"] #![crate_name = "ctru"] #![warn(missing_docs)] -#![feature(test)] #![feature(custom_test_frameworks)] #![feature(try_trait_v2)] #![feature(allocator_api)] @@ -40,7 +39,11 @@ extern crate shim_3ds; /// /// This value was chosen to support crate dependencies which expected more stack than provided. It's suggested to use less stack if possible. #[no_mangle] -#[cfg(feature = "big-stack")] +// When building lib tests, we don't want to redefine the same symbol twice, +// since ctru-rs is both the crate under test and a dev-dependency (non-test). +// We might also be able to use #[linkage] for similar effect, but this way +// works without depending on another unstable feature. +#[cfg(all(feature = "big-stack", not(test)))] static __stacksize__: usize = 2 * 1024 * 1024; // 2MB macro_rules! from_impl {