From bcf3d55ed99b7b7e689e05a8333ba89d337c0cad Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Sun, 23 Feb 2014 20:37:43 -0500 Subject: [PATCH] misc/cgo/testso: don't use TLS variables on Darwin and OpenBSD. Fix build for 10.6 Darwin builders and OpenBSD builers. LGTM=jsing R=golang-codereviews, dave, jsing CC=golang-codereviews https://golang.org/cl/67710043 --- misc/cgo/testso/cgoso_c.c | 4 ++++ misc/cgo/testso/cgoso_unix.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/misc/cgo/testso/cgoso_c.c b/misc/cgo/testso/cgoso_c.c index 9b77a76fcf0..7a38022b547 100644 --- a/misc/cgo/testso/cgoso_c.c +++ b/misc/cgo/testso/cgoso_c.c @@ -17,6 +17,10 @@ __declspec(dllexport) void sofunc(void); #else extern void goCallback(void); void setCallback(void *f) { (void)f; } +#endif + +// OpenBSD and older Darwin lack TLS support +#if !defined(__OpenBSD__) && !defined(__APPLE__) __thread int tlsvar = 12345; #endif diff --git a/misc/cgo/testso/cgoso_unix.go b/misc/cgo/testso/cgoso_unix.go index e86f992642e..7d5444cd12b 100644 --- a/misc/cgo/testso/cgoso_unix.go +++ b/misc/cgo/testso/cgoso_unix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd +// +build dragonfly freebsd linux netbsd package cgosotest