Closed FenrirWolf closed 1 year ago
Oh, this means we could avoid the call to ctru::init
at the start of programs.
Edit: seems like we can't. The issue is obviously with linking, the symbols aren't escalated since believed to be unused... having #[used(linker)]
available for functions too is a priority, most of our toolchain is based on that.
Hmm, that's unfortunate. It's also possible to override appInit
and appExit
themselves, and I wonder if that would work better since libctru calls those unconditionally. I'd try it out myself but I haven't worked out what the build process for the project is yet
One downside of using this feature is that then users can't use this, since the symbol would already be defined.
I'd try it out myself but I haven't worked out what the build process for the project is yet
It's pretty much take the rust-horizon rustc fork, compile locally and add to rustup, then use cargo-3ds for building and stuff. Plus the devkitpro installation. We should probably write this up somewhere.
We should probably write this up somewhere.
That would be good. I've already run into issues getting the thing to build so a place to talk about that would be nice too
One downside of using this feature is that then users can't use this, since the symbol would already be defined.
We could add our own safe hook, though for now it doesn’t matter.
We should probably write this up somewhere.
That would be good. I've already run into issues getting the thing to build so a place to talk about that would be nice too
We were waiting for Rust to merge our changes before making wikis, this way people would be able to just use cargo 3ds
on a nightly toolchain and be able to compile.
We could enable and use the GitHub discussions feature in the meantime.
It may work now, but due to the uncertainty of using the std
outside the main and wanting to leave the possibility of customization to the user, this issue is now obsolete. Didn't think I'd ever close this! 😄
Fun fact,
libctru
supports life before and aftermain
in the appInit and appExit functions. You can hook into this system by definingextern "C" fn userAppInit()
andextern "C" fn userAppExit()
functions and putting any* library-level setup/teardown code you want in them.*Well, some things in the Rust stdlib aren't safe to call before or after main. But 3DS service initialization and even panic hook registration should be fine to do there.