-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
gccgo hash function name confusion #6789
Labels
Comments
Here is a smaller example: mwhudson@narsil:mwhudson$ cd $GOPATH/src/mwhudson mwhudson@narsil:mwhudson$ cat hashfun/hashfun.go package hashfun // this type must not be exported // it must also be complex enough to get a $hash function generated type unexported struct { a int b bool } // now embed this type in a struct that is exported type Struct struct { unexported } mwhudson@narsil:mwhudson$ cat wtf/wtf_test.go package wtf import ( "mwhudson/hashfun" "testing" ) type l hashfun.Struct func TestAll(t *testing.T) { } mwhudson@narsil:mwhudson$ go test -compiler gccgo mwhudson/wtf # testmain /tmp/go-build219194897/mwhudson/wtf/_test/mwhudson/libwtf.a(wtf.o): In function `wtf.l$hash': /home/mwhudson/goplay/src/mwhudson/wtf/wtf_test.go:11: undefined reference to `mwhudson_hashfun.unexported$hash' collect2: error: ld returned 1 exit status FAIL mwhudson/wtf [build failed] It seems that the hash function for an unexported type is inconsistently named (s/unexported/Exported/ and it works). Bit confused as to why compiling wtf_test.go needs to know this name, but don't know how this is supposed to work. |
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: