From: Austin Clements Date: Wed, 7 Sep 2022 16:19:53 +0000 (-0400) Subject: [release-branch.go1.19] runtime/cgo: add -fno-stack-protector to CFLAGS X-Git-Tag: go1.19.2~11 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=19d792c1eb4342895f9d41d03ab931e9e26c7d78;p=gostls13.git [release-branch.go1.19] runtime/cgo: add -fno-stack-protector to CFLAGS Some compilers default to having -fstack-protector on, which breaks when using internal linking because the linker doesn't know how to find the support functions. Fixes #54764 (Original fix by Ian Lance Taylor ) Change-Id: I2d8cb7fb780de4cd37314af3957b8f429b1e4b70 Reviewed-on: https://go-review.googlesource.com/c/go/+/429138 Run-TryBot: Austin Clements TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- diff --git a/src/runtime/cgo/cgo.go b/src/runtime/cgo/cgo.go index 298aa63675..4b7046e2cc 100644 --- a/src/runtime/cgo/cgo.go +++ b/src/runtime/cgo/cgo.go @@ -23,7 +23,9 @@ package cgo #cgo solaris LDFLAGS: -lxnet #cgo solaris LDFLAGS: -lsocket -#cgo CFLAGS: -Wall -Werror +// We use -fno-stack-protector because internal linking won't find +// the support functions. See issues #52919 and #54313. +#cgo CFLAGS: -Wall -Werror -fno-stack-protector #cgo solaris CPPFLAGS: -D_POSIX_PTHREAD_SEMANTICS