Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make emcc work?

When I tried to use emcc to compile a C code into Javascript, I received the following error:

emcc tests/hello_world.c 
CRITICAL root: fastcomp in use, but LLVM has not been built with the JavaScript backend as a target, llc reports:
===========================================================================
LLVM (http://llvm.org/):
  LLVM version 3.5.1
  Optimized build with assertions.
  Built Feb 22 2015 (00:08:56).
  Default target: x86_64-apple-darwin13.4.0
  Host CPU: corei7-avx

  Registered Targets:
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64
===========================================================================
CRITICAL root: you can fall back to the older (pre-fastcomp) compiler core, although that is not recommended, see https://github.com/kripken/emscripten/wiki/LLVM-Backend
INFO     root: (Emscripten: Running sanity checks)
CRITICAL root: failing sanity checks due to previous fastcomp failure

How to solve this? How to fallback to pre-fast-comp?

like image 724
Adam Lee Avatar asked Apr 17 '15 14:04

Adam Lee


1 Answers

I solved the same error while I was building Emscripten manually from source.

Emscripten uses its own fork of LLVM - Fastcomp; build it from source by following the instructions here. Then edit ~/.emscripten to have LLVM_ROOT like this

LLVM_ROOT = os.path.expanduser('/home/yourpath/to/emscripten-fastcomp/build/Release/bin') # directory

(it can even be /home/yourpath/to/emscripten-fastcomp/build/bin)

like image 62
abcoep Avatar answered Sep 29 '22 02:09

abcoep