Resending without the attachment as it was blocked as spam. The actual change be seen in Subversion or at https://groups.google.com/forum/?pli=1#!topic/gofrontend-dev/fT2-PlvVZ9o .
Ian ---------- Forwarded message ---------- From: Ian Lance Taylor <i...@golang.org> Date: Tue, Aug 30, 2016 at 2:07 PM Subject: libgo patch committed: Use -fgo-c-header to share between Go and C To: gcc-patches <gcc-patches@gcc.gnu.org>, "gofrontend-...@googlegroups.com" <gofrontend-...@googlegroups.com> This patch to libgo uses the new -fgo-c-header option to share the definitions of data structures and constants between Go and C. Data structures are defined in new files in libgo/go/runtime. The -fgo-c-header option is used to generate a C header file. That header file is #include'd by libgo/runtime/runtime.h and used when building the code in libgo/runtime. The C versions of the data structures are removed. This is a step toward converting much of the libgo runtime to Go without breaking things as we go. Putting the structs in Go means using the naming conventions of the Go runtime package, so many of the constants pick up a leading underscore and all other underscores are dropped. The C code is adjusted accordingly. This also picks up a change made a while back to the gc runtime: instead of using two different thread local variables, g and m, the m variable is removed and the value is now always accessed as g->m. This required a few additions to the C code to make sure that g->m is always set correctly. This change also passes the new -fgo-compiling-runtime option when compiling the runtime package, although the option doesn't do anything yet. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu and sparc-sun-solaris11. Committed to mainline. Ian