Likewise, if you're using wasm32-unknown-unknown instead of emscripten (as wasm-bindgen is only compatible with the former), you have no libc
This comment (from initial commit of the project in Nov 2020) may need to be revised as wasm-bindgen does now have support for the emscripten target (since March 2026).
I am not familiar with information conveyed here regarding emscripten + wasm-bindgen support for printf-compat, but assume that you'd be providing a printf symbol from a rust method backed by printf-compat for C/C++ to have access to at link time, and thus wasm-bindgen would be providing that for the emscripten target? 🤷♂️
The comment is present in the following two locations:
|
- Likewise, if you're using `wasm32-unknown-unknown` instead of emscripten |
|
(as wasm-bindgen is only compatible with the former), you have no libc. If |
|
you want to interface with a C library, you'll have to do it all yourself. |
|
With this crate, that turns into 5 lines instead of hundreds for `printf`. |
|
//! - Likewise, if you're using `wasm32-unknown-unknown` instead of emscripten |
|
//! (as wasm-bindgen is only compatible with the former), you have no libc. If |
|
//! you want to interface with a C library, you'll have to do it all yourself. |
|
//! With this crate, that turns into 5 lines instead of hundreds for `printf`. |
This comment (from initial commit of the project in Nov 2020) may need to be revised as
wasm-bindgendoes now have support for the emscripten target (since March 2026).I am not familiar with information conveyed here regarding
emscripten+wasm-bindgensupport forprintf-compat, but assume that you'd be providing aprintfsymbol from a rust method backed byprintf-compatfor C/C++ to have access to at link time, and thuswasm-bindgenwould be providing that for the emscripten target? 🤷♂️The comment is present in the following two locations:
printf-compat/README.md
Lines 22 to 25 in a6f6aad
printf-compat/src/lib.rs
Lines 17 to 20 in a6f6aad