Skip to content

Commit 365ca69

Browse files
ianlancetaylorgopherbot
authored andcommitted
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 <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 3315066 commit 365ca69

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/runtime/cgo/cgo.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ package cgo
2323
#cgo solaris LDFLAGS: -lxnet
2424
#cgo solaris LDFLAGS: -lsocket
2525
26-
#cgo CFLAGS: -Wall -Werror
26+
// We use -fno-stack-protector because internal linking won't find
27+
// the support functions. See issues #52919 and #54313.
28+
#cgo CFLAGS: -Wall -Werror -fno-stack-protector
2729
2830
#cgo solaris CPPFLAGS: -D_POSIX_PTHREAD_SEMANTICS
2931

0 commit comments

Comments
 (0)