all: merge NaCl branch (part 1)
See golang.org/s/go13nacl for design overview.
This CL is the mostly mechanical changes from rsc's Go 1.2 based NaCl branch, specifically 39cb35750369 to 500771b477cf from https://code.google.com/r/rsc-go13nacl. This CL does not include working NaCl support, there are probably two or three more large merges to come.
CL 15750044 is not included as it involves more invasive changes to the linker which will need to be merged separately.
The exact change lists included are
15050047: syscall: support for Native Client
15360044: syscall: unzip implementation for Native Client
15370044: syscall: Native Client SRPC implementation
15400047: cmd/dist, cmd/go, go/build, test: support for Native Client
15410048: runtime: support for Native Client
15410049: syscall: file descriptor table for Native Client
15410050: syscall: in-memory file system for Native Client
15440048: all: update +build lines for Native Client port
15540045: cmd/6g, cmd/8g, cmd/gc: support for Native Client
15570045: os: support for Native Client
15680044: crypto/..., hash/crc32, reflect, sync/atomic: support for amd64p32
15690044: net: support for Native Client
15690048: runtime: support for fake time like on Go Playground
15690051: build: disable various tests on Native Client
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/68150047
2014-02-25 07:47:42 -07:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
cmd/cc, cmd/ld, runtime: disallow conservative data/bss objects
In linker, refuse to write conservative (array of pointers) as the
garbage collection type for any variable in the data/bss GC program.
In the linker, attach the Go type to an already-read C declaration
during dedup. This gives us Go types for C globals for free as long
as the cmd/dist-generated Go code contains the declaration.
(Most runtime C declarations have a corresponding Go declaration.
Both are bss declarations and so the linker dedups them.)
In cmd/dist, add a few more C files to the auto-Go-declaration list
in order to get Go type information for the C declarations into the linker.
In C compiler, mark all non-pointer-containing global declarations
and all string data as NOPTR. This allows them to exist in C files
without any corresponding Go declaration. Count C function pointers
as "non-pointer-containing", since we have no heap-allocated C functions.
In runtime, add NOPTR to the remaining pointer-containing declarations,
none of which refer to Go heap objects.
In runtime, also move os.Args and syscall.envs data into runtime-owned
variables. Otherwise, in programs that do not import os or syscall, the
runtime variables named os.Args and syscall.envs will be missing type
information.
I believe that this CL eliminates the final source of conservative GC scanning
in non-SWIG Go programs, and therefore...
Fixes #909.
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/149770043
2014-09-24 14:55:26 -06:00
|
|
|
#include "textflag.h"
|
|
|
|
|
all: merge NaCl branch (part 1)
See golang.org/s/go13nacl for design overview.
This CL is the mostly mechanical changes from rsc's Go 1.2 based NaCl branch, specifically 39cb35750369 to 500771b477cf from https://code.google.com/r/rsc-go13nacl. This CL does not include working NaCl support, there are probably two or three more large merges to come.
CL 15750044 is not included as it involves more invasive changes to the linker which will need to be merged separately.
The exact change lists included are
15050047: syscall: support for Native Client
15360044: syscall: unzip implementation for Native Client
15370044: syscall: Native Client SRPC implementation
15400047: cmd/dist, cmd/go, go/build, test: support for Native Client
15410048: runtime: support for Native Client
15410049: syscall: file descriptor table for Native Client
15410050: syscall: in-memory file system for Native Client
15440048: all: update +build lines for Native Client port
15540045: cmd/6g, cmd/8g, cmd/gc: support for Native Client
15570045: os: support for Native Client
15680044: crypto/..., hash/crc32, reflect, sync/atomic: support for amd64p32
15690044: net: support for Native Client
15690048: runtime: support for fake time like on Go Playground
15690051: build: disable various tests on Native Client
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/68150047
2014-02-25 07:47:42 -07:00
|
|
|
#define N SigNotify
|
|
|
|
#define K SigKill
|
|
|
|
#define T SigThrow
|
|
|
|
#define P SigPanic
|
|
|
|
#define D SigDefault
|
|
|
|
|
cmd/cc, cmd/ld, runtime: disallow conservative data/bss objects
In linker, refuse to write conservative (array of pointers) as the
garbage collection type for any variable in the data/bss GC program.
In the linker, attach the Go type to an already-read C declaration
during dedup. This gives us Go types for C globals for free as long
as the cmd/dist-generated Go code contains the declaration.
(Most runtime C declarations have a corresponding Go declaration.
Both are bss declarations and so the linker dedups them.)
In cmd/dist, add a few more C files to the auto-Go-declaration list
in order to get Go type information for the C declarations into the linker.
In C compiler, mark all non-pointer-containing global declarations
and all string data as NOPTR. This allows them to exist in C files
without any corresponding Go declaration. Count C function pointers
as "non-pointer-containing", since we have no heap-allocated C functions.
In runtime, add NOPTR to the remaining pointer-containing declarations,
none of which refer to Go heap objects.
In runtime, also move os.Args and syscall.envs data into runtime-owned
variables. Otherwise, in programs that do not import os or syscall, the
runtime variables named os.Args and syscall.envs will be missing type
information.
I believe that this CL eliminates the final source of conservative GC scanning
in non-SWIG Go programs, and therefore...
Fixes #909.
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/149770043
2014-09-24 14:55:26 -06:00
|
|
|
#pragma dataflag NOPTR
|
all: merge NaCl branch (part 1)
See golang.org/s/go13nacl for design overview.
This CL is the mostly mechanical changes from rsc's Go 1.2 based NaCl branch, specifically 39cb35750369 to 500771b477cf from https://code.google.com/r/rsc-go13nacl. This CL does not include working NaCl support, there are probably two or three more large merges to come.
CL 15750044 is not included as it involves more invasive changes to the linker which will need to be merged separately.
The exact change lists included are
15050047: syscall: support for Native Client
15360044: syscall: unzip implementation for Native Client
15370044: syscall: Native Client SRPC implementation
15400047: cmd/dist, cmd/go, go/build, test: support for Native Client
15410048: runtime: support for Native Client
15410049: syscall: file descriptor table for Native Client
15410050: syscall: in-memory file system for Native Client
15440048: all: update +build lines for Native Client port
15540045: cmd/6g, cmd/8g, cmd/gc: support for Native Client
15570045: os: support for Native Client
15680044: crypto/..., hash/crc32, reflect, sync/atomic: support for amd64p32
15690044: net: support for Native Client
15690048: runtime: support for fake time like on Go Playground
15690051: build: disable various tests on Native Client
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/68150047
2014-02-25 07:47:42 -07:00
|
|
|
SigTab runtime·sigtab[] = {
|
|
|
|
/* 0 */ 0, "SIGNONE: no trap",
|
|
|
|
/* 1 */ N+K, "SIGHUP: terminal line hangup",
|
|
|
|
/* 2 */ N+K, "SIGINT: interrupt",
|
|
|
|
/* 3 */ N+T, "SIGQUIT: quit",
|
|
|
|
/* 4 */ T, "SIGILL: illegal instruction",
|
|
|
|
/* 5 */ T, "SIGTRAP: trace trap",
|
|
|
|
/* 6 */ N+T, "SIGABRT: abort",
|
|
|
|
/* 7 */ T, "SIGEMT: emulate instruction executed",
|
|
|
|
/* 8 */ P, "SIGFPE: floating-point exception",
|
|
|
|
/* 9 */ 0, "SIGKILL: kill",
|
|
|
|
/* 10 */ P, "SIGBUS: bus error",
|
|
|
|
/* 11 */ P, "SIGSEGV: segmentation violation",
|
|
|
|
/* 12 */ T, "SIGSYS: bad system call",
|
|
|
|
/* 13 */ N, "SIGPIPE: write to broken pipe",
|
|
|
|
/* 14 */ N, "SIGALRM: alarm clock",
|
|
|
|
/* 15 */ N+K, "SIGTERM: termination",
|
|
|
|
/* 16 */ N, "SIGURG: urgent condition on socket",
|
|
|
|
/* 17 */ 0, "SIGSTOP: stop",
|
|
|
|
/* 18 */ N+D, "SIGTSTP: keyboard stop",
|
|
|
|
/* 19 */ 0, "SIGCONT: continue after stop",
|
|
|
|
/* 20 */ N, "SIGCHLD: child status has changed",
|
|
|
|
/* 21 */ N+D, "SIGTTIN: background read from tty",
|
|
|
|
/* 22 */ N+D, "SIGTTOU: background write to tty",
|
|
|
|
/* 23 */ N, "SIGIO: i/o now possible",
|
|
|
|
/* 24 */ N, "SIGXCPU: cpu limit exceeded",
|
|
|
|
/* 25 */ N, "SIGXFSZ: file size limit exceeded",
|
|
|
|
/* 26 */ N, "SIGVTALRM: virtual alarm clock",
|
|
|
|
/* 27 */ N, "SIGPROF: profiling alarm clock",
|
|
|
|
/* 28 */ N, "SIGWINCH: window size change",
|
|
|
|
/* 29 */ N, "SIGINFO: status request from keyboard",
|
|
|
|
/* 30 */ N, "SIGUSR1: user-defined signal 1",
|
|
|
|
/* 31 */ N, "SIGUSR2: user-defined signal 2",
|
|
|
|
};
|
|
|
|
|
|
|
|
#undef N
|
|
|
|
#undef K
|
|
|
|
#undef T
|
|
|
|
#undef P
|
|
|
|
#undef D
|