Webclient: Set default stack size to 1 MB

Newer emscripten versions now only give a 64 KB stack by default (https://github.com/emscripten-core/emscripten/pull/18191)
Older emscripten versions gave a 5 MB stack by default, so we can allocate 4 MB more for use by the game itself
This commit is contained in:
UnknownShadow200 2024-01-10 19:49:39 +11:00
parent 1c4a3c067a
commit 936abbf453
3 changed files with 8 additions and 5 deletions

View file

@ -11,6 +11,12 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Install packages
shell: bash
run: |
sudo dpkg --add-architecture i386
sudo apt-get -y update
sudo apt-get -y install gcc-multilib libx11-dev:i386 libxi-dev:i386 libgl1-mesa-dev:i386
- name: Compile 32 bit Linux builds - name: Compile 32 bit Linux builds
shell: bash shell: bash
id: compile id: compile
@ -18,9 +24,6 @@ jobs:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn" COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
NIX32_FLAGS: "-no-pie -fno-pie -m32 -fvisibility=hidden -fcf-protection=none -rdynamic -DCC_BUILD_ICON" NIX32_FLAGS: "-no-pie -fno-pie -m32 -fvisibility=hidden -fcf-protection=none -rdynamic -DCC_BUILD_ICON"
run: | run: |
sudo dpkg --add-architecture i386
sudo apt-get -y update
sudo apt-get -y install gcc-multilib libx11-dev:i386 libxi-dev:i386 libgl1-mesa-dev:i386
LATEST_FLAG=-DCC_COMMIT_SHA=\"$(git rev-parse --short "$GITHUB_SHA")\" LATEST_FLAG=-DCC_COMMIT_SHA=\"$(git rev-parse --short "$GITHUB_SHA")\"
cd src cd src

View file

@ -26,7 +26,7 @@ ifeq ($(PLAT),web)
CC=emcc CC=emcc
OEXT=.html OEXT=.html
CFLAGS=-g CFLAGS=-g
LDFLAGS=-s WASM=1 -s NO_EXIT_RUNTIME=1 -s ALLOW_MEMORY_GROWTH=1 --js-library src/interop_web.js LDFLAGS=-s WASM=1 -s NO_EXIT_RUNTIME=1 -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_STACK=1Mb --js-library src/interop_web.js
endif endif
ifeq ($(PLAT),mingw) ifeq ($(PLAT),mingw)

View file

@ -235,7 +235,7 @@ Install SDL2 port if needed
#### Web #### Web
```emcc *.c -s ALLOW_MEMORY_GROWTH=1 --js-library interop_web.js``` ```emcc *.c -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_STACK=1Mb --js-library interop_web.js```
The generated javascript file has some issues. [See here for how to fix](doc/compile-fixes.md#webclient-patches) The generated javascript file has some issues. [See here for how to fix](doc/compile-fixes.md#webclient-patches)