overdrivenpotato / rust-psp

Rust on PSP. Panic and allocation support. Access PSP system libraries.
Other
638 stars 33 forks source link

Core support #111

Closed Lucky4Luuk closed 2 years ago

Lucky4Luuk commented 2 years ago

In the README it mentions core support. Doing cargo psp -Z build-std=core fails, however, and so does cargo psp -Z build-std=core,alloc (without alloc, I get a few more errors about alloc not being available, I imagine to use core I also have to enable the alloc crate). I'm using the latest version of the library, with the embedded-graphics feature enabled.

I get the following error:

error[E0463]: can't find crate for `panic_unwind`
  --> C:\Users\luukv\.cargo\registry\src\github.com-1ecc6299db9ec823\psp-0.2.1\src\lib.rs:25:36
   |
25 | #[cfg(not(feature = "stub-only"))] extern crate panic_unwind;
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: language item required, but not found: `eh_personality`
  |
  = note: this can occur when a binary crate with `#![no_std]` is compiled for a target where `eh_personality` is defined in the standard library
  = help: you may be able to compile for a target that doesn't need `eh_personality`, specify a target with `--target` or in `.cargo/config`

Any idea what this means?

overdrivenpotato commented 2 years ago

It looks like you're overriding the flags that cargo psp provides to cargo. By default, running cargo psp will build core, along with panic_unwind, etc, fixing those errors.

Try running just cargo psp instead without the flags.

Lucky4Luuk commented 2 years ago

I see. When I was not trying to build core myself, I got an error from a no_std library (glam) that core was missing, so I figured I had to enable it myself.

overdrivenpotato commented 2 years ago

Out of curiosity, were you able to get a PSP project to build with glam as a dependency?

Lucky4Luuk commented 2 years ago

I did not manage to build it with glam, without glam everything was fine. I'll do some more testing tomorrow, otherwise I'll just pick a different math library :)

Lucky4Luuk commented 2 years ago

Other no_std libraries seem to work fine (I couldn't resist testing some more today), must be because glam is a little weird in no_std.

sajattack commented 2 years ago

Nice! Yeah glam would probably need some extra work. I've messed with fontdue and hecs, oddio should work too but hasn't been tested.