-
emsdk 3.1.54 I add |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
also when I review this js code: var loadDylibs = () => {
if (!dynamicLibraries.length) {
reportUndefinedSymbols();
return;
}
addRunDependency("loadDylibs");
dynamicLibraries.reduce((chain, lib) => chain.then(() => loadDynamicLibrary(lib, {
loadAsync: true,
global: true,
nodelete: true,
allowUndefined: true
})), Promise.resolve()).then(() => {
reportUndefinedSymbols();
removeRunDependency("loadDylibs");
});
}; seems if you want to do load-time dynamick link, you have to set the array but still have some problem. I set still confusing.. |
Beta Was this translation helpful? Give feedback.
-
however, I found that even if i am using load-time link, it would invoke here is dlsym function in js var __dlsym_js = (handle, symbol, symbolIndex) => {
symbol = UTF8ToString(symbol);
var result;
var newSymIndex;
var lib = LDSO.loadedLibsByHandle[handle];
if (!lib.exports.hasOwnProperty(symbol) || lib.exports[symbol].stub) {
dlSetError(`Tried to lookup unknown symbol "${symbol}" in dynamic lib: ${lib.name}`);
return 0;
}
newSymIndex = Object.keys(lib.exports).indexOf(symbol);
result = lib.exports[symbol];
if (typeof result == "function") {
var addr = getFunctionAddress(result);
if (addr) {
result = addr;
} else {
result = addFunction(result, result.sig);
GROWABLE_HEAP_U32()[((symbolIndex) >> 2)] = newSymIndex;
}
}
return result;
}; most importance call is |
Beta Was this translation helpful? Give feedback.
-
thanks myself, I figure out |
Beta Was this translation helpful? Give feedback.
thanks myself, I figure out
Module["dynamicLibraries"] = ["libffmpeg_simd.wasm"]
should be add in pre.js, everything work.remember add
-sAUTOLOAD_DYLIBS=1