I am investigating emscripten for a personal project, and I would like to use a language other than C or C++ to do so.
However, while I am investigating emscripten, I figured I should use a trivial 'hello world' example written in C.
I know that I should compile this using emcc:
$ python `which emcc` tmp.c
And this will generate a working a.out.js file for me. So far it's good.
However, I want to use a different language, which means I can't use emcc or emcc++, so I want to generate the llvm bitcode directly.
I have tried using clang 3.3, which is the current version on my mac os x 10.9.2 system, however the following does not work:
$ clang -S -emit-llvm tmp.c -o tmp.ll
$ python `which emcc` tmp.ll
warning: incorrect target triple 'x86_64-apple-macosx10.9.0' (did you use emcc/em++ on all source files and not clang directly?)
The warning is correct; I am indeed using clang directly, how do I do so regardless, so that I can then attempt to do the same thing in another language that also uses llvm?