[Bug go/64595] go programs abort when debug info is stripped

ian at airs dot com gcc-bugzilla@gcc.gnu.org
Tue Jan 20 16:28:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64595

--- Comment #16 from Ian Lance Taylor <ian at airs dot com> ---
Yes, gccgo ought to enable -g by default.  For some reason I thought it did but
clearly I was wrong.

file/line info is needed for the standard library runtime.Callers function,
which is used by many other packages like the log and testing packages. 
Basically Go code assumes that you can always find out who is calling you. 
It's not C.

The Go library only needs whatever libbacktrace needs.  Right now I think that
is a minimal .debug_info, a corresponding .debug_abbrev, a full .debug_line,
possibly .debug_ranges, possibly .debug_str.  I think there is a Google
internal patch to generate this (though Go doesn't use it internally either). 
I can try to dig that up but it seems like stage 1 material.



More information about the Gcc-bugs mailing list