From: Ian Lance Taylor Date: Mon, 8 Aug 2022 02:21:15 +0000 (-0700) Subject: runtime/cgo: add -fno-stack-protector to CFLAGS X-Git-Tag: go1.20rc1~1752 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=365ca6947287d2b8fd9ca49fef74a1297786e8b1;p=gostls13.git 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 #52919 Fixes #54313 Change-Id: I6f51d5e906503f61fc768ad8e30c163bad135087 Reviewed-on: https://go-review.googlesource.com/c/go/+/421935 Reviewed-by: Dmitri Shuralyov Auto-Submit: Ian Lance Taylor TryBot-Result: Gopher Robot Run-TryBot: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov --- 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