Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
939ba635
Commit
939ba635
authored
Jan 16, 2019
by
Michael Droettboom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update dynCall_so.patch
parent
7eb7e084
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
41 deletions
+31
-41
emsdk/patches/dynCall_so.patch
emsdk/patches/dynCall_so.patch
+31
-41
No files found.
emsdk/patches/dynCall_so.patch
View file @
939ba635
diff --git a/emsdk/emscripten/tag-1.38.22/src/library.js b/emsdk/emscripten/tag-1.38.22/src/library.js
index 82537bb3e..8e2e43128 100644
--- a/emsdk/emscripten/tag-1.38.22/src/library.js
+++ b/emsdk/emscripten/tag-1.38.22/src/library.js
@@ -1781,6 +1781,12 @@
LibraryManager.library = {
}
}
+ for (var sym in lib_module) {
+ if (sym.startsWith('dynCall_') && !Module.hasOwnProperty(sym)) {
+ Module[sym] = lib_module[sym];
+ }
+ }
+
// Not all browsers support Object.keys().
var handle = 1;
for (var key in DLFCN.loadedLibs) {
diff --git a/emsdk/emscripten/tag-1.38.22/src/support.js b/emsdk/emscripten/tag-1.38.22/src/support.js
index cff68fbe2..3a4e51dca 100644
diff --git a/emsdk/emscripten/tag-1.38.22/src/support.js b//emsdk/emscripten/tag-1.38.22/src/support.js
index 8e1df8e82..4d07d6bef 100644
--- a/emsdk/emscripten/tag-1.38.22/src/support.js
+++ b/emsdk/emscripten/tag-1.38.22/src/support.js
@@ -211,9 +211,21 @@
function loadWebAssemblyModule(binary, loadAsync) {
if (prop.startsWith('invoke_')) {
// A missing invoke, i.e., an invoke for a function type
// present in the dynamic library but not in the main JS,
- // and the dynamic library cannot provide JS for it. Use
- // the generic "X" invoke for it.
- return env[prop] = invoke_X;
+ // and the dynamic library cannot provide JS for it. Generate
+ // a closure for it.
+ var dynCallName = 'dynCall_' + prop.slice(7);
+ env[prop] = function() {
+ var sp = stackSave();
+ try {
+ var args = Array.prototype.slice.call(arguments);
+ return Module[dynCallName].apply(null, args);
+ } catch(e) {
+ stackRestore(sp);
+ if (typeof e !== 'number' && e !== 'longjmp') throw e;
+ Module["setThrew"](1, 0);
@@ -437,7 +437,18 @@
function loadWebAssemblyModule(binary, flags) {
// present in the dynamic library but not in the main JS,
// and the dynamic library cannot provide JS for it. Use
// the generic "X" invoke for it.
- return env[prop] = invoke_X;
+ var dynCallName = 'dynCall_' + prop.slice(7);
+ return env[prop] = function() {
+ var sp = stackSave();
+ try {
+ var args = Array.prototype.slice.call(arguments);
+ return Module[dynCallName].apply(null, args);
+ } catch(e) {
+ stackRestore(sp);
+ if (typeof e !== 'number' && e !== 'longjmp') throw e;
+ Module["setThrew"](1, 0);
+ }
+ }
}
// if not a global, then a function - call it indirectly
return env[prop] = function() {
@@ -502,6 +513,11 @@
function loadWebAssemblyModule(binary, flags) {
}
#endif
}
+ if (e.startsWith("dynCall_")) {
+ if (!Module.hasOwnProperty(e)) {
+ Module[e] = value;
+ }
+ }
+ return env[prop]
;
exports[e] = value
;
}
// if not a global, then a function - call it indirectly
return env[prop] = function() {
// initialize the module
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment