summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-03-06 23:38:54 -0500
committerRuss Cox <rsc@golang.org>2012-03-06 23:38:54 -0500
commitef999fe678792685b98904ee2fad1e9d31c6ee66 (patch)
tree9144fbbba4baaaeab0f3715ba648f51e83a2b977
parenta34469a32ea31f356df9c3cde4cb6468fd60a966 (diff)
downloadgo-ef999fe678792685b98904ee2fad1e9d31c6ee66.tar.gz
misc/cgo/test: fix build
The last CL forgot the all-important 'backdoor' package. Cgo-using packages compile .c files with gcc, but we want to compile this one with 6c, so put it in a non-cgo package. TBR=golang-dev CC=golang-dev http://codereview.appspot.com/5758063
-rw-r--r--misc/cgo/test/backdoor/backdoor.go7
-rw-r--r--misc/cgo/test/backdoor/runtime.c (renamed from misc/cgo/test/runtime.c)4
2 files changed, 10 insertions, 1 deletions
diff --git a/misc/cgo/test/backdoor/backdoor.go b/misc/cgo/test/backdoor/backdoor.go
new file mode 100644
index 000000000..3428e9e43
--- /dev/null
+++ b/misc/cgo/test/backdoor/backdoor.go
@@ -0,0 +1,7 @@
+// Copyright 2012 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.
+
+package backdoor
+
+func LockedOSThread() bool // in runtime.c
diff --git a/misc/cgo/test/runtime.c b/misc/cgo/test/backdoor/runtime.c
index e087c7622..54e6a1ef8 100644
--- a/misc/cgo/test/runtime.c
+++ b/misc/cgo/test/backdoor/runtime.c
@@ -3,6 +3,8 @@
// 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.
typedef char bool;
@@ -14,7 +16,7 @@ FLUSH(void*)
}
void
-·lockedOSThread(bool b)
+·LockedOSThread(bool b)
{
b = runtime·lockedOSThread();
FLUSH(&b);