Skip to content

Commit

Permalink
os/user,net: 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.

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>
  • Loading branch information
thanm committed Dec 16, 2022
1 parent f4b42f5 commit 8bcc490
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/net/cgo_unix_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package net

/*
#cgo CFLAGS: -fno-stack-protector
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
Expand Down
1 change: 1 addition & 0 deletions src/os/user/cgo_lookup_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 8bcc490

Please sign in to comment.