I'm new to Emscripten and I'm running into a problem which probably has a
simple solution, yet I'm unable to find it.
I create a basic React JS app with create-react-app. I then want to use a
very simple .cpp file (just a noop at this point really, returning a
constant) which I
I am having trouble porting our application to asm.js. We have a class
that handles HTTP GETs for us, that I am trying to port using the
I can only get the asynchronous fetch to work, and only when called on the
main thread. I can't get synchronous to work at all.
__post_instantiate is a way to run code when the module is loaded. For
example it could run global constructors, which languages like C++ have.
This is necessary not just for dynamic linking but also a single file by
(wasm modules also have an optional start(), but that isn't good enough
Also, do you recommend the use of emscripten for "vanilla wasm" output or
should I stick with the original LLVM distrib ?
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it,
Thanks for the detailed answer,
I appreciate your help :)
I have some questions about that:
1) Are the global destructors called ?
2) Also, "__post_instantiate" seems to allocate the stack but the Vanilla
LLVM doesn't do that. Doesn't Wasm have its own default stack ?
And more :
3) How can I
Update on compile time:
-O2 - ~60 sec
-O3 - ~7 sec
Also I try to build project with WASM=1, and it built successfully,
but I can't run it due this error:
failed to asynchronously prepare wasm: LinkError: import object field
'__ZN6Editor10s_instanceE' is not a Number testing.html:161:40
Passing "-I /usr/local/include/" to emcc is definitely not correct.
Compiling to the web is a process of cross compilation, and the
headers you have in /usr/local/include/ refer to x86/x64 libraries,
and not WebAssembly targeted libraries. Not sure if that is the cause
of the error, though you
Hi. I use Firefox 54.0 to test my game that I compile from C++ to js. Js
size is 6.3Mb, when I open game in FF, then it compiles asm.js for very
Successfully compiled asm.js code (total compilation time 55703ms; stored
As you see I wait one minute before game starts, all
2017-08-08 18:13 GMT+03:00 Jukka Jylänki :
> If you want to run tests in a browser, you can use the emrun tool that
> is bundled to Emscripten (upstream at https://github.com/juj/emrun) to
> automate runs of a web page in a browser. Emrun is a browser drive
This looks like a performance bug in the browser. It may be possible
to reduce the compilation time, but without a test case it's not
possible to know what might be wrong. Is the project public somewhere?
One known source of slow compilation times is if one has very large
Hi, in my code there are several static libraries which were written by me.
I want to use web workers inside this libraries. Is there any chance to do
When I instantiate object from static lib in my main file and pass it to
web worker everything is ok, but when I do this inside static
The source is not public, but I think I can share result js if it's useful.
I will try to build WebAssembly and check.
2017-08-09 19:04 GMT+07:00 Jukka Jylänki :
> This looks like a performance bug in the browser. It may be possible
> to reduce the compilation time, but without
Thanks for your replies, I figured it out. It was related to some inline
assembly in the library as Alon suggested. Thanks again :).
On Tuesday, August 8, 2017 at 6:53:20 PM UTC+2, Eduardo Sorribas wrote:
> Hey folks!
> I'm trying to compile some parts of GNU MP to webassembly
First, thank you for the assistance!
-s NO_EXIT_RUNTIME=1 had no effect. Actually, I think you get that
automatically with -s USE_PTHREADS=1 don't you?
I switched to using pthreads directly with no effect either.
On Wednesday, August 9, 2017 at 12:35:20 PM UTC-7, jj wrote:
> First thing is
First thing is to remember to also compile with -s NO_EXIT_RUNTIME=1,
since once main() exits, it will tear down the application runtime,
along with all threads, so the linker flag will keep it running after
exiting main. I wonder if that already will solve the issue?
Another note is that C++11
Hmm, most of these should be present in the compiled code file? Also,
`importScripts` is a web built-in in Web Worker's global scope:
I wonder if React's linter needs to be taught that the app is run in a
Hmm, can you try specifying the following attributes for the download?
attr.attributes = EMSCRIPTEN_FETCH_LOAD_TO_MEMORY |
EMSCRIPTEN_FETCH_SYNCHRONOUS | EMSCRIPTEN_FETCH_REPLACE;
Also there is a linker flag -s FETCH_DEBUG=1 that can show more information.
2017-08-09 22:45 GMT+03:00 Scott
Ok, that’s interesting. The synchronous download worked on the background
thread. This works now with -s NO_EXIT_RUNTIME=1. It had no effect on the
asynchronous download on a background thread. I still get a call to
downloadFailed with a status of 0.
> On Aug 9, 2017, at 1:06 PM, Jukka
Have you ever been successfull in getting something compiled with
Emscripten to pass the React linter? I'm wondering if I'm just doing
something like not passing in the correct flag or something.
On Wednesday, August 9, 2017 at 12:39:51 PM UTC-7, jj wrote:
> Hmm, most of these should be
Sorry for my approximate english.
It is now possible to make a standalone WebAssembly file. I'm gladly to see
that is possible now with Emscripten, thanks. I can now make my own HTML
source content, with my own way to load the WebAssembly bytecode. But I
don't understand why the
I create worker with emscripten_create_worker inside C++ code.
It is not an special error. When I try to get access to string member of
class after passing to web worker. I just get TypeError: str is undefined.
It happens only if I pass member of class in static library. If I pass
It should be fine to create web workers with JS "new Worker(url);"
inside any code, be it main application code or statically linked
libraries. I have not heard of a "broken object" error before. What is
2017-08-09 15:22 GMT+03:00 :
> Hi, in my code there
Mail list logo