https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101246
Bug ID: 101246 Summary: gccgo cross-compiler targeting arm fails to build with gcc 11. Missing structs in runtime.inc. Using uclibc-ng Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: go Assignee: ian at airs dot com Reporter: lancethepants at gmail dot com CC: cmang at google dot com Target Milestone: --- I've recently run into an issue building a go cross-compiler on x86_64 targeting an arm embedded device (Netgear R7000 router) starting with gcc 11. I was previously able to build the cross-compiler (c,c++,go) under gcc 9 & 10, but am getting the errors listed at the bottom. armv7 cortexa9 cpu (no fpu) uclibc-ng (latest) kernel 2.6.36.4. I don't think the old kernel is an issue because the same errors arise if I use kernel 5.12. I tried building with glibc, and it does work then. So I think the issue is with uclibc-ng. So I did use uclibc-ng with gcc 9 & 10 with success, but for some reason with gcc 11 I am now running into this issue. My untrained eyes think it may be as easy as a couple missing structs within runtime.inc. Is runtime.inc generated? because it doesn't appear in unconfigured source I've notices. thanks, Lance Build Errors In file included from ../../../libgo/runtime/runtime.h:105, from ../../../libgo/runtime/go-main.c:17: ./runtime.inc:1357:29: error: field ‘__state’ has incomplete type 1357 | struct ___mbstate_t __state; | ^~~~~~~ ./runtime.inc:1360:33: error: field ‘__lock’ has incomplete type 1360 | struct _pthread_mutex_t __lock; |