Browse Source

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.
pull/135/head
Ian Chamberlain 1 year ago
parent
commit
7cd4ae0deb
No known key found for this signature in database
GPG Key ID: AE5484D09405AA60
  1. 7
      ctru-rs/src/lib.rs

7
ctru-rs/src/lib.rs

@ -18,7 +18,6 @@
#![crate_type = "rlib"] #![crate_type = "rlib"]
#![crate_name = "ctru"] #![crate_name = "ctru"]
#![warn(missing_docs)] #![warn(missing_docs)]
#![feature(test)]
#![feature(custom_test_frameworks)] #![feature(custom_test_frameworks)]
#![feature(try_trait_v2)] #![feature(try_trait_v2)]
#![feature(allocator_api)] #![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. /// 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] #[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 static __stacksize__: usize = 2 * 1024 * 1024; // 2MB
macro_rules! from_impl { macro_rules! from_impl {

Loading…
Cancel
Save