Skip to content

Commit 8b6e018

Browse files
authored
build: increase C thread stack size on linux (#23676)
* build: increase thread stack size when running alpine linux * review feedback: force a stack size of 8M on all linux distribs * fix missing extldflags
1 parent 64da037 commit 8b6e018

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

build/ci.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ func buildFlags(env build.Environment) (flags []string) {
260260
if runtime.GOOS == "darwin" {
261261
ld = append(ld, "-s")
262262
}
263+
// Enforce the stacksize to 8M, which is the case on most platforms apart from
264+
// alpine Linux.
265+
if runtime.GOOS == "linux" {
266+
ld = append(ld, "-extldflags", "-Wl,-z,stack-size=0x800000")
267+
}
263268
if len(ld) > 0 {
264269
flags = append(flags, "-ldflags", strings.Join(ld, " "))
265270
}

0 commit comments

Comments
 (0)