]> Cypherpunks repositories - gostls13.git/commitdiff
os/user,net: add -fno-stack-protector to CFLAGS
authorThan McIntosh <thanm@google.com>
Mon, 12 Dec 2022 15:53:17 +0000 (10:53 -0500)
committerThan McIntosh <thanm@google.com>
Fri, 16 Dec 2022 17:45:51 +0000 (17:45 +0000)
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>
src/net/cgo_unix_cgo.go
src/os/user/cgo_lookup_cgo.go

index 3e7282b5794e974d3a626371bae4dfc3f4cdaaa2..97427e695d37594baf90dc77c6ea2990cf05e1e2 100644 (file)
@@ -7,6 +7,7 @@
 package net
 
 /*
+#cgo CFLAGS: -fno-stack-protector
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
index 7bb1da263edf6b85ec866cd89fd5a9d023f95987..4f78dcad23dbd9ff547a1e759a34c771e8a1b59b 100644 (file)
@@ -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>