Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: go test returns "ld: warning: PIE disabled." on OSX #21918

Closed
aeneasr opened this issue Sep 18, 2017 · 6 comments
Closed

cmd/go: go test returns "ld: warning: PIE disabled." on OSX #21918

aeneasr opened this issue Sep 18, 2017 · 6 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin
Milestone

Comments

@aeneasr
Copy link

aeneasr commented Sep 18, 2017

What version of Go are you using (go version)?

go version go1.9 darwin/amd64

Does this issue reproduce with the latest release?

Yes, before Go 1.9 this problem did not exist.

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/aeneas/workspaces/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/c3/sys_sm612kg6mph4r640m_bc0000gn/T/go-build948664642=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

Since installing Go 1.9 (from source w/ gvm, brew, and binary from page) I get a warning when running go test. You should be able to reproduce this with:

go get github.com/ory/hydra
cd $GOPATH/src/github.com/ory/hydra
glide install
go test -short $(glide novendor)

What did you expect to see?

The test process running without warnings.

What did you see instead?

ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in type..eqfunc.[106]string from /var/folders/c3/sys_sm612kg6mph4r640m_bc0000gn/T/go-link-904935252/go.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
@aeneasr
Copy link
Author

aeneasr commented Sep 18, 2017

Also noteworthy, since Go 1.9 on Windows 10 64bit my Antivirus (Avira) detects a virus when running go test -short $(glide novendor) on the same project.

@ianlancetaylor ianlancetaylor changed the title Since go 1.9 go test returns "ld: warning: PIE disabled." on OSX cmd/go: go test returns "ld: warning: PIE disabled." on OSX Sep 18, 2017
@ianlancetaylor ianlancetaylor added NeedsFix The path to resolution is known, but the work has not been done. OS-Darwin NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed NeedsFix The path to resolution is known, but the work has not been done. labels Sep 18, 2017
@ianlancetaylor ianlancetaylor added this to the Go1.9.1 milestone Sep 18, 2017
@ianlancetaylor
Copy link
Contributor

Can you show us the output of go test -x -short $(glide novendor)?

@aeneasr
Copy link
Author

aeneasr commented Sep 19, 2017

Thanks!

@aeneasr aeneasr closed this as completed Sep 19, 2017
@rsc rsc modified the milestones: Go1.9.1, Go1.9.2 Oct 4, 2017
@rsc rsc reopened this Oct 13, 2017
@rsc
Copy link
Contributor

rsc commented Oct 13, 2017

Duplicate so removing milestone.

@rsc rsc modified the milestones: Go1.9.2, Go1.10 Oct 13, 2017
@rsc
Copy link
Contributor

rsc commented Oct 13, 2017

Fixed by 88a1e85

@rsc rsc closed this as completed Oct 13, 2017
@golang golang locked and limited conversation to collaborators Oct 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin
Projects
None yet
Development

No branches or pull requests

5 participants