-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: Building application fails because invoking external linker doesn't honor CGO_LDFLAGS env variable #5205
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
Labels
Milestone
Comments
Ugorji, do you use "#cgo LDFLAGS:...", or are you setting CGO_LDFLAGS in the calling environment? I do the latter in llgo (no pkg-config available, LDFLAGS are dynamic), and I'm getting the same error. Seems the problem is that cgo doesn't look for CGO_LDFLAGS, and so it gets missed when the _cgo_flags file is written. This file is used for recording flags for external linking. I have a CL incoming which should fix that particular issue... but it wouldn't fix Issue 5224. |
This issue was closed by revision afb49aa. Status changed to Fixed. |
Comment 6 by manoj.dayaram@moovweb.com: I'm currently working off the tip (and also tried this on the latest release candidate) and I still get this issue. As per suggested by the original issue, I tried running go build -ldflags -extldflags=-L/path/to/my/libs And that worked fine, but running a normal go build gave me the same error: /usr/bin/ld: cannot find -lsass /usr/bin/ld: cannot find -lonig collect2: ld returned 1 exit status /home/noj/.gvm/gos/gotip/pkg/tool/linux_amd64/6l: running gcc failed: unsuccessful exit status 0x100 Is this change not represented in the latest tip or go1.1rc2? If so, will it be available for go1.1? Thanks. |
Comment 8 by manoj.dayaram@moovweb.com: Ah, I think I figured it out. It seems it sometimes works and sometimes doesn't. When I run "go build" from a directory inside the GOPATH path, then it works fine. If I run it outside of the GOPATH path, then it fails. I will open up a separate issue for this, thank you for your help. |
Comment 9 by manoj.dayaram@moovweb.com: I have created a new issue: https://golang.org/issue/5428 |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: