Cargo static library with bitcode

I'm trying to get pure bitcode (for a specific triple) out of cargo, preferably including all dependencies, so a lot like static library, but without coff/elf/macho objects, but bitcode files in the static library. Is there a way to accomplish this?

I saw

cargo rustc --lib -- --emit=llvm-bc

in a post from a very long time ago but that doesn't seem to do it for me, the .lib file only has coff files in it.

(not looking for embedded bitcode btw, looking for pure bitcode I can potentially pass to say llc/opt/lld)

1 Like