I have two libraries (with C compatible interface) written in Rust that I'm trying to integrate into an iOS app.
When integrating the two .a files in the same project, I get errors because symbols from the Rust standard library are now present multiple times:
duplicate symbol _rust_eh_personality in:
/Users/x/Development/ios-client/Y/Rust/lib1_ffi.a(lib1_ffi.0.o)
/Users/x/Development/ios-client/Y/Rust/lib2_ffi.a(lib2_ffi.0.o)
...
How can this be solved? Could the Rust symbols be extracted into a separate library? Or can the symbols be namespaced?
At the time of this posting, the prevalent theory is that this issue occurs when Link-Time Optimization (LTO) is enabled and is caused by a bug in the static libraries that rustc produces (link).
As a temporary measure, it has been suggested that LTO should not be enabled until this issue has been resolved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With