This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug go/61232] [4.10 Regression] link errors building libgo


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]