Different in JavaScript code emitting between emcc and em++

137 views
Skip to first unread message

Xuejie Xiao

unread,
Nov 8, 2012, 11:47:19 AM11/8/12
to emscripte...@googlegroups.com
Hi guys,

I'm now working on a hobby project to port mruby onto a browser via emscripten. The source code is at https://github.com/xxuejie/mruby-browser.

The code is now working, but I found a strange behaviour: if I use emcc to compile the c code into JavaScript, the final js file would run forever on Node.js. But if I change to use em++, everything works just fine.

The same code is compiled and run successfully on clang/clang++ as a native application, so I suppose this is not cause by the original LLVM compiler. So I want to ask if anyone could give me a hint on how to compare the js code emitted by emcc and em++? I tried to take a look at the js code directly, but it is a ~7MB file without optimizing-_- I really appreciate it if someone could show me a direction to go:)

Thanks for your help. Wish everyone had a great time hacking emscripten!

Xuejie Xiao

Alon Zakai

unread,
Nov 8, 2012, 2:12:50 PM11/8/12
to emscripte...@googlegroups.com
You might be able to just diff the two outputs. Perhaps to make it simpler, prevent name mangling in C++ (extern "C" around all functions), and do not run with closure compiler.

Regardless, please file a bug with the code if you can, I am very curious what could cause this.

- azakai

Xuejie Xiao

unread,
Nov 8, 2012, 2:23:11 PM11/8/12
to emscripte...@googlegroups.com
Hi azakai,

Thanks very much for your reply. The original mruby code already prevents name mangling, and I didn't run the closure compiler. Anyway, I will try to diff again the two outputs and see if I can found something. And I'd like to fire a bug on this.
Reply all
Reply to author
Forward
0 new messages