Commit de232252 authored by Kirill Smelkov's avatar Kirill Smelkov

DSO -> DSO linking works with https://github.com/kripken/emscripten/pull/7512

parent bed54e91
......@@ -29,11 +29,7 @@ all : $(TARGET)/prog.js
$(TARGET)/libf_so.$(SO) : libf.c
$(CC) -s SIDE_MODULE=1 -DLIBF_COMPILE -o $@ $<
# FIXME RUNTIME_LINKED_LIBS does not work for SIDE_MODULE=1
# Currently it is worked around with __attribute__(constructor) in libk.c
#
# TODO teach emscripten/support.js:loadDynamicLibrary() to check loaded
# module.dynamicLibraries and further load dependent shared libs automatically.
# linking libk_so -> libf_so needs https://github.com/kripken/emscripten/pull/7512 to work
$(TARGET)/libk_so.$(SO) : libk.c libf.h $(TARGET)/libf_so.$(SO)
$(CC) -s SIDE_MODULE=1 -s RUNTIME_LINKED_LIBS="['libf_so.$(SO)']" -DLIBK_COMPILE -o $@ $<
......
......@@ -28,6 +28,8 @@
// Runtime essentials
//========================================
// === Body ===
var ASM_CONSTS = [];
......
......@@ -28,6 +28,10 @@
// Runtime essentials
//========================================
if (!Module['dynamicLibraries']) Module['dynamicLibraries'] = [];
Module['dynamicLibraries'] = ["libf_so.js"].concat(Module['dynamicLibraries']);
// === Body ===
var ASM_CONSTS = [];
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,21 +4,6 @@
#include <emscripten.h>
#if 0
// XXX should be in make, but currently emscripten cannot do this
__attribute__((constructor))
static void init() {
// XXX EM_ASM does not work in wasm mode
# if 0
EM_ASM({
loadDynamicLibrary('libf_so.js');
});
#else
emscripten_run_script("loadDynamicLibrary('libf_so.wasm')");
# endif
}
#endif
LIBKAPI
int kfunc1() {
ffunc1();
......
No preview for this file type
No preview for this file type
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
No preview for this file type
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment