Hi,

I am currently trying to convert my so far biggest C++ project to 
javascript. I have some experience with Emscripten by now but thise here 
gives me headaches. I tried for one day, but no success.
The problem is as follows:

I have a library containing a few megabytes of C++ code (so pretty big). It 
compiles fine on Visual Studio 2013, Intel Composer 14, GCC4.8, Clang 
3.3... All can run it with assertion, valgrind does not notify any issue, 
Intel Memory Analyzer does not report one either.
Now when I compile it to Javascript with Emscripten the weirdest things 
happen. It plays sound, but the graphics is totally screwed up and the game 
just doesn't work. I tried with all optimization options, debug info, 
SAFE_HEAP, typed arrays settings, alignment, function pointer aliasing, 
etc... No success. No error reported, no exception thrown, it just doesn't 
work. Same for any browser too, so not a Chrome issue.


NOW, my last resort is "Autodebug", which proposedly should be able to 
track down such issues (personally i believe its an Emscripten bug, since 
everythign else works flawlessly). But I can't get it to work. When I 
generate the Bitcode file with emscripten, how can I possibly run this file 
with a normal CPU?
I tried "lli", "llc" and so on. "lli" even crashes on the most simple 
applications (like a main() routine that fills a std::string vector with 
the apssed arguments, what gives?) with an error like this:

lli: /home/natalie/Documents/llvm/lib/ExecutionEngine/JIT/JIT.cpp:622: void 
llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, const 
llvm::MutexGuard&): Assertion `!isAlreadyCodeGenerating && "Error: 
Recursive compilation detected!"' failed.
0  lli             0x0000000000d1a9ef
1  lli             0x0000000000d1aee9
2  libpthread.so.0 0x00007fc73cc37030
3  libc.so.6       0x00007fc73bf2c475 gsignal + 53
4  libc.so.6       0x00007fc73bf2f6f0 abort + 384
5  libc.so.6       0x00007fc73bf25621 __assert_fail + 241
6  lli             0x000000000085168c
7  lli             0x0000000000851799 
llvm::JIT::getPointerToFunction(llvm::Function*) + 265
8  lli             0x000000000085a13e
9  lli             0x000000000085bc4b
10 lli             0x000000000058cb21
11 lli             0x0000000000cb44df 
llvm::FPPassManager::runOnFunction(llvm::Function&) + 607
12 lli             0x0000000000cb7a1b 
llvm::FunctionPassManagerImpl::run(llvm::Function&) + 139
13 lli             0x0000000000cb7b99 
llvm::FunctionPassManager::run(llvm::Function&) + 105
14 lli             0x0000000000850f77 
llvm::JIT::jitTheFunction(llvm::Function*, llvm::MutexGuard const&) + 39
15 lli             0x00000000008515dc 
llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard 
const&) + 28
16 lli             0x0000000000851799 
llvm::JIT::getPointerToFunction(llvm::Function*) + 265
17 lli             0x000000000085a6b6
18 lli             0x0000000000625fdd
19 lli             0x0000000000625afa X86CompilationCallback + 74
Stack dump:
0. Program arguments: 
/home/natalie/Documents/llvm/build/Release+Asserts/bin/lli ./SNES.bc 
1. Running pass 'X86 Machine Code Emitter' on function 
'@_ZNSt3__18ios_base4InitC2Ev'


Like I always get the "recusive compilation" bit here...

With "llc" I always get "inavlid instruction" or "Target doesnt support 
this output file".

Now I have somewhat reached the end. I have no idea what else to try.

So please tell me, how do I get "autodebug" to work on a main() routine 
with an "std::vector" for starters? because right now this seems like a 
lost cause.

Thanks :)

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to