aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2022-09-07 12:19:53 -0400
committerJenny Rakoczy <jenny@golang.org>2022-09-13 17:33:29 +0000
commit19d792c1eb4342895f9d41d03ab931e9e26c7d78 (patch)
tree29fbe1bbda1ecf54f6cc9e8d0fe73f4b8a0e118e
parent00ece11be14efe4a97d59633c3df5e0d0c6674da (diff)
downloadgo-19d792c1eb4342895f9d41d03ab931e9e26c7d78.tar.gz
go-19d792c1eb4342895f9d41d03ab931e9e26c7d78.zip
[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 <iant@golang.org>) Change-Id: I2d8cb7fb780de4cd37314af3957b8f429b1e4b70 Reviewed-on: https://go-review.googlesource.com/c/go/+/429138 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
-rw-r--r--src/runtime/cgo/cgo.go4
1 files changed, 3 insertions, 1 deletions
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