mime/multipart: fix Writer data race test

If the process exits before the spawned goroutine
completes, it'll miss the data race.

LGTM=bradfitz
R=bradfitz
CC=dvyukov, golang-codereviews
https://codereview.appspot.com/122120043
runtime: cache one GC workbuf in thread-local storage
We call scanblock for lots of small root pieces
e.g. for every stack frame args and locals area.
Every scanblock invocation calls getempty/putempty,
which accesses lock-free stack shared among all worker threads.
One-element local cache allows most scanblock calls
to proceed without accessing the shared stack.

LGTM=rsc
R=golang-codereviews, rlh
CC=golang-codereviews, khr, rsc
https://codereview.appspot.com/121250043
cmd/cgo: for -godefs, promote first field of anonymous union

Update issue 6677

When a struct contains an anonymous union, use the type and
name of the first field in the union.

This should make the glibc <sys/resource.h> file work; in that
file struct rusage has fields like

__extension__ union
{
        long int ru_maxrss;
        __syscall_slong_t __ru_maxrss_word;
};

in which the field that matters is ru_maxrss and
__ru_maxrss_word just exists to advance to the next field on
systems where the kernel uses long long fields but userspace
expects long fields.

LGTM=mikioh.mikioh
R=golang-codereviews, mikioh.mikioh
CC=golang-codereviews
https://codereview.appspot.com/106260044
net: separate DNS transport from DNS query-response interaction

Before fixing issue 6579 this CL separates DNS transport from
DNS message interaction to make it easier to add builtin DNS
resolver control logic.

Update issue 6579

LGTM=alex, kevlar
R=golang-codereviews, alex, gobot, iant, minux, kevlar
CC=golang-codereviews
https://codereview.appspot.com/101220044
cmd/cgo: fix handling of defs_linux.go

Instead of including <sys/types.h> to get size_t, instead include
the ISO C standard <stddef.h> header, which defines fewer additional
types at risk of colliding with the user code.  In particular, this
prevents collisions between <sys/types.h>'s userspace definitions with
the kernel definitions needed by defs_linux.go.

Also, -cdefs mode uses #pragma pack, so we can keep misaligned fields.

Fixes issue 8477.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://codereview.appspot.com/120610043

Committer: Ian Lance Taylor <iant@golang.org>
cmd/cgo: fix recursive type mapping

Instead of immediately completing pointer type mappings, add them to
a queue to allow them to be completed later.  This fixes issues	caused
by Type() returning arbitrary in-progress type mappings.

Fixes issue 8368.
Fixes issue 8441.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://codereview.appspot.com/122850043

Committer: Ian Lance Taylor <iant@golang.org>
liblink: shorter encoding for zeroing register

Encode MOV $0, %ax as XOR %eax, %eax instead of
XOR %rax, %rax. If an operand register does not
need REX.w bit (i.e. not one of R8-R15), it is
encoded in 2 bytes instead of 3 bytes.

LGTM=rsc
R=golang-codereviews, gobot, rsc
CC=golang-codereviews
https://codereview.appspot.com/115580044
runtime: disable aeshash on NaCl at compile time

Fixes build for nacl/386.

LGTM=dave
R=khr, bradfitz, dave, dan.kortschak, rsc
CC=golang-codereviews
https://codereview.appspot.com/121080043
runtime: remove dead code

LGTM=bradfitz, dave, ruiu
R=rsc, iant, bradfitz, dave, ruiu
CC=golang-codereviews
https://codereview.appspot.com/116610043
liblink: use LinkArch.textflag() to get text and dataflag
Rather than switch on thechar.

LGTM=rsc, dave
R=rsc, iant, dave
CC=golang-codereviews
https://codereview.appspot.com/119330043
runtime: get rid of SA_RESTORER on ARM.

The manpages says SA_RESTORER is obsolete, and indeed, not every architecture
support it. However, sadly it's required on x86_64, see http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/x86/kernel/signal.c?id=26bcd8b72563b4c54892c4c2a409f6656fb8ae8b#n430, so only use it on x86.

LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://codereview.appspot.com/115450043
cmd/ld: fix operator precedence

LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://codereview.appspot.com/114420043
liblink: support big-endian properly

LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://codereview.appspot.com/115300044
cmd/5l, cmd/6l, cmd/8l, cmd/ld: remove unused code, consolidate enums

LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://codereview.appspot.com/120220043
cmd/cc, cmd/gc: set ctxt->debugvlog with debug['v']

LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://codereview.appspot.com/118610043
liblink, cmd/dist, cmd/5l: introduce %^ and move C_* constants.

The helps certain diagnostics and also removed duplicated enums as a side effect.

LGTM=dave, rsc
R=rsc, dave
CC=golang-codereviews
https://codereview.appspot.com/115060044
liblink: encode MOVBQZX as MOVZBL instead of MOVZBQ

LGTM=rsc
R=golang-codereviews, gobot, rsc
CC=golang-codereviews
https://codereview.appspot.com/118480046
undo CL 114420043 / b613f2acdf69

Broke freebsd/amd64 due to exposure of a latent bug.

««« original CL description
cmd/ld: fix operator precedence

LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://codereview.appspot.com/114420043
»»»

TBR=dfc
R=dave
CC=golang-codereviews
https://codereview.appspot.com/120630043
runtime: burn cpu before calling yield in windows runtime.systime

LGTM=dvyukov
R=golang-codereviews, dvyukov
CC=golang-codereviews
https://codereview.appspot.com/117670043
dist: fix Plan 9 build

Since CL 115060044, mkanames declares an empty
array in anames8.c and anames6.c, which is not
valid for the Plan 9 compiler.

char* cnames8[] = {
};

This change makes mkanames not declaring the
cnames array when no C_ constants are found.

LGTM=iant
R=minux, iant
CC=golang-codereviews
https://codereview.appspot.com/117680043

Committer: Ian Lance Taylor <iant@golang.org>