I have a static library which was compiled from a rust no_std project. It exposes a C interface and generally should be fine to be included in other projects. I can only use it as a static library because it has certain compiler flags.
I now want to link to it from another Rust application (which uses std). Unfortunately, I get many duplicate symbols errors, like:
You can do a partial link (ld -r) keeping all public symbols only. But it doesn't sound like your first library is no_std if it has __rust_alloc.
And I'll repeat my previous advise:
If you want to change the compile flags for a single crate that's not the top crate, you should modify cargo or run rustc manually for all the crates in your dependency tree.