]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.19] runtime/cgo: add -fno-stack-protector to CFLAGS
authorAustin Clements <austin@google.com>
Wed, 7 Sep 2022 16:19:53 +0000 (12:19 -0400)
committerJenny Rakoczy <jenny@golang.org>
Tue, 13 Sep 2022 17:33:29 +0000 (17:33 +0000)
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>
src/runtime/cgo/cgo.go

index 298aa6367530cc44ec7c649262979756bdf6786e..4b7046e2cc62db0e47d818ff085fa1a84488dca2 100644 (file)
@@ -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