Skip to content

Commit 19d792c

Browse files
aclementstoothrot
authored andcommitted
[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 <[email protected]>) Change-Id: I2d8cb7fb780de4cd37314af3957b8f429b1e4b70 Reviewed-on: https://go-review.googlesource.com/c/go/+/429138 Run-TryBot: Austin Clements <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 00ece11 commit 19d792c

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)