uniffi-rs
uniffi-rs copied to clipboard
FR: Support bitcode for library mode bindings generation
trafficstars
When using LTO and especially the -Clinker-plugin-lto option, object files are emitted as LLVM bitcode and not machine code.
Currently, uniffi_bindgen only supports proper machine code and fails to extract metadata from object files that contain LLVM bitcode and fails with a Unknown library format.
https://github.com/mozilla/uniffi-rs/blob/305454d6a451326f981ecfa295c78f154e85bb09/uniffi_bindgen/src/macro_metadata/extract.rs#L27-L35
Since the binary metadata extraction is currently solely based on goblin capabilities, I was wondering:
- Does it makes sense for uniffi to support bitcode ? a. Given that it contains all required metadata as in normal machine code.
- What would be the way to implement it as I am not sure that the
goblincrate would accept bitcode support.