• Kirill Smelkov's avatar
    __attribute__(constructor) actually works · 721c9332
    Kirill Smelkov authored
    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!
    libf.ffunc1
    libk.kfunc1 -> 12
    721c9332
Makefile 587 Bytes