New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile mruby with emscripten (or: how to include compiler in cross build) #5453
Comments
Examining the contents og And checking the build output, it seems
... so I guess I have missed something in the config ? |
Ok so it seems this use case is no really supported ? A cross build does not include the compiler and can not load code dynamically ? What would be involved with supporting a cross build that included the compiler ? |
Is #4486 useful to you? |
No, that PR does not include the compiler, like I noticed. By the way, I am now running successfully running an mruby REPL in the browser, so the compiler in included, but I have to do the manual step mentioned above. |
I think compiler has to be built using host environment, but it should be possible to build only the compiler as a separate build target and copy them like you suggested. |
Yes, and I wonder what needs to change in the build environment to allow this behavior. |
Hi, Have you solved your problem? Several months ago I successfully compiled the mruby compiler into WASM. It can execute ruby scripts which are dynamically inputted by the user (like Basically it first
I don't quite understand the meaning of your |
Right now I my mruby.cfg contains both a Build and a CrossBuild, and will fail when it tries to run the binaries in the host/bin dir (like If you have a config that allows me to skip this hack that wold be great. But it's working, you can test it at http://apone.org/toy/ (It even supports blocking IO, like |
Sorry for being late to reply.
MRuby::Toolchain.new('emscripten') do |conf|
toolchain :clang
conf.cc.command = 'emcc'
conf.cxx.command = 'em++'
conf.linker.command = 'em++'
conf.archiver.command = 'emar'
conf.gem :core => 'mruby-compiler' ## << add this line
end |
Thank you, now it builds. |
I just replaced the gem line with |
FYI, 'p' is in the |
I am trying to build mruby for the web using emscripten, but I get two undefined symbols;
Emscripten works differently than normal c-compilers so errors like this are not too uncommon, but I just wonder;
Is there anything special about those two functions compared to other mrb-functions, since those are the only ones giving me trouble ?
The text was updated successfully, but these errors were encountered: