-
Notifications
You must be signed in to change notification settings - Fork 165
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
Modernize emscripten usage ("env" "pthread_self": function import requires a callable) #293
Comments
I admit that I don't have a great reason for the way it is currently implemented other than it's simple and it works :) When I originally implemented it, I basically got a quick & dirty solution working and never bothered to change how the web worker or WASM module were set up after that. For what it's worth, I can compile and import just fine using emscripten 3.1.6, which was release in May of this year. I'm using the following command:
|
I'm having the same problem. I cannot reproduce the compiled |
@JiamingSuen I am also using version 3.1.6, and I am using the command below to compile it:
Can you try that command on your machine? |
I tried this command with Emscripten 3.1.60 on the current If our Emscripten version matches, is it possible that the current $ em++ --version
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.60 (42a6ea2052f19f70d7d994e8c324bcad2f1f8939) |
I just realized that you are using Emscripten 3.1.6, which is different from 3.1.60😂 By switching to 3.1.6, the compiled |
Ha, good catch! I will look into how I can make it work with a more current version, like 3.1.60. |
If I recompile with a new
emscripten
compiler version (3.1.64), I get the following error on importing the WebAssembly module:The reason for this is that a more recent
emscripten
(less than ~3 years old) compiler exports additional symbols that we are not defining when calling instantiate.When compiling as a regular module,
emscripten
will generate additional JS output file that actually loads all functions:This generates the following files:
The
sorter.js
file will actually load thesorter.wasm
file into aModule
variable. This variable can then be used to access defined C++ functions.This approach will be more future-proof, since the generated
.js
file will be different depending on the compiler version.I'd like to know if something like this was considered. And if it wasn't used, then why.
The text was updated successfully, but these errors were encountered: