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>
This commit is contained in:
Than McIntosh 2022-12-12 10:53:17 -05:00
parent f4b42f5cb8
commit 8bcc490667
2 changed files with 2 additions and 0 deletions

View File

@ -7,6 +7,7 @@
package net
/*
#cgo CFLAGS: -fno-stack-protector
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

View 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>