{"action":"opened","issue":{"url":"https://api.github.com/repos/golang/go/issues/15433","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/15433/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/15433/comments","events_url":"https://api.github.com/repos/golang/go/issues/15433/events","html_url":"https://github.com/golang/go/issues/15433","id":150770177,"number":15433,"title":"cmd/go: go install -buildmode=pie fails with permission denied","user":{"login":"petercolberg","id":5453048,"avatar_url":"https://avatars.githubusercontent.com/u/5453048?v=3","gravatar_id":"","url":"https://api.github.com/users/petercolberg","html_url":"https://github.com/petercolberg","followers_url":"https://api.github.com/users/petercolberg/followers","following_url":"https://api.github.com/users/petercolberg/following{/other_user}","gists_url":"https://api.github.com/users/petercolberg/gists{/gist_id}","starred_url":"https://api.github.com/users/petercolberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petercolberg/subscriptions","organizations_url":"https://api.github.com/users/petercolberg/orgs","repos_url":"https://api.github.com/users/petercolberg/repos","events_url":"https://api.github.com/users/petercolberg/events{/privacy}","received_events_url":"https://api.github.com/users/petercolberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-25T07:10:51Z","updated_at":"2016-04-25T07:10:51Z","closed_at":null,"body":"I am trying to compile and install a position-dependent executable (PIE) of a minimal Go program:\r\n```go\r\n// hello.go\r\npackage main\r\n\r\nimport \"fmt\"\r\n\r\nfunc main() {\r\n    fmt.Println(\"hello world\")\r\n}\r\n```\r\n\r\nI am using Go 1.6.1 on Debian unstable amd64:\r\n```\r\n# export GOPATH=$PWD\r\n# export GOBIN=$PWD/_install\r\n# go env\r\nGOARCH=\"amd64\"\r\nGOBIN=\"/tmp/hello/_install\"\r\nGOEXE=\"\"\r\nGOHOSTARCH=\"amd64\"\r\nGOHOSTOS=\"linux\"\r\nGOOS=\"linux\"\r\nGOPATH=\"/tmp/hello\"\r\nGORACE=\"\"\r\nGOROOT=\"/usr/lib/go\"\r\nGOTOOLDIR=\"/usr/lib/go/pkg/tool/linux_amd64\"\r\nGO15VENDOREXPERIMENT=\"1\"\r\nCC=\"gcc\"\r\nGOGCCFLAGS=\"-fPIC -m64 -pthread -fmessage-length=0\"\r\nCXX=\"g++\"\r\nCGO_ENABLED=\"1\"\r\n```\r\n\r\nCompiling the executable works fine:\r\n```\r\n# go build -v -buildmode=pie\r\nruntime/internal/sys\r\nruntime/internal/atomic\r\nruntime\r\nerrors\r\ninternal/race\r\nsync/atomic\r\nmath\r\nunicode/utf8\r\nsync\r\nsyscall\r\nio\r\nstrconv\r\ntime\r\nreflect\r\nos\r\nfmt\r\nruntime/cgo\r\n_/tmp/hello\r\n# ./hello \r\nhello world\r\n```\r\n\r\nCompiling and installing the executable fails with this error:\r\n```\r\n# go install -v -buildmode=pie\r\nruntime/internal/sys\r\ngo install runtime/internal/sys: mkdir /usr/lib/go/pkg/linux_amd64_shared: permission denied\r\n```"}}