[Interest] WASM build Error: Bad relocation type

Jason H jhihn at gmx.com
Fri May 28 17:11:41 CEST 2021

> However I blew away the build dir and did a full rebuild now and got:
> wasm-ld: error: initial memory too small, 21088512 bytes needed
> Command line contains: "--initial-memory=16777216 --no-entry --global-base=1024"
> Progress! :-) How do I change the memory setting [in QtCreator]? According to something I read on the internet,
> wasm {
> }
> Should fix it. But the commandline --inital-memory didn't change. Help?

Ok Success, kinda. It crashes.

Firat: Fixing the inital memory error:

wasm {
	QMAKE_TOTAL_MEMORY=21495808 # ignored for some reason

Then, when QtCreator attempts to start the page:
 /bin/sh /Users/jason/Projects/emsdk/upstream/emscripten/emrun --browser chrome --port 30000 --no_emrun_detect --serve_after_close /Users/jason/Projects/poc-ui-Qt_5_15_1_WebAssembly-Debug/poc-ui.html
from: can't read /var/mail/tools
/Users/jason/Projects/emsdk/upstream/emscripten/emrun: line 9: syntax error near unexpected token `__file__'
/Users/jason/Projects/emsdk/upstream/emscripten/emrun: line 9: `  python_selector.run(__file__)'

However, this confuses python (and me). Removing the /bin/sh from the QtCreator command line (at a console)gets it to start and load the page.
Leaving the /bin/sh in, gets you that `from: can't read /var/mail/tools`, because it is interpreting the python code as a shell script.

Being on Mac, I wondered if it was a zsh issue, but running a bash shell then the QtCreator command line, I get the same result.

Changing the "effective run call" in QtC did not help

More information about the Interest mailing list