I'm working on a compiler project that requires testing some stuff with Rust. I have some LLVM passes that can only be ran out-of-tree. So after the pass, I still have to obtain object files and then binaries. I don't know how to link the object files (I don't suppose there's a way to do it with Rust). I've tried doing it with cc and clang but they scream back about link errors. I was wondering whether anyone has ever done manual linking or has any idea how I can do this any other easier way. I've been able to succeed with small files but for large programs, it's been a disaster.
What kind of link errors? Clang doesn't really care about what language emitted the bitcode, I've successfully used it with bitcode files that I wrote manually or generated from a toy language. Maybe you forgot to link against the Rust standard library?
The size of the programs being linked shouldn't matter. Is file size really the only difference between the two cases?
Rust does support linking against code generated from other languages. You may want to look at the cc crate, with which you can invoke a C compiler from a build.rs build script.
Generally speaking, if you get an undefined reference, you need to either include an object module or library on the link command line that defines this symbol, or you need to remove/replace whichever module references the symbol.
_Unwind_Resume@@GCC_3.0 smells like a symbol defined in libgcc.a (it's part of the GCC runtime library's stack unwinding code), so perhaps you'll have to link with -lgcc. However, it's also possible that the module that references it shouldn't have been included in the first place, so it would be helpful if you copied and pasted the exact error, particularly the part that says where the symbol is being referenced.