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?

Thanks.

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