]> git.ipfire.org Git - thirdparty/gcc.git/commit
runtime: use -fgo-c-header to build C header file
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Aug 2016 21:07:47 +0000 (21:07 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Aug 2016 21:07:47 +0000 (21:07 +0000)
commit9ac07c161242531db15b21aa5d997b85ac9325fa
tree9c8130f09f3b1f343a58af6dd0f97f3a14f617c9
parentc96743f970c0cca689b9b154b7f74d328a25699f
runtime: use -fgo-c-header to build C header file

    Use the new -fgo-c-header option to build a header file for the Go
    runtime code in libgo/go/runtime, and use the new header file in the C
    runtime code in libgo/runtime.  This will ensure that the Go code and C
    code share the same data structures as we convert the runtime from C to
    Go.

    The new file libgo/go/runtime/runtime2.go is copied from the Go 1.7
    release, and then edited to remove unnecessary data structures and
    modify others for use with libgo.

    The new file libgo/go/runtime/mcache.go is an initial version of the
    same files in the Go 1.7 release, and will be replaced by the Go 1.7
    file when we convert to the new memory allocator.

    The new file libgo/go/runtime/type.go describes the gccgo version of the
    reflection data structures, and replaces the Go 1.7 runtime file which
    describes the gc version of those structures.

    Using the new header file means changing a number of struct fields to
    use Go naming conventions (that is, no underscores) and to rename
    constants to have a leading underscore so that they are not exported
    from the Go package.  These names were updated in the C code.

    The C code was also changed to drop the thread-local variable m, as was
    done some time ago in the gc sources.  Now the m field is always
    accessed using g->m, where g is the single remaining thread-local
    variable.  This in turn required some adjustments to set g->m correctly
    in all cases.

    Also pass the new -fgo-compiling-runtime option when compiling the
    runtime package, although that option doesn't do anything yet.

    Reviewed-on: https://go-review.googlesource.com/28051

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239872 138bc75d-0d04-0410-961f-82ee72b054a4
33 files changed:
gcc/go/gofrontend/MERGE
libgo/Makefile.am
libgo/Makefile.in
libgo/go/runtime/mcache.go [new file with mode: 0644]
libgo/go/runtime/runtime2.go [new file with mode: 0644]
libgo/go/runtime/type.go [new file with mode: 0644]
libgo/mksysinfo.sh
libgo/runtime/go-cgo.c
libgo/runtime/go-defer.c
libgo/runtime/go-defer.h [deleted file]
libgo/runtime/go-deferred-recover.c
libgo/runtime/go-panic.c
libgo/runtime/go-panic.h
libgo/runtime/go-recover.c
libgo/runtime/go-signal.c
libgo/runtime/go-unwind.c
libgo/runtime/heapdump.c
libgo/runtime/lock_sema.c
libgo/runtime/malloc.goc
libgo/runtime/malloc.h
libgo/runtime/mcache.c
libgo/runtime/mcentral.c
libgo/runtime/mgc0.c
libgo/runtime/mheap.c
libgo/runtime/mprof.goc
libgo/runtime/msize.c
libgo/runtime/netpoll.goc
libgo/runtime/panic.c
libgo/runtime/proc.c
libgo/runtime/runtime.c
libgo/runtime/runtime.h
libgo/runtime/runtime1.goc
libgo/runtime/signal_unix.c