Skip to content

gccgo: duplicate symbols under specific package and package_test conditions #15547

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

Closed
tamird opened this issue May 4, 2016 · 12 comments
Closed

Comments

@tamird
Copy link
Contributor

tamird commented May 4, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
$ gccgo go version
go version go1.6.1 gccgo (GCC) 6.1.0 linux/amd64
  1. What operating system and processor architecture are you using (go env)?
$ gccgo go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/tamird/src/go"
GORACE=""
GOROOT="/opt/gccgo"
GOTOOLDIR="/opt/gccgo/libexec/gcc/x86_64-pc-linux-gnu/6.1.0"
GO15VENDOREXPERIMENT="1"
CC="/opt/gccgo/bin/gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="/opt/gccgo/bin/g++"
CGO_ENABLED="1"
  1. What did you do?
$ gccgo go test github.com/tamird/gccgo_duplicate_symbols
  1. What did you expect to see?
ok      github.com/tamird/gccgo_duplicate_symbols   0.002s
  1. What did you see instead?
# testmain
/usr/bin/ld.gold: error: /home/tamird/src/go/pkg/gccgo_linux_amd64/github.com/tamird/libgccgo_duplicate_symbols.a(_go_.o): multiple definition of 'github_com_tamird_gccgo_duplicate_symbols.AIe1e$hash$descriptor'
/usr/bin/ld.gold: $WORK/github.com/tamird/gccgo_duplicate_symbols/_test/github.com/tamird/libgccgo_duplicate_symbols.a(_go_.o): previous definition here
/usr/bin/ld.gold: error: /home/tamird/src/go/pkg/gccgo_linux_amd64/github.com/tamird/libgccgo_duplicate_symbols.a(_go_.o): multiple definition of 'github_com_tamird_gccgo_duplicate_symbols.AIe1e$equal$descriptor'
/usr/bin/ld.gold: $WORK/github.com/tamird/gccgo_duplicate_symbols/_test/github.com/tamird/libgccgo_duplicate_symbols.a(_go_.o): previous definition here
/usr/bin/ld.gold: error: /home/tamird/src/go/pkg/gccgo_linux_amd64/github.com/tamird/libgccgo_duplicate_symbols.a(_go_.o): multiple definition of 'github_com_tamird_gccgo_duplicate_symbols.Sup$descriptor'
/usr/bin/ld.gold: $WORK/github.com/tamird/gccgo_duplicate_symbols/_test/github.com/tamird/libgccgo_duplicate_symbols.a(_go_.o): previous definition here
/usr/bin/ld.gold: error: /home/tamird/src/go/pkg/gccgo_linux_amd64/github.com/tamird/libgccgo_duplicate_symbols.a(_go_.o): multiple definition of 'github_com_tamird_gccgo_duplicate_symbols.Sup'
/usr/bin/ld.gold: $WORK/github.com/tamird/gccgo_duplicate_symbols/_test/github.com/tamird/libgccgo_duplicate_symbols.a(_go_.o): previous definition here
collect2: error: ld returned 1 exit status
FAIL    github.com/tamird/gccgo_duplicate_symbols [build failed]
@bradfitz bradfitz added this to the Unplanned milestone May 4, 2016
@mwhudson
Copy link
Contributor

mwhudson commented May 4, 2016

I think I fixed this in 12e3b18, can you check tip?

@tamird
Copy link
Contributor Author

tamird commented May 4, 2016

Sure, how? Do I need to check out gcc from tip and recompile?

@mwhudson
Copy link
Contributor

mwhudson commented May 4, 2016

Oh, sorry, you're using the go tool from gccgo. I think the fix is upstream there too, but maybe you should look in the commit history first before starting the build. The patch is in the gccgo-6 package in Ubuntu 16.04, at least.

@tamird
Copy link
Contributor Author

tamird commented May 4, 2016

Nope, gcc at HEAD doesn't appear to contain this patch.

@mwhudson
Copy link
Contributor

mwhudson commented May 4, 2016

Paging @ianlancetaylor then, do you think it's worth bringing that patch into tip before the merge for 1.7? And/or fixing it on the gcc-6-branch?

@tamird
Copy link
Contributor Author

tamird commented Aug 11, 2016

@ianlancetaylor ping?

@ianlancetaylor
Copy link
Member

Michael's patch is now in the gofrontend repository and is in GCC mainline. It will be in the GCC 7 release. Your test passes with GCC mainline.

I'm willing to listen to arguments otherwise, but right now I don't think this is worth adding to the GCC 6 branch. So, closing.

@tamird
Copy link
Contributor Author

tamird commented Aug 12, 2016

Isn't GCC 7 still 8 months out? I'd like to see this get into a GCC release before then, and it looks like the next GCC point release might be about 2 months out. What do you think?

@ianlancetaylor
Copy link
Member

Can you send me a patch against GCC 6 branch that fixes the problem?

@tamird
Copy link
Contributor Author

tamird commented Aug 12, 2016

@ianlancetaylor in what repository? gofrontend doesn't seem to have any branches besides master. Are you talking about the gcc repository? How should I send the patch?

@tamird
Copy link
Contributor Author

tamird commented Aug 12, 2016

FWIW, here's the patch in the GCC repo: https://gist.github.com/tamird/4b5a9481bfa6432f9672c652b220d11e

@ianlancetaylor
Copy link
Member

Backported to GCC 6 branch.

@golang golang locked and limited conversation to collaborators Aug 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants