Skip to content

Commit 031e163

Browse files
authored
Increase Alpine stack size to 8MB (#8595)
The default in musl is apparently tiny, and MergeSimilarFunctions has recursion which can hit it. We can perhaps improve that pass to avoid recursion, but this change seems generally good for robustness. It just makes us use the usual 8 MB stack size on Linux that all other Linuxes use. Fixes #8594
1 parent 3990615 commit 031e163

File tree

3 files changed

+1903
-3
lines changed

3 files changed

+1903
-3
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ jobs:
221221

222222
# Run tests on Alpine Linux, which we use to make our release builds.
223223
# Note: Alpine uses musl libc.
224-
# Keep in sync with build_release.yml. The only difference is that here we
224+
# Keep in sync with create_release.yml. The only difference is that here we
225225
# do not have the "archive" and "upload tarball" jobs.
226226
build-alpine:
227227
name: alpine
@@ -259,8 +259,11 @@ jobs:
259259
run: ./alpine.sh pip3 install --break-system-packages -r requirements-dev.txt
260260

261261
- name: cmake
262+
# Build with an 8MB stack size, as otherwise Alpine/musl's default stack
263+
# size for pthreads is tiny,
264+
# https://github.com/WebAssembly/binaryen/issues/8594
262265
run: |
263-
./alpine.sh cmake . -G Ninja -DCMAKE_CXX_FLAGS="-static" -DCMAKE_C_FLAGS="-static" -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_LIB=ON -DBUILD_MIMALLOC=ON -DCMAKE_INSTALL_PREFIX=install
266+
./alpine.sh cmake . -G Ninja -DCMAKE_CXX_FLAGS="-static" -DCMAKE_C_FLAGS="-static" -DCMAKE_EXE_LINKER_FLAGS="-Wl,-z,stack-size=8388608" -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_LIB=ON -DBUILD_MIMALLOC=ON -DCMAKE_INSTALL_PREFIX=install
264267
265268
- name: build
266269
run: |

.github/workflows/create_release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ jobs:
108108
${{ steps.archive-arm64.outputs.SHASUM }}
109109
110110
# Build with gcc 6.3 and run tests on Alpine Linux (inside chroot).
111+
# Keep in sync with ci.yml.
111112
# Note: Alpine uses musl libc.
112113
build-alpine:
113114
name: alpine
@@ -145,8 +146,11 @@ jobs:
145146
run: ./alpine.sh pip3 install --break-system-packages -r requirements-dev.txt
146147

147148
- name: cmake
149+
# Build with an 8MB stack size, as otherwise Alpine/musl's default stack
150+
# size for pthreads is tiny,
151+
# https://github.com/WebAssembly/binaryen/issues/8594
148152
run: |
149-
./alpine.sh cmake . -G Ninja -DCMAKE_CXX_FLAGS="-static" -DCMAKE_C_FLAGS="-static" -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_LIB=ON -DBUILD_MIMALLOC=ON -DCMAKE_INSTALL_PREFIX=install
153+
./alpine.sh cmake . -G Ninja -DCMAKE_CXX_FLAGS="-static" -DCMAKE_C_FLAGS="-static" -DCMAKE_EXE_LINKER_FLAGS="-Wl,-z,stack-size=8388608" -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_LIB=ON -DBUILD_MIMALLOC=ON -DCMAKE_INSTALL_PREFIX=install
150154
151155
- name: build
152156
run: |

0 commit comments

Comments
 (0)