diff --git a/src/pkg/runtime/cgo/freebsd_386.c b/src/pkg/runtime/cgo/freebsd_386.c index b445b940ad6..449a8ef108d 100644 --- a/src/pkg/runtime/cgo/freebsd_386.c +++ b/src/pkg/runtime/cgo/freebsd_386.c @@ -11,14 +11,11 @@ char *environ[] = { 0 }; char *__progname; static void -inittls(void) +xinitcgo(void) { } -void -initcgo(void) -{ -} +void (*initcgo)(void) = xinitcgo; void libcgo_sys_thread_start(ThreadStart *ts) diff --git a/src/pkg/runtime/cgo/freebsd_amd64.c b/src/pkg/runtime/cgo/freebsd_amd64.c index bc3a5618689..daac403c11c 100644 --- a/src/pkg/runtime/cgo/freebsd_amd64.c +++ b/src/pkg/runtime/cgo/freebsd_amd64.c @@ -10,11 +10,13 @@ static void* threadentry(void*); char *environ[] = { 0 }; char *__progname; -void -initcgo(void) +static void +xinitcgo(void) { } +void (*initcgo)(void) = xinitcgo; + void libcgo_sys_thread_start(ThreadStart *ts) { diff --git a/src/pkg/runtime/cgo/nacl_386.c b/src/pkg/runtime/cgo/nacl_386.c index d674aca1df6..e556c433ce4 100644 --- a/src/pkg/runtime/cgo/nacl_386.c +++ b/src/pkg/runtime/cgo/nacl_386.c @@ -4,11 +4,13 @@ #include "libcgo.h" -void -initcgo(void) +static void +xinitcgo(void) { } +void (*initcgo)(void) = xinitcgo; + void libcgo_sys_thread_start(ThreadStart *ts) { diff --git a/src/pkg/runtime/cgo/windows_386.c b/src/pkg/runtime/cgo/windows_386.c index e221d699810..5f5235bd2da 100755 --- a/src/pkg/runtime/cgo/windows_386.c +++ b/src/pkg/runtime/cgo/windows_386.c @@ -12,11 +12,13 @@ static void *threadentry(void*); Allocation granularity on Windows is typically 64 KB. */ #define STACKSIZE (1*1024*1024) -void -initcgo(void) +static void +xinitcgo(void) { } +void (*initcgo)(void) = xinitcgo; + void libcgo_sys_thread_start(ThreadStart *ts) { diff --git a/src/pkg/runtime/cgo/windows_amd64.c b/src/pkg/runtime/cgo/windows_amd64.c index 1f34f850052..dafe8cd9d42 100755 --- a/src/pkg/runtime/cgo/windows_amd64.c +++ b/src/pkg/runtime/cgo/windows_amd64.c @@ -12,11 +12,13 @@ static void *threadentry(void*); Allocation granularity on Windows is typically 64 KB. */ #define STACKSIZE (2*1024*1024) -void -initcgo(void) +static void +xinitcgo(void) { } +void (*initcgo)(void) = xinitcgo; + void libcgo_sys_thread_start(ThreadStart *ts) {