EMCC version 1.38.31

How to properly compile C to asm.js, with a sample from Wikipedia 
<https://en.wikipedia.org/wiki/Asm.js#Code_generation>.

// input.c
int f(int i) {
  return i + 1;
}


Expected result:
// output.js
function f(i) {
  "use asm";
  i = i | 0;
  return (i + 1) | 0;
}

I have tried to compile it with(see below) and generates huge JavaScript 
file with ~5K lines of code

emcc input.c -o output.js \
  -s INVOKE_RUN=0 \
  -s EXPORTED_FUNCTIONS="['_f']" \
  -s WASM=0 # causes the compiler to target asm.js


-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/ab23c223-21a0-4d3b-abaf-954b547cd8a9%40googlegroups.com.

Reply via email to