I opened a PR with my changes :
https://github.com/kripken/emscripten/pull/5001
Le vendredi 3 mars 2017 16:17:14 UTC+1, Alexandre Perrot a écrit :
>
> I have looked at the embind issue with async wasm compilation.
>
> I was able to identify three (mostly ?) separate issues here :
>
>
> - First, compiling with --bind produces code that doesn't initialize
> properly. And that, even if the code does not use embind at all.
> So, normal code compiled with --bind is not working.
> What happens is that a big portion of code is generated differently
> when specifying --bind. It does not happen with only --std=c++11, though,
> so I don't really know how embind can change the compilation output that
> much.
> To give an example of a change that breaks initialization :
> var _main = Module["_main"] = function() { return
> Module["asm"]["_main"].apply(null, arguments) };
> becomes :
> var _main = Module["_main"] = asm["_main"];
> To fix that in a compiled code, I simply copied the worling version of
> the code portion and added the lines for the missing symbols.
> Once this is fixed, code compiled with --bind not using embind will
> initialize and run normally (at least the hello world I tested).
> - Second issue is with initialization of code that uses embind.
> The error given is "No dynCall invoker for signature..."
> When looking for an invoker in requireFunction, embind uses the asm
> global object.
> Replacing asm with Module["asm"] fixed the issue.
> After that, code using embind initializes correctly.
> - However (and this is the third issue), functions called through
> embind do nothing. I am still investigating this one, maybe it is just due
> to the runtime exiting.
>
> For now, I don't know how to fix the first issue for good and I am not
> entirely sure about my fix for the second one.
>
> Will keep you updated.
>
> Le jeudi 23 février 2017 22:21:57 UTC+1, Alon Zakai a écrit :
>>
>> Hi everyone,
>>
>> Embind is a tool emscripten has that helps connect C++ and JS,
>>
>>
>> https://kripken.github.io/emscripten-site/docs/porting/connecting_cpp_and_javascript/embind.html
>>
>> The original creators have been less active lately, and it seems that
>> currently it is no longer actively maintained. In particular, issues get
>> filed about embind that sometimes get no response.
>>
>> On the positive side, that issues get filed means this is a feature that
>> people want. Also, we do have good testing for embind and what is tested
>> should work perfectly. And while there are other mechanisms for connecting
>> C++ and JS - ccall/cwrap for simple calls, the WebIDL binder for binding
>> C++ to JS - embind does a bunch of things that have no alternative
>> currently.
>>
>> So embind is definitely a useful and usable feature now, however, without
>> filed issues being triaged and fixed, and no new development, that might
>> change eventually. For example, a specific issue I noticed over the last
>> few days was that async wasm compilation - a new feature - doesn't work in
>> embind, we need help with things like that.
>>
>> The bottom line is that for embind to keep up with emscripten
>> development, it needs someone to work on it. Is someone interested to help
>> out?
>>
>> - Alon
>>
>
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.