kripken / llvm.js

LLVM compiled to JavaScript using Emscripten

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working (no output)

4ntoine opened this issue · comments

I've cloned repository, opened demo.html and clicked "compile and run" button without changing the source code and i see green field with no any output. On demo page (http://kripken.github.io/llvm.js/demo.html) i can see "hello, world" green output. So what's wrong? What is LLVM.js project status?

If i made an error in .ll code it shows me red error, so bitcode is processed. If i fix an error, output field becomes green but previous error text is not cleared

tested on chrome, mac osx maverics

The project is not active from my perspective, sorry - i have no time to spend on it.

No problem. Can you explain in brief, how can i compile *.js files from LLVM/Clang sources? I believe it's not just like git clone LLVM/Clang sources and run ./emconfigure ./emmake, right?

yes, basically just like porting any other project using emscripten. but, you will need to handle tblgen which is built and run natively. need a parallel native build, and to take the executables from that. i think i mentioned that in the readme

ok i have finished emmake make (fixed all the "all-target" issues). i can't see any .bc files produced. what should i do after i finished emmake?

it should emit bitcode files. could have suffix .o or .so or .a

On Tue, Sep 23, 2014 at 9:14 AM, Anton Smirnov notifications@github.com
wrote:

ok i have finished emmake make (fixed all the "all-target" issues). i
can't see any .bc files produced. what should i do after i finished emmake?


Reply to this email directly or view it on GitHub
#2 (comment).

yes, i can see a lot if .o files in Release+Asserts. But in common build .o files are packed in lib*.a (using ar) and how to get according llvm static libs for JS?

Libs

oh, i can see also ./Release+Asserts/lib/lib*.a files which are not ar files - probably they are expected files. Since they are not common ar files (

MBA-Anton:build_local asmirnov$ lipo -info ../build_emscripten/Release+Asserts/lib/libclang.a
Segmentation fault: 11

) are they llvm bitcode archive?

Should they be renamed to .bc (as in projects build guide http://kripken.github.io/emscripten-site/docs/compiling/Building-Projects.html)?

Executables

Also in ./Release+Asserts/bin i can see files (f.e. lli, llc) which are not marked as executables. Are they llvm bitcode too? in common build they are interpreter and compiler accordingly

Final steps

I can't see "llvm" file in ./Release+Asserts/bin to be renamed to llvm.bc (https://github.com/kripken/llvm.js/blob/master/llvm.bc).

Thanks for helping me do it finally! I will publish my "update to LLVM 3.5 instructions" after all.

Great work @4ntoine! :-) Did you be able to compile clang? This would help to have toolchain on NodeOS! :-)

No, unfortunately

2014-10-02 16:15 GMT+06:00 Jesús Leganés Combarro notifications@github.com
:

Great work @4ntoine https://github.com/4ntoine! :-) Did you be able to
compile clang? This would help to have toolchain on NodeOS! :-)


Reply to this email directly or view it on GitHub
#2 (comment).

It's a shame, it would be really useful... :-(

Probably i will be able to do it if having answers to my questions

Let's wait, then :-)

I just got emscripten-fastcomp compiled with emscripten-fastcomp.
I'll commit a pull that updates to llvm3.4 soon :)

I've revised the code and tha latest commits and seems it's hosted the generated code, isn't it? How could it be done from the original source code? This way maybe it would be easy to maintain and have updated

The ir2js component is too old

So we only have to work with what's on this repo? :-/

Ahm we would have to compile fastcomp to js.
and use that.
It's super huge though...

note: it is possible to comiple emscripten-fastcomp with emscripten fastcomp.
But I guess we'd have to clean the result up pretty good. to run it in a browser reasonably.

I'm not interested on running it on the browser but on Node.js instead.

By the way, later it could be generated for the browser with browserify... :-)

that should be easier...
let me see if I can get llc to run on node.js
I remember that I got it to work with minor changes

I don't use IRC, but my email is in my profile :-)

okay.
I'll send you a mail with my patches if I can find them

Ok, thank you :-) I've seen that there are some commits of yours on your fork, could them be? Also I'm interested on using it on NodeOS, maybe I could make a fork and you can send the pull-request there and we can work there with them (publish as a npm package, add support for clang and so...), what do you think? :-)

Sure. I want to work on "selfhosting" emscripten again

https://github.com/jprendes/emception - this currently only works on Firefox but it works