gallium icon indicating copy to clipboard operation
gallium copied to clipboard

go get error

Open Charliego3 opened this issue 6 years ago • 6 comments

Throws an exception when I execute go get github.com/alexflint/gallium

Go build github.com/alexflint/gallium: invalid flag in #cgo LDFLAGS: -Wl,-rpath,@executable_path/../Frameworks

I can't find the specific reason now, I don't know where to start. go version: go version go1.10.3 darwin/amd64

Charliego3 avatar Sep 14 '18 05:09 Charliego3

Did you install git-lfs before running go get?

alexflint avatar Sep 15 '18 23:09 alexflint

Yes, these commands are executed successfully, no problem

Alex Flint [email protected] 于2018年9月16日周日 上午7:32写道:

Did you install git-lfs before running go get?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexflint/gallium/issues/63#issuecomment-421653901, or mute the thread https://github.com/notifications/unsubscribe-auth/AZhZeMmR-9hzkfBdsXdaSjnZZL5zn_tYks5ubY4cgaJpZM4WoqSa .

Charliego3 avatar Sep 18 '18 07:09 Charliego3

Same here

$ go version
go version go1.10 darwin/amd64
$ git lfs install
Git LFS initialized.
$ go get -v github.com/alexflint/gallium
github.com/alexflint/gallium
go build github.com/alexflint/gallium: invalid flag in #cgo LDFLAGS: -Wl,-rpath,@executable_path/../Frameworks

trietphm avatar Sep 23 '18 08:09 trietphm

Just revert back to go1.9 and go get works fine

trietphm avatar Sep 23 '18 09:09 trietphm

Seems like this is a result of a security-related patch in go 1.10 that whitelisted specific cgo comple/link flags: https://github.com/golang/go/issues/23749

alexflint avatar Sep 23 '18 16:09 alexflint

That flag really is insecure. An attacker can manipulate the program if they can get it to run in an unexpected directory. It's the kind of thing the whitelist is meant to prevent. For more information see https://golang.org/wiki/InvalidFlag .

ianlancetaylor avatar Sep 24 '18 14:09 ianlancetaylor