Skip to content

Commit

Permalink
runtime/cgo: add -fno-stack-protector to CFLAGS
Browse files Browse the repository at this point in the history
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 golang#52919
Fixes golang#54313

Change-Id: I6f51d5e906503f61fc768ad8e30c163bad135087
Reviewed-on: https://go-review.googlesource.com/c/go/+/421935
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
  • Loading branch information
ianlancetaylor authored and gopherbot committed Aug 8, 2022
1 parent 3315066 commit 365ca69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/runtime/cgo/cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 365ca69

Please sign in to comment.