-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: go test -x -compiler gccgo launchpad.net/juju-core/cmd fails to link test binary intermittently #6768
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
So here is what I think is going on (it's a little confusing). The prerequisites are this: * a package, lets call it foo * another package, bar, that depends on foo * foo has file "internal_test.go" that says "package foo" * foo has another file "external_test.go" that says "package foo_test" that depends on bar * you've run go install -compiler gccgo foo (or go test -i -compiler gccgo foo) When you run "go test -compiler gccgo foo", it first builds libfoo.a in $WORK including internal_test.go. When it builds the foo.test executable and it looks up the dependencies of bar and finds the installed libfoo.a (this, I think, is the bug). Both libfoo.a files are passed to the link command and the order varies (I presume due to the order things come out of a hash, but I haven't verified this). If the newly built libfoo.a comes first, it contains all needed symbols so the installed libfoo.a is never examined by the linker and the link succeeds. If the installed libfoo.a comes first, it does not contain the symbols defined by internal_test.go and so both .a files are included by the linker, leading to duplicate symbols. |
This issue was closed by revision 9f8f0a1. Status changed to Fixed. |
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: