[dev.cc] create new branch

This branch is for work on converting the remaining C code in
package runtime to Go and then deleting the cc, 5c, 6c, and 8c
directories. It is targeted to land at the beginning of the 1.5 cycle.

The conversion will proceed one GOOS/GOARCH combination
at a time; red lines on the dashboard are expected and okay.

Once Linux and OS X are converted, help with other systems
will be most welcome.

LGTM=r
R=r
CC=golang-codereviews
https://codereview.appspot.com/174760043
[dev.cc] cmd/5c, cmd/6c, cmd/8c, cmd/cc: remove

Let's just do this up front.
This will break the build (here on the dev.cc branch).
The CLs that follow will take care of fixing it.

Leave behind cmd/cc/lexbody and cmd/cc/macbody for the assemblers.
They'll go away later.

LGTM=dave, r
R=r, dave
CC=golang-codereviews
https://codereview.appspot.com/172170043
[dev.cc] reflect: interfaces contain only pointers

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

Adjustments for changes made in CL 169360043.
This change is already present in the dev.garbage branch.

LGTM=r
R=r
CC=austin, golang-codereviews, iant, khr
https://codereview.appspot.com/167520044
[dev.cc] cmd/cgo: generate only Go source files

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

We changed cgo to write the actual function wrappers in Go
for Go 1.4. The only code left in C output files was the definitions
for pointers to C data and the #pragma cgo directives.
Write both of those to Go outputs instead, using the new
compiler directives introduced in CL 169360043.

(Still generating C files in gccgo mode.)

LGTM=r
R=r
CC=austin, golang-codereviews, iant, khr
https://codereview.appspot.com/169330045
[dev.cc] cmd/gc: changes for removing runtime C code

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

export.c, lex.c:
Add -asmhdr flag to write assembly header file with struct
field offsets and const values. cmd/dist used to construct this
file by interpreting output from the C compiler.
Generate it from the Go definitions instead.
Also, generate the form we need directly, instead of relying
on cmd/dist for reprocessing.

lex.c, obj.c:
If the C compiler accepted #pragma cgo_xxx, recognize
a directive //go:cgo_xxx instead. The effect is the same as
in the C compiler: accumulate text into a buffer and emit in the
output file, where the linker will find and use it.

lex.c, obj.c:
Accept //go:linkname to control the external symbol name
used for a particular top-level Go variable. This makes it
possible to refer to C symbol names but also symbols from
other packages. It has always been possible to do this from
C and assembly. To drive home the point that this should not
be done lightly, require import "unsafe" in any file containing
//go:linkname.

plive.c, reflect.c, subr.c:
Hard-code that interfaces contain only pointers.
This means code handling multiword values in the garbage
collector and the stack copier can be deleted instead of being
converted. This change is already present in the dev.garbage
branch.

LGTM=r
R=r
CC=austin, golang-codereviews, iant, khr
https://codereview.appspot.com/169360043
[dev.cc] cmd/go: adjust go, cgo builds & disable cc

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

Make gcToolchain.cc return an error (no C compiler!).

Adjust expectations of cgo, now that cgo does not write any C files
(no C compiler!).

For packages with .s files, invoke Go compiler with -asmhdr go_asm.h
so that assembly files can use it. This applies to all packages but is only
needed today by package runtime.

LGTM=r
R=r
CC=austin, golang-codereviews, iant, khr
https://codereview.appspot.com/171470043
[dev.cc] liblink: resolve bss vs other conflict regardless of order found

If the linker finds the same name given a BSS and a non-BSS
symbol, the assumption is that the non-BSS symbol is the
true one, and the BSS symbol is just the best Go can do toward
an "extern" declaration. This has always been the case,
as long as the object files were read in the right order.

The old code worked when the BSS symbol is found before
the non-BSS symbol. This CL adds equivalent logic for when
the non-BSS symbol is found before the BSS symbol.
This comes up when Go must refer to symbols defined in
host object files.

LGTM=r
R=r
CC=austin, golang-codereviews, iant, khr
https://codereview.appspot.com/171480043
[dev.cc] cmd/dist: adjust for build process without cmd/cc

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

- Remove references to C compiler directories.
- Remove generation of special header files.
- Remove generation of Go source files from C declarations.

- Compile Go sources before rest of package (was after),
  so that Go compiler can write go_asm.h for use in assembly.

- Move TLS information from cmd/dist (was embedding in output)
  to src/runtime/go_tls.h, which it can be maintained directly.

LGTM=r
R=r, dave
CC=austin, golang-codereviews, iant, khr
https://codereview.appspot.com/172960043
[dev.cc] runtime: convert panic and stack code from C to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r, dave
CC=austin, dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/166520043
[dev.cc] runtime: convert memory allocator and garbage collector to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r
CC=austin, dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/167540043
[dev.cc] runtime: convert header files to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r, austin
CC=dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/167550043
[dev.cc] runtime/cgo: convert from C to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r
CC=austin, dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/168500043
[dev.cc] runtime: convert signal handlers from C to Go

This code overused macros and could not be
converted automatically. Instead a new sigctxt
type had to be defined for each os/arch combination,
with a common (implicit) interface used by the
arch-specific signal handler code.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r
CC=austin, dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/168500044
[dev.cc] runtime: convert assembly files for C to Go transition

The main change is that #include "zasm_GOOS_GOARCH.h"
is now #include "go_asm.h" and/or #include "go_tls.h".

Also, because C StackGuard is now Go _StackGuard,
the assembly name changes from const_StackGuard to
const__StackGuard.

In asm_$GOARCH.s, add new function getg, formerly
implemented in C.

The renamed atomics now have Go wrappers, to get
escape analysis annotations right. Those wrappers
are in CL 174860043.

LGTM=r, aram
R=r, aram
CC=austin, dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/168510043
[dev.cc] build: disable API check until all systems build

Otherwise no system will get an 'ok' until they all do.

LGTM=r, dave
R=r, dave
CC=austin, dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/170320044
[dev.cc] runtime: convert basic library routines from C to Go

float.c held bit patterns for special float64 values,
hiding from the real uses. Rewrite Go code not to
refer to those values directly.

Convert library routines in runtime.c and string.c.

LGTM=r
R=r, dave
CC=austin, dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/170330043
[dev.cc] runtime: convert defs_$GOOS_$GOARCH.h to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

In a few cases, defs_$GOOS_$GOARCH.go already existed,
so the target here is defs1_$GOOS_$GOARCH.go.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r
CC=austin, dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/171490043
[dev.cc] runtime: convert parallel support code from C to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r, austin
CC=dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/172250043
[dev.cc] runtime: convert race implementation from C to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r
CC=austin, dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/172250044
[dev.cc] runtime: convert scheduler from C to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r, daniel.morsing
CC=austin, dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/172260043