diff options
author | Than McIntosh <thanm@google.com> | 2022-12-12 10:53:17 -0500 |
---|---|---|
committer | Than McIntosh <thanm@google.com> | 2022-12-16 17:45:51 +0000 |
commit | 8bcc490667d4dd44c633c536dd463bbec0a3838f (patch) | |
tree | a5167839ebf94057bad403c54f31f6c88371ff97 | |
parent | f4b42f5cb8b494a2b64a4ade89f89071d80c7fd3 (diff) | |
download | go-git-8bcc490667d4dd44c633c536dd463bbec0a3838f.tar.gz |
os/user,net: 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.
Updates #52919.
Updates #54313.
Fixes #57261.
Change-Id: Iaae731851407af4521fff2dfefc5b7e3e92cf284
Reviewed-on: https://go-review.googlesource.com/c/go/+/456855
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
-rw-r--r-- | src/net/cgo_unix_cgo.go | 1 | ||||
-rw-r--r-- | src/os/user/cgo_lookup_cgo.go | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/net/cgo_unix_cgo.go b/src/net/cgo_unix_cgo.go index 3e7282b579..97427e695d 100644 --- a/src/net/cgo_unix_cgo.go +++ b/src/net/cgo_unix_cgo.go @@ -7,6 +7,7 @@ package net /* +#cgo CFLAGS: -fno-stack-protector #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> diff --git a/src/os/user/cgo_lookup_cgo.go b/src/os/user/cgo_lookup_cgo.go index 7bb1da263e..4f78dcad23 100644 --- a/src/os/user/cgo_lookup_cgo.go +++ b/src/os/user/cgo_lookup_cgo.go @@ -12,6 +12,7 @@ import ( /* #cgo solaris CFLAGS: -D_POSIX_PTHREAD_SEMANTICS +#cgo CFLAGS: -fno-stack-protector #include <unistd.h> #include <sys/types.h> #include <pwd.h> |