WASI rust-lld: error: duplicate symbol: malloc

I'm using WebAssembly to provide user defined functions for a database so I'm not using bindgen or a browser. It's been working great. I have been using the target wasm32-unknown-unknown but wanted to check out WASI but when I go go compile with the wasm32-wasi target I get the following error.

rust-lld: error: duplicate symbol: malloc

I define my own malloc function for allocating so I'm guessing WASI supplies it's own malloc. Any idea how to handle that? Should I just be using the WASI supplied malloc?


Unless you have special requirements, you should be able to delete your malloc() function and use the standard library's allocator.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.