Closed ian-h-chamberlain closed 1 year ago
It'd be great! I'll try when I can.
It works! I've opened 3 PRs for the case:
That's great! It looks like from your changes that it still requires a function from the given crate to be imported, is that correct? Otherwise we might as well just delete the init
function entirely from here and rust-linker-fix-3ds
. See also my comment https://github.com/rust3ds/ctru-rs/pull/92#discussion_r1106437245
Wow, I'm surprised it works, since I still ran into issues and had to open this issue: https://github.com/rust-lang/rust/issues/94348
yeah, I think the intention (based on https://github.com/rust-lang/rust/issues/94348#issuecomment-1079794684) was always that #[no_mangle]
functions should no be discarded by the compiler, so the use cases for #[used]
are primarily on static
variables? but it seems like enough stuff got moved around that it works how we want it to now?
@AzureMarker I wonder if you would still be able to reproduce that issue or not given that this seems to be working for the 3ds libs now.
but it seems like enough stuff got moved around that it works how we want it to now?
That’s my guess. The “fix” for that issue completely revamped the linking setup made by the compiler.
I feel like a weight has been lifted from the toolchain!
It looks like https://github.com/rust-lang/rust/issues/47384 has been fixed since 1.62, so I wonder if we might be able to rely on
#[no_mangle]
and drop all theinit()
functions we needed to export everything? Same might apply forrust-linker-fix-3ds
but this crate has a lot more of them so maybe a better place to start testing.