botan icon indicating copy to clipboard operation
botan copied to clipboard

unknown file type: botan-test.bc when converting tests to wasm

Open radekgs opened this issue 2 years ago • 1 comments

Following the instructions on https://botan.randombit.net/handbook/building.html#emscripten-webassembly, after successfully compiling the framework and trying to folllow the second step of converting the tests to wasm I get the following error:

~/git/botan$ em++ -s ALLOW_MEMORY_GROWTH=1 -s DISABLE_EXCEPTION_CATCHING=0 -s WASM=1 --preload-file src/tests/data botan-test.bc -o botan-test.html wasm-ld: error: unknown file type: botan-test.bc em++: error: '/home/radek/git/emsdk/upstream/bin/wasm-ld -o botan-test.wasm botan-test.bc -L/home/radek/git/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten -lGL -lal -lhtml5 -lstubs-debug -lc -lcompiler_rt -lc++ -lc++abi -ldlmalloc -lc_rt_wasm -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-cxx-exceptions -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --import-undefined --strip-debug --export-if-defined=main --export-if-defined=emscripten_stack_get_end --export-if-defined=emscripten_stack_get_free --export-if-defined=emscripten_stack_init --export-if-defined=stackSave --export-if-defined=stackRestore --export-if-defined=stackAlloc --export-if-defined=__wasm_call_ctors --export-if-defined=fflush --export-if-defined=__errno_location --export-if-defined=malloc --export-if-defined=free --export-if-defined=__cxa_is_pointer_type --export-if-defined=__cxa_can_catch --export-if-defined=setThrew --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-table -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=2147483648 --global-base=1024' failed (returned 1)

radekgs avatar Nov 18 '21 05:11 radekgs

Sorry for the long waiting time, @radekgs. Admittedly, we're no experts on WASM (, yet). It would be great if you could try out the patch we provided in #2864 and verify that this helps.

reneme avatar Dec 15 '21 08:12 reneme

If the mentioned patch did not help please reopen this issue and provide more information.

lieser avatar Sep 21 '22 10:09 lieser