The LEGALIZE_JS_FFI flag can't be used in many cases, e.g.
./emcc tests/hello_libcxx.cpp -s MAIN_MODULE=1 -s LEGALIZE_JS_FFI=0
crashes. The reason is that e.g. for rintf we emit f32 calls in the backend, since we are not legalizing. But the js library implementation for rintf has hardcoded doubles in src/library.js. So we end up with the wrong type. That method and others would need to be ifdefed for the non-legalizing case, or we could implement them in C.
cc @awtcode
The
LEGALIZE_JS_FFIflag can't be used in many cases, e.g.crashes. The reason is that e.g. for
rintfwe emit f32 calls in the backend, since we are not legalizing. But the js library implementation for rintf has hardcoded doubles insrc/library.js. So we end up with the wrong type. That method and others would need to be ifdefed for the non-legalizing case, or we could implement them in C.cc @awtcode