https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68255
--- Comment #1 from Dominik Vogt <vogt at linux dot vnet.ibm.com> --- Created attachment 36675 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36675&action=edit Experimental fix. The attached patch fixes the problem in the "go" tool by forcing the --whole-archive linker option if a package uses C code (Cgo). I've no idea whether the performance hit is acceptable. A different way to fix that would be to make Cgo place the init() function that initialise a global variable in the same .c file as the variable itself(?)