This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug go/61232] [4.10 Regression] link errors building libgo
- From: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 19 May 2014 18:11:42 +0000
- Subject: [Bug go/61232] [4.10 Regression] link errors building libgo
- Auto-submitted: auto-generated
- References: <bug-61232-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61232
Ian Lance Taylor <ian at airs dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ian at airs dot com
--- Comment #5 from Ian Lance Taylor <ian at airs dot com> ---
I haven't been able to figure out how to recreate this in C/C++.
The case in Go is straightforward: a comdat weak variable (specifically, a Go
type descriptor for an unnamed type) has an initializer that refers to the
address of a static variable. That static variable does not have a unique
name. There are hundreds of cases in the standard Go library.
I have a patch for the Go frontend that simply gives the static variables a
unique name. That seems to fix the problem for Go.
It doesn't fix the general problem for the pass, which is: the pass assumes
that when a comdat variable refers to a static variable, the static variable
has a unique name. It happens that for C/C++, as far as I can tell, they
always do have a unique name. To fix the pass properly I think you'll need to
give those static variables a unique asm name without disturbing the debug
info.