diff options
author | Russ Cox <rsc@golang.org> | 2014-09-24 15:10:38 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-09-24 15:10:38 -0400 |
commit | 4e8210feb144f2ebb74c56815059c69b5b629f4e (patch) | |
tree | 56598ace354e0b5fec90c62e24701d5adc7e3c16 /misc | |
parent | 12704ddfa78b72fba74cac169f421cb6c61197be (diff) | |
download | go-4e8210feb144f2ebb74c56815059c69b5b629f4e.tar.gz |
cmd/go: prohibit C sources files unless using cgo
Those C files would have been compiled with 6c.
It's close to impossible to use C correctly anymore,
and the C compilers are going away eventually.
Make them unavailable now.
go1.4.txt change in CL 145890046
LGTM=iant
R=iant
CC=golang-codereviews, r
https://codereview.appspot.com/149720043
Diffstat (limited to 'misc')
-rw-r--r-- | misc/cgo/test/backdoor/backdoor.go | 3 | ||||
-rw-r--r-- | misc/cgo/test/backdoor/backdoor_gccgo.go | 11 | ||||
-rw-r--r-- | misc/cgo/test/backdoor/runtime.c | 18 | ||||
-rw-r--r-- | misc/cgo/test/issue7695_test.go | 30 |
4 files changed, 1 insertions, 61 deletions
diff --git a/misc/cgo/test/backdoor/backdoor.go b/misc/cgo/test/backdoor/backdoor.go index 7398772bd..3a973494b 100644 --- a/misc/cgo/test/backdoor/backdoor.go +++ b/misc/cgo/test/backdoor/backdoor.go @@ -4,5 +4,4 @@ package backdoor -func LockedOSThread() bool // in runtime.c -func Issue7695(x1, x2, x3, x4, x5, x6, x7, x8 uintptr) +func LockedOSThread() bool // in thunk.s diff --git a/misc/cgo/test/backdoor/backdoor_gccgo.go b/misc/cgo/test/backdoor/backdoor_gccgo.go deleted file mode 100644 index 514f76ec5..000000000 --- a/misc/cgo/test/backdoor/backdoor_gccgo.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2014 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. - -// This is the gccgo version of the stub in runtime.c. - -// +build gccgo - -package backdoor - -func Issue7695(x1, x2, x3, x4, x5, x6, x7, x8 uintptr) {} diff --git a/misc/cgo/test/backdoor/runtime.c b/misc/cgo/test/backdoor/runtime.c deleted file mode 100644 index 87ee44eb6..000000000 --- a/misc/cgo/test/backdoor/runtime.c +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2011 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. - -// Expose some runtime functions for testing. -// Must be in a non-cgo-using package so that -// the go command compiles this file with 6c, not gcc. - -// +build gc - -typedef char bool; - -// This is what a cgo-compiled stub declaration looks like. -void -·Issue7695(struct{void *y[8*sizeof(void*)];}p) -{ - USED(p); -} diff --git a/misc/cgo/test/issue7695_test.go b/misc/cgo/test/issue7695_test.go deleted file mode 100644 index de2fc03d4..000000000 --- a/misc/cgo/test/issue7695_test.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 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. - -// +build ignore -// This test depends on running C code on Go stacks. Not allowed anymore. - -// Demo of deferred C function with untrue prototype -// breaking stack copying. See golang.org/issue/7695. - -package cgotest - -import ( - "testing" - - "./backdoor" -) - -func TestIssue7695(t *testing.T) { - defer backdoor.Issue7695(1, 0, 2, 0, 0, 3, 0, 4) - recurse(100) -} - -func recurse(n int) { - var x [128]int - n += x[0] - if n > 0 { - recurse(n - 1) - } -} |