-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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/ld: -X flag broken #8806
Labels
Milestone
Comments
CL https://golang.org/cl/142680043 mentions this issue. |
CL https://golang.org/cl/144630044 mentions this issue. |
Owner changed to @rsc. Status changed to Started. |
CL https://golang.org/cl/145420043 mentions this issue. |
This issue was closed by revision df781cc. Status changed to Fixed. |
I'm actually still seeing an issue here. Am I doing something wrong, or is this not actually fixed? ➜ go build -ldflags="-X BuildTag TEST" x.go # command-line-arguments missing Go type information for global symbol: BuildTag size 16 ➜ go version go version devel +5450f6b00f00 Fri Sep 26 13:50:53 2014 -0400 darwin/amd64 ➜ cat x.go package main import "fmt" var ( BuildTag = "dev" ) func main() { fmt.Println(BuildTag) } |
Ok, there is in fact still a bug here (or at least a change in behavior since 1.3). When you specify an overwrite for a package your build doesn't actually use, there is a type error. The same set of commands and files builds fine under 1.3, and also worked on tip until earlier this week when the changes that broke the -X flag were committed. ➜ cat ~/go/src/github.com/bgentry/gotag/gotag.go package gotag var ( BuildTag = "dev" ) ➜ cat ~/go/src/github.com/bgentry/gotag/sub/sub.go package main import "fmt" func main() { fmt.Println("hello") } ============== The behavior on 1.3.2: ➜ go version go version go1.3.2 darwin/amd64 ➜ go build -ldflags="-X github.com/bgentry/gotag.BuildTag TEST" github.com/bgentry/gotag/sub (no error) ============== Now, on tip: ➜ go version go version devel +5450f6b00f00 Fri Sep 26 13:50:53 2014 -0400 darwin/amd64 ➜ go build -ldflags="-X github.com/bgentry/gotag.BuildTag TEST" github.com/bgentry/gotag/sub # github.com/bgentry/gotag/sub missing Go type information for global symbol: github.com/bgentry/gotag.BuildTag size 16 |
Thanks, Blake. I filed issue #8820 and issue #8821 for these. (The tests around linking are in flux right now, so it'll may be easier to let that stabilize before fixing.) |
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jun 25, 2018
This fixes the test/linkx.go test, which does not run by default. (Issue 4139 is about fixing that.) Fixes golang#8806. LGTM=r R=golang-codereviews, r CC=bradfitz, golang-codereviews, iant https://golang.org/cl/145420043
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jun 26, 2018
This fixes the test/linkx.go test, which does not run by default. (Issue 4139 is about fixing that.) Fixes golang#8806. LGTM=r R=golang-codereviews, r CC=bradfitz, golang-codereviews, iant https://golang.org/cl/145420043
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jul 9, 2018
This fixes the test/linkx.go test, which does not run by default. (Issue 4139 is about fixing that.) Fixes golang#8806. LGTM=r R=golang-codereviews, r CC=bradfitz, golang-codereviews, iant https://golang.org/cl/145420043
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jul 30, 2018
This fixes the test/linkx.go test, which does not run by default. (Issue 4139 is about fixing that.) Fixes golang#8806. LGTM=r R=golang-codereviews, r CC=bradfitz, golang-codereviews, iant https://golang.org/cl/145420043
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: