Commit 76b7f605 authored by Kirill Smelkov's avatar Kirill Smelkov

Linking libk -> libf (via RUNTIME_LINKED_LIBS) did not work

wasm@deco:~/trydynlib$ make -B
emcc -s WASM=0 -s SIDE_MODULE=1 -DLIBF_COMPILE -o libf_so.js libf.c
emcc -s WASM=0 -s SIDE_MODULE=1 -s RUNTIME_LINKED_LIBS="['libf_so.js']" -DLIBK_COMPILE -o libk_so.js libk.c
warning: unexpected number of arguments 0 in call to 'ffunc1', should be 1
emcc -s WASM=0 -s MAIN_MODULE=1 -s RUNTIME_LINKED_LIBS="['libk_so.js']" -o prog.js prog.c
warning: unexpected number of arguments 0 in call to 'kfunc1', should be 1

wasm@deco:~/trydynlib$ node prog.js
prog!
external function 'ffunc1' is missing. perhaps a side module was not linked in? if this function was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment
external function 'ffunc1' is missing. perhaps a side module was not linked in? if this function was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment
exception thrown: abort("external function 'ffunc1' is missing. perhaps a side module was not linked in? if this function was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment") at Error
    at jsStackTrace (/home/wasm/trydynlib/prog.js:1135:13)
    at stackTrace (/home/wasm/trydynlib/prog.js:1152:12)
    at abort (/home/wasm/trydynlib/prog.js:106462:44)
    at _ffunc1 (eval at loadDynamicLibrary (/home/wasm/trydynlib/prog.js:330:15), <anonymous>:58:33)
    at _kfunc1 (eval at loadDynamicLibrary (/home/wasm/trydynlib/prog.js:330:15), <anonymous>:192:2)
    at asm._kfunc1 (eval at loadDynamicLibrary (/home/wasm/trydynlib/prog.js:330:15), <anonymous>:213:23)
    at _kfunc1 (/home/wasm/trydynlib/prog.js:7564:278)
    at _main (/home/wasm/trydynlib/prog.js:30421:8)
    at Object.asm._main (/home/wasm/trydynlib/prog.js:105715:21)
    at Object.callMain (/home/wasm/trydynlib/prog.js:106292:30)
parent 462cb27f
......@@ -18,12 +18,12 @@ libf_so.$(SO) : libf.c
$(CC) -s SIDE_MODULE=1 -DLIBF_COMPILE -o $@ $<
libk_so.$(SO) : libk.c libf.h libf_so.$(SO)
$(CC) -s SIDE_MODULE=1 -DLIBK_COMPILE -o $@ $<
$(CC) -s SIDE_MODULE=1 -s RUNTIME_LINKED_LIBS="['libf_so.$(SO)']" -DLIBK_COMPILE -o $@ $<
# FIXME link in libf_so in libk_so
prog.js : prog.c libk_so.$(SO)
$(CC) -s MAIN_MODULE=1 -s RUNTIME_LINKED_LIBS="['libk_so.$(SO)', 'libf_so.$(SO)']" -o $@ prog.c
$(CC) -s MAIN_MODULE=1 -s RUNTIME_LINKED_LIBS="['libk_so.$(SO)']" -o $@ prog.c
.PHONY : FORCE
......
......@@ -1533,7 +1533,7 @@ Module["preloadedAudios"] = {}; // maps url to audio data
if (!Module['dynamicLibraries']) Module['dynamicLibraries'] = [];
Module['dynamicLibraries'] = ["libk_so.js","libf_so.js"].concat(Module['dynamicLibraries']);
Module['dynamicLibraries'] = ["libk_so.js"].concat(Module['dynamicLibraries']);
addOnPreRun(function() {
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