]> Cypherpunks repositories - gostls13.git/commitdiff
misc/cgo/test: fix build
authorRuss Cox <rsc@golang.org>
Wed, 7 Mar 2012 04:38:54 +0000 (23:38 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 7 Mar 2012 04:38:54 +0000 (23:38 -0500)
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
https://golang.org/cl/5758063

misc/cgo/test/backdoor/backdoor.go [new file with mode: 0644]
misc/cgo/test/backdoor/runtime.c [moved from misc/cgo/test/runtime.c with 73% similarity]

diff --git a/misc/cgo/test/backdoor/backdoor.go b/misc/cgo/test/backdoor/backdoor.go
new file mode 100644 (file)
index 0000000..3428e9e
--- /dev/null
@@ -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
similarity index 73%
rename from misc/cgo/test/runtime.c
rename to misc/cgo/test/backdoor/runtime.c
index e087c76220249b095bacb02c8fd763a4b8f6225b..54e6a1ef8be70dcdd628a24ce9b46edfb5f5d0d1 100644 (file)
@@ -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);