Closed vbhattaccmu closed 7 months ago
The way to solve this at the moment is precisely to build your own derived image from rust-optimizer, adding clang support to it.
@webmaster128 I think it could be a good idea to add clang support to the optimiser by default. It's being used by a number of crates that have C / C++ modules or dependencies. When compiling to wasm (and if these foreign modules support the wasm32 target), what seems to be happening is that the ffi links are being resolved to wasm code instead of native code.
Which is pretty cool, makes sense, and aligns pretty well with the WebAssembly paradigm.
You end up with an artefact in which some functionality comes from Rust, and some other from C / C++, all bundled together in a coherent, functional WebAssembly whole.
Related work / discussions: https://github.com/CosmWasm/rust-optimizer/pull/118.
Related work / discussions: #118.
Thanks @maurolacy , this solution worked for me!
When I compile and optimize a contract wasm binary using the latest rust-optimize release, I am running into this error:-
I am running the optimizer using this command
Seems like the image itself needs clang. Surprisingly I can build the binary inside a container built from the image hosted in main. Would appreciate if I could get any hints to resolving this.