Skip to content

Commit 48f4728

Browse files
committed
cmd/cgo: add -fno-stack-protector to CFLAGS (again)
Add -fno-stack-protector back to the default set of CFLAGS for cgo, so as to avoid problems with internal linking locating the library containing the "__stack_chk_fail_local" support function that some compilers emit (the specific archive can vary based on GOOS). Updates #52919. Updates #54313. Updates #57261. Updates #58385. Change-Id: I4591bfb15501f04b7afe1fcd50c4fb93c86db63d Reviewed-on: https://go-review.googlesource.com/c/go/+/466935 Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Than McIntosh <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 7d57a9c commit 48f4728

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+
// Use -fno-stack-protector to avoid problems locating the
27+
// proper support functions. See issues #52919, #54313, #58385.
28+
#cgo CFLAGS: -Wall -Werror -fno-stack-protector
2729
2830
#cgo solaris CPPFLAGS: -D_POSIX_PTHREAD_SEMANTICS
2931

0 commit comments

Comments
 (0)