-
Notifications
You must be signed in to change notification settings - Fork 21
libcompiler-rt on 3ds #2
Comments
I got Rust to play nice with MS-DOS and DJGPP, and I had the same issue. If I recall, my workaround was just to have rustc build object files, then link them to a "fake" compiler-rt implementation that only contains implementations for the functions that are missing from the libc flavor you're linking to. Sounds convoluted, but it's pretty simple in practice. No idea how to make that work with Cargo, though, my Rust on DJGPP project didn't make use of it. |
The rust3ds-template project has had a compiled libcompiler_rt included with it for some time that works, but I want to keep this issue open in case someone comes up with a better, automated solution that people can build in their own toolchain setup. |
This project shows some promise in that regard: https://github.com/japaric/compiler-rt.rs |
I find it a little weird that it comes in the form of a crate that gets linked in, but that is likely the most ergonomic solution to the problem. |
There's some building desire to make compiler-rt get built along with libcore itself (rust-lang/rust#34400) so hopefully it would be a temporary solution anyway. |
Do you know if compiler-rt.rs works for rust 3ds yet? I really can't remember all of the things I did to build the one being used in the project template right now, and all of it was wiped off my Mac accidentally. There were several specific tweaks in a custom target makefile I had to make. |
I tried it out and received the following error:
Both the linker and ar fields are set in 3ds.json so I don't know why it isn't picking up on that for the latter. |
Though to be honest, I think we're fine sticking with the precompiled compiler-rt for the time being. Apparently compiler-rt.rs will be integrated into xargo if all the kinks get worked out. |
This isn't directly related to this project, but in order to continue development on the 3DS in Rust, we need a libcompiler-rt.a compiled in such a way that it can be linked with arm-none-eabi-gcc. This is a show stopper once you get past very trivial code, because llvm emits calls into it for its intrinsics.
If someone has experience with that, contributions would be helpful. We can't really advance until that problem is resolved.
The text was updated successfully, but these errors were encountered: