Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Error in webassembly compilation
When I build my project in webassembly with Qt 5.13.0 and emscripten sdk 1.38.27-64bit I get a very very very long output that ends with this:
(func $legalfunc$_llvm_bswap_i64 (; 47925 ;) (; has Stack IR ;) (param $0 i64) (result i64) (i64.or (i64.extend_i32_u (call $legalimport$_llvm_bswap_i64 (i32.wrap_i64 (local.get $0) ) (i32.wrap_i64 (i64.shr_u (local.get $0) (i64.const 32) ) ) ) ) (i64.shl (i64.extend_i32_u (call $getTempRet0) ) (i64.const 32) ) ) ) ) Fatal: error in validating output shared:ERROR: '.../emsdk/clang/e1.38.27_64bit/binaryen/bin/asm2wasm ./Application.temp.asm.js --total-memory=16777216 --trap-mode=clamp -O3 --mem-init=./Application.js.mem --mem-base=1024 --wasm-only -o ./Application.wasm --mvp-features' failed (1)
The last line being an error, any idea what's going wrong?
Trying to increase total memory as suggested here: https://github.com/WebAssembly/binaryen/issues/1968
(It's done in .pro file by setting
QMAKE_WASM_TOTAL_MEMORYdidn't change the value of
asm2wasmtrying it manually
LinkError: WebAssembly.instantiate(): memory import 732 is smaller than initial 16384, got 256when I try to open my application in browser, it seems to be related to increasing
TOTAL_MEMORY(https://github.com/emscripten-core/emscripten/issues/5069) I don't understand if I can't increase
TOTAL_MEMORYwhy it's suggested in the other github thread I linked earlier.
It's working now, I had to manually add
Makefile. I hope I'll find a better way cause otherwise I have to do it after each
I was able to run a big mobile application I wrote last year in webassembly, it's fantastic how it worked out of the box.
lorn.potter last edited by lorn.potter
You can either update your Qt, or apply this patch to your Qt:
Then you can set the total memory in yoru .pro file using
5.13.1 is not released as an stable Qt version and I'm using 5.13.0 (latest stable version) so I applied the patch. Thanks!