Commit f6b1e65e by Ian Lance Taylor

re PR go/46986 (Go is not supported on Darwin)

	PR go/46986
all: prepend #__USER_LABEL_PREFIX__ to mangled Go symbols
For old-fashioned Darwin.

From-SVN: r195438
parent f5ba49ac
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
library function, which shouldn't need much stack space. */ library function, which shouldn't need much stack space. */
intgo IndexByte (struct __go_open_array, char) intgo IndexByte (struct __go_open_array, char)
asm ("bytes.IndexByte") __asm__ (GOSYM_PREFIX "bytes.IndexByte")
__attribute__ ((no_split_stack)); __attribute__ ((no_split_stack));
intgo intgo
...@@ -31,7 +31,7 @@ IndexByte (struct __go_open_array s, char b) ...@@ -31,7 +31,7 @@ IndexByte (struct __go_open_array s, char b)
/* Comparison. */ /* Comparison. */
_Bool Equal (struct __go_open_array a, struct __go_open_array b) _Bool Equal (struct __go_open_array a, struct __go_open_array b)
asm ("bytes.Equal") __asm__ (GOSYM_PREFIX "bytes.Equal")
__attribute__ ((no_split_stack)); __attribute__ ((no_split_stack));
_Bool _Bool
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
can't represent a C varargs function in Go. */ can't represent a C varargs function in Go. */
void syslog_c(intgo, const char*) void syslog_c(intgo, const char*)
asm ("log_syslog.syslog_c"); __asm__ (GOSYM_PREFIX "log_syslog.syslog_c");
void void
syslog_c (intgo priority, const char *msg) syslog_c (intgo priority, const char *msg)
......
...@@ -6,8 +6,10 @@ ...@@ -6,8 +6,10 @@
#include <stdint.h> #include <stdint.h>
#include "runtime.h"
_Bool CompareAndSwapInt32 (int32_t *, int32_t, int32_t) _Bool CompareAndSwapInt32 (int32_t *, int32_t, int32_t)
asm ("sync_atomic.CompareAndSwapInt32"); __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapInt32");
_Bool _Bool
CompareAndSwapInt32 (int32_t *val, int32_t old, int32_t new) CompareAndSwapInt32 (int32_t *val, int32_t old, int32_t new)
...@@ -16,7 +18,7 @@ CompareAndSwapInt32 (int32_t *val, int32_t old, int32_t new) ...@@ -16,7 +18,7 @@ CompareAndSwapInt32 (int32_t *val, int32_t old, int32_t new)
} }
_Bool CompareAndSwapInt64 (int64_t *, int64_t, int64_t) _Bool CompareAndSwapInt64 (int64_t *, int64_t, int64_t)
asm ("sync_atomic.CompareAndSwapInt64"); __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapInt64");
_Bool _Bool
CompareAndSwapInt64 (int64_t *val, int64_t old, int64_t new) CompareAndSwapInt64 (int64_t *val, int64_t old, int64_t new)
...@@ -25,7 +27,7 @@ CompareAndSwapInt64 (int64_t *val, int64_t old, int64_t new) ...@@ -25,7 +27,7 @@ CompareAndSwapInt64 (int64_t *val, int64_t old, int64_t new)
} }
_Bool CompareAndSwapUint32 (uint32_t *, uint32_t, uint32_t) _Bool CompareAndSwapUint32 (uint32_t *, uint32_t, uint32_t)
asm ("sync_atomic.CompareAndSwapUint32"); __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapUint32");
_Bool _Bool
CompareAndSwapUint32 (uint32_t *val, uint32_t old, uint32_t new) CompareAndSwapUint32 (uint32_t *val, uint32_t old, uint32_t new)
...@@ -34,7 +36,7 @@ CompareAndSwapUint32 (uint32_t *val, uint32_t old, uint32_t new) ...@@ -34,7 +36,7 @@ CompareAndSwapUint32 (uint32_t *val, uint32_t old, uint32_t new)
} }
_Bool CompareAndSwapUint64 (uint64_t *, uint64_t, uint64_t) _Bool CompareAndSwapUint64 (uint64_t *, uint64_t, uint64_t)
asm ("sync_atomic.CompareAndSwapUint64"); __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapUint64");
_Bool _Bool
CompareAndSwapUint64 (uint64_t *val, uint64_t old, uint64_t new) CompareAndSwapUint64 (uint64_t *val, uint64_t old, uint64_t new)
...@@ -43,7 +45,7 @@ CompareAndSwapUint64 (uint64_t *val, uint64_t old, uint64_t new) ...@@ -43,7 +45,7 @@ CompareAndSwapUint64 (uint64_t *val, uint64_t old, uint64_t new)
} }
_Bool CompareAndSwapUintptr (uintptr_t *, uintptr_t, uintptr_t) _Bool CompareAndSwapUintptr (uintptr_t *, uintptr_t, uintptr_t)
asm ("sync_atomic.CompareAndSwapUintptr"); __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapUintptr");
_Bool _Bool
CompareAndSwapUintptr (uintptr_t *val, uintptr_t old, uintptr_t new) CompareAndSwapUintptr (uintptr_t *val, uintptr_t old, uintptr_t new)
...@@ -52,7 +54,7 @@ CompareAndSwapUintptr (uintptr_t *val, uintptr_t old, uintptr_t new) ...@@ -52,7 +54,7 @@ CompareAndSwapUintptr (uintptr_t *val, uintptr_t old, uintptr_t new)
} }
_Bool CompareAndSwapPointer (void **, void *, void *) _Bool CompareAndSwapPointer (void **, void *, void *)
asm ("sync_atomic.CompareAndSwapPointer"); __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapPointer");
_Bool _Bool
CompareAndSwapPointer (void **val, void *old, void *new) CompareAndSwapPointer (void **val, void *old, void *new)
...@@ -61,7 +63,7 @@ CompareAndSwapPointer (void **val, void *old, void *new) ...@@ -61,7 +63,7 @@ CompareAndSwapPointer (void **val, void *old, void *new)
} }
int32_t AddInt32 (int32_t *, int32_t) int32_t AddInt32 (int32_t *, int32_t)
asm ("sync_atomic.AddInt32"); __asm__ (GOSYM_PREFIX "sync_atomic.AddInt32");
int32_t int32_t
AddInt32 (int32_t *val, int32_t delta) AddInt32 (int32_t *val, int32_t delta)
...@@ -70,7 +72,7 @@ AddInt32 (int32_t *val, int32_t delta) ...@@ -70,7 +72,7 @@ AddInt32 (int32_t *val, int32_t delta)
} }
uint32_t AddUint32 (uint32_t *, uint32_t) uint32_t AddUint32 (uint32_t *, uint32_t)
asm ("sync_atomic.AddUint32"); __asm__ (GOSYM_PREFIX "sync_atomic.AddUint32");
uint32_t uint32_t
AddUint32 (uint32_t *val, uint32_t delta) AddUint32 (uint32_t *val, uint32_t delta)
...@@ -79,7 +81,7 @@ AddUint32 (uint32_t *val, uint32_t delta) ...@@ -79,7 +81,7 @@ AddUint32 (uint32_t *val, uint32_t delta)
} }
int64_t AddInt64 (int64_t *, int64_t) int64_t AddInt64 (int64_t *, int64_t)
asm ("sync_atomic.AddInt64"); __asm__ (GOSYM_PREFIX "sync_atomic.AddInt64");
int64_t int64_t
AddInt64 (int64_t *val, int64_t delta) AddInt64 (int64_t *val, int64_t delta)
...@@ -88,7 +90,7 @@ AddInt64 (int64_t *val, int64_t delta) ...@@ -88,7 +90,7 @@ AddInt64 (int64_t *val, int64_t delta)
} }
uint64_t AddUint64 (uint64_t *, uint64_t) uint64_t AddUint64 (uint64_t *, uint64_t)
asm ("sync_atomic.AddUint64"); __asm__ (GOSYM_PREFIX "sync_atomic.AddUint64");
uint64_t uint64_t
AddUint64 (uint64_t *val, uint64_t delta) AddUint64 (uint64_t *val, uint64_t delta)
...@@ -97,7 +99,7 @@ AddUint64 (uint64_t *val, uint64_t delta) ...@@ -97,7 +99,7 @@ AddUint64 (uint64_t *val, uint64_t delta)
} }
uintptr_t AddUintptr (uintptr_t *, uintptr_t) uintptr_t AddUintptr (uintptr_t *, uintptr_t)
asm ("sync_atomic.AddUintptr"); __asm__ (GOSYM_PREFIX "sync_atomic.AddUintptr");
uintptr_t uintptr_t
AddUintptr (uintptr_t *val, uintptr_t delta) AddUintptr (uintptr_t *val, uintptr_t delta)
...@@ -106,7 +108,7 @@ AddUintptr (uintptr_t *val, uintptr_t delta) ...@@ -106,7 +108,7 @@ AddUintptr (uintptr_t *val, uintptr_t delta)
} }
int32_t LoadInt32 (int32_t *addr) int32_t LoadInt32 (int32_t *addr)
asm ("sync_atomic.LoadInt32"); __asm__ (GOSYM_PREFIX "sync_atomic.LoadInt32");
int32_t int32_t
LoadInt32 (int32_t *addr) LoadInt32 (int32_t *addr)
...@@ -120,7 +122,7 @@ LoadInt32 (int32_t *addr) ...@@ -120,7 +122,7 @@ LoadInt32 (int32_t *addr)
} }
int64_t LoadInt64 (int64_t *addr) int64_t LoadInt64 (int64_t *addr)
asm ("sync_atomic.LoadInt64"); __asm__ (GOSYM_PREFIX "sync_atomic.LoadInt64");
int64_t int64_t
LoadInt64 (int64_t *addr) LoadInt64 (int64_t *addr)
...@@ -134,7 +136,7 @@ LoadInt64 (int64_t *addr) ...@@ -134,7 +136,7 @@ LoadInt64 (int64_t *addr)
} }
uint32_t LoadUint32 (uint32_t *addr) uint32_t LoadUint32 (uint32_t *addr)
asm ("sync_atomic.LoadUint32"); __asm__ (GOSYM_PREFIX "sync_atomic.LoadUint32");
uint32_t uint32_t
LoadUint32 (uint32_t *addr) LoadUint32 (uint32_t *addr)
...@@ -148,7 +150,7 @@ LoadUint32 (uint32_t *addr) ...@@ -148,7 +150,7 @@ LoadUint32 (uint32_t *addr)
} }
uint64_t LoadUint64 (uint64_t *addr) uint64_t LoadUint64 (uint64_t *addr)
asm ("sync_atomic.LoadUint64"); __asm__ (GOSYM_PREFIX "sync_atomic.LoadUint64");
uint64_t uint64_t
LoadUint64 (uint64_t *addr) LoadUint64 (uint64_t *addr)
...@@ -162,7 +164,7 @@ LoadUint64 (uint64_t *addr) ...@@ -162,7 +164,7 @@ LoadUint64 (uint64_t *addr)
} }
uintptr_t LoadUintptr (uintptr_t *addr) uintptr_t LoadUintptr (uintptr_t *addr)
asm ("sync_atomic.LoadUintptr"); __asm__ (GOSYM_PREFIX "sync_atomic.LoadUintptr");
uintptr_t uintptr_t
LoadUintptr (uintptr_t *addr) LoadUintptr (uintptr_t *addr)
...@@ -176,7 +178,7 @@ LoadUintptr (uintptr_t *addr) ...@@ -176,7 +178,7 @@ LoadUintptr (uintptr_t *addr)
} }
void *LoadPointer (void **addr) void *LoadPointer (void **addr)
asm ("sync_atomic.LoadPointer"); __asm__ (GOSYM_PREFIX "sync_atomic.LoadPointer");
void * void *
LoadPointer (void **addr) LoadPointer (void **addr)
...@@ -190,7 +192,7 @@ LoadPointer (void **addr) ...@@ -190,7 +192,7 @@ LoadPointer (void **addr)
} }
void StoreInt32 (int32_t *addr, int32_t val) void StoreInt32 (int32_t *addr, int32_t val)
asm ("sync_atomic.StoreInt32"); __asm__ (GOSYM_PREFIX "sync_atomic.StoreInt32");
void void
StoreInt32 (int32_t *addr, int32_t val) StoreInt32 (int32_t *addr, int32_t val)
...@@ -203,7 +205,7 @@ StoreInt32 (int32_t *addr, int32_t val) ...@@ -203,7 +205,7 @@ StoreInt32 (int32_t *addr, int32_t val)
} }
void StoreInt64 (int64_t *addr, int64_t val) void StoreInt64 (int64_t *addr, int64_t val)
asm ("sync_atomic.StoreInt64"); __asm__ (GOSYM_PREFIX "sync_atomic.StoreInt64");
void void
StoreInt64 (int64_t *addr, int64_t val) StoreInt64 (int64_t *addr, int64_t val)
...@@ -216,7 +218,7 @@ StoreInt64 (int64_t *addr, int64_t val) ...@@ -216,7 +218,7 @@ StoreInt64 (int64_t *addr, int64_t val)
} }
void StoreUint32 (uint32_t *addr, uint32_t val) void StoreUint32 (uint32_t *addr, uint32_t val)
asm ("sync_atomic.StoreUint32"); __asm__ (GOSYM_PREFIX "sync_atomic.StoreUint32");
void void
StoreUint32 (uint32_t *addr, uint32_t val) StoreUint32 (uint32_t *addr, uint32_t val)
...@@ -229,7 +231,7 @@ StoreUint32 (uint32_t *addr, uint32_t val) ...@@ -229,7 +231,7 @@ StoreUint32 (uint32_t *addr, uint32_t val)
} }
void StoreUint64 (uint64_t *addr, uint64_t val) void StoreUint64 (uint64_t *addr, uint64_t val)
asm ("sync_atomic.StoreUint64"); __asm__ (GOSYM_PREFIX "sync_atomic.StoreUint64");
void void
StoreUint64 (uint64_t *addr, uint64_t val) StoreUint64 (uint64_t *addr, uint64_t val)
...@@ -242,7 +244,7 @@ StoreUint64 (uint64_t *addr, uint64_t val) ...@@ -242,7 +244,7 @@ StoreUint64 (uint64_t *addr, uint64_t val)
} }
void StoreUintptr (uintptr_t *addr, uintptr_t val) void StoreUintptr (uintptr_t *addr, uintptr_t val)
asm ("sync_atomic.StoreUintptr"); __asm__ (GOSYM_PREFIX "sync_atomic.StoreUintptr");
void void
StoreUintptr (uintptr_t *addr, uintptr_t val) StoreUintptr (uintptr_t *addr, uintptr_t val)
...@@ -255,7 +257,7 @@ StoreUintptr (uintptr_t *addr, uintptr_t val) ...@@ -255,7 +257,7 @@ StoreUintptr (uintptr_t *addr, uintptr_t val)
} }
void StorePointer (void **addr, void *val) void StorePointer (void **addr, void *val)
asm ("sync_atomic.StorePointer"); __asm__ (GOSYM_PREFIX "sync_atomic.StorePointer");
void void
StorePointer (void **addr, void *val) StorePointer (void **addr, void *val)
......
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
#include <stdint.h> #include <stdint.h>
_Bool cas (int32_t *, int32_t, int32_t) asm ("libgo_sync.sync.cas"); #include "runtime.h"
_Bool cas (int32_t *, int32_t, int32_t) __asm__ (GOSYM_PREFIX "libgo_sync.sync.cas");
_Bool _Bool
cas (int32_t *ptr, int32_t old, int32_t new) cas (int32_t *ptr, int32_t old, int32_t new)
......
...@@ -3,15 +3,16 @@ ...@@ -3,15 +3,16 @@
Copyright 2010 The Go Authors. All rights reserved. Copyright 2010 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file. */ license that can be found in the LICENSE file. */
#include <errno.h> #include <errno.h>
#include <stdint.h> #include <stdint.h>
#include "runtime.h"
/* errno is typically a macro. These functions set /* errno is typically a macro. These functions set
and get errno specific to the libc being used. */ and get errno specific to the libc being used. */
uintptr_t GetErrno() asm ("syscall.GetErrno"); uintptr_t GetErrno() __asm__ (GOSYM_PREFIX "syscall.GetErrno");
void SetErrno(uintptr_t) asm ("syscall.SetErrno"); void SetErrno(uintptr_t) __asm__ (GOSYM_PREFIX "syscall.SetErrno");
uintptr_t uintptr_t
GetErrno() GetErrno()
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "arch.h" #include "arch.h"
#include "malloc.h" #include "malloc.h"
String Signame (intgo sig) asm ("syscall.Signame"); String Signame (intgo sig) __asm__ (GOSYM_PREFIX "syscall.Signame");
String String
Signame (intgo sig) Signame (intgo sig)
......
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
#include <stdint.h> #include <stdint.h>
#include <sys/wait.h> #include <sys/wait.h>
#include "runtime.h"
extern _Bool Exited (uint32_t *w) extern _Bool Exited (uint32_t *w)
__asm__ ("syscall.Exited.N18_syscall.WaitStatus"); __asm__ (GOSYM_PREFIX "syscall.Exited.N18_syscall.WaitStatus");
_Bool _Bool
Exited (uint32_t *w) Exited (uint32_t *w)
...@@ -20,7 +22,7 @@ Exited (uint32_t *w) ...@@ -20,7 +22,7 @@ Exited (uint32_t *w)
} }
extern _Bool Signaled (uint32_t *w) extern _Bool Signaled (uint32_t *w)
__asm__ ("syscall.Signaled.N18_syscall.WaitStatus"); __asm__ (GOSYM_PREFIX "syscall.Signaled.N18_syscall.WaitStatus");
_Bool _Bool
Signaled (uint32_t *w) Signaled (uint32_t *w)
...@@ -29,7 +31,7 @@ Signaled (uint32_t *w) ...@@ -29,7 +31,7 @@ Signaled (uint32_t *w)
} }
extern _Bool Stopped (uint32_t *w) extern _Bool Stopped (uint32_t *w)
__asm__ ("syscall.Stopped.N18_syscall.WaitStatus"); __asm__ (GOSYM_PREFIX "syscall.Stopped.N18_syscall.WaitStatus");
_Bool _Bool
Stopped (uint32_t *w) Stopped (uint32_t *w)
...@@ -38,7 +40,7 @@ Stopped (uint32_t *w) ...@@ -38,7 +40,7 @@ Stopped (uint32_t *w)
} }
extern _Bool Continued (uint32_t *w) extern _Bool Continued (uint32_t *w)
__asm__ ("syscall.Continued.N18_syscall.WaitStatus"); __asm__ (GOSYM_PREFIX "syscall.Continued.N18_syscall.WaitStatus");
_Bool _Bool
Continued (uint32_t *w) Continued (uint32_t *w)
...@@ -47,7 +49,7 @@ Continued (uint32_t *w) ...@@ -47,7 +49,7 @@ Continued (uint32_t *w)
} }
extern _Bool CoreDump (uint32_t *w) extern _Bool CoreDump (uint32_t *w)
__asm__ ("syscall.CoreDump.N18_syscall.WaitStatus"); __asm__ (GOSYM_PREFIX "syscall.CoreDump.N18_syscall.WaitStatus");
_Bool _Bool
CoreDump (uint32_t *w) CoreDump (uint32_t *w)
...@@ -56,7 +58,7 @@ CoreDump (uint32_t *w) ...@@ -56,7 +58,7 @@ CoreDump (uint32_t *w)
} }
extern int ExitStatus (uint32_t *w) extern int ExitStatus (uint32_t *w)
__asm__ ("syscall.ExitStatus.N18_syscall.WaitStatus"); __asm__ (GOSYM_PREFIX "syscall.ExitStatus.N18_syscall.WaitStatus");
int int
ExitStatus (uint32_t *w) ExitStatus (uint32_t *w)
...@@ -67,7 +69,7 @@ ExitStatus (uint32_t *w) ...@@ -67,7 +69,7 @@ ExitStatus (uint32_t *w)
} }
extern int Signal (uint32_t *w) extern int Signal (uint32_t *w)
__asm__ ("syscall.Signal.N18_syscall.WaitStatus"); __asm__ (GOSYM_PREFIX "syscall.Signal.N18_syscall.WaitStatus");
int int
Signal (uint32_t *w) Signal (uint32_t *w)
...@@ -78,7 +80,7 @@ Signal (uint32_t *w) ...@@ -78,7 +80,7 @@ Signal (uint32_t *w)
} }
extern int StopSignal (uint32_t *w) extern int StopSignal (uint32_t *w)
__asm__ ("syscall.StopSignal.N18_syscall.WaitStatus"); __asm__ (GOSYM_PREFIX "syscall.StopSignal.N18_syscall.WaitStatus");
int int
StopSignal (uint32_t *w) StopSignal (uint32_t *w)
...@@ -89,7 +91,7 @@ StopSignal (uint32_t *w) ...@@ -89,7 +91,7 @@ StopSignal (uint32_t *w)
} }
extern int TrapCause (uint32_t *w) extern int TrapCause (uint32_t *w)
__asm__ ("syscall.TrapCause.N18_syscall.WaitStatus"); __asm__ (GOSYM_PREFIX "syscall.TrapCause.N18_syscall.WaitStatus");
int int
TrapCause (uint32_t *w __attribute__ ((unused))) TrapCause (uint32_t *w __attribute__ ((unused)))
......
...@@ -118,7 +118,7 @@ runtime_makechan_c(ChanType *t, int64 hint) ...@@ -118,7 +118,7 @@ runtime_makechan_c(ChanType *t, int64 hint)
// For reflect // For reflect
// func makechan(typ *ChanType, size uint64) (chan) // func makechan(typ *ChanType, size uint64) (chan)
uintptr reflect_makechan(ChanType *, uint64) uintptr reflect_makechan(ChanType *, uint64)
asm ("reflect.makechan"); __asm__ (GOSYM_PREFIX "reflect.makechan");
uintptr uintptr
reflect_makechan(ChanType *t, uint64 size) reflect_makechan(ChanType *t, uint64 size)
...@@ -508,7 +508,7 @@ __go_receive_big(ChanType *t, Hchan* c, byte* p) ...@@ -508,7 +508,7 @@ __go_receive_big(ChanType *t, Hchan* c, byte* p)
} }
_Bool runtime_chanrecv2(ChanType *t, Hchan* c, byte* p) _Bool runtime_chanrecv2(ChanType *t, Hchan* c, byte* p)
__asm__("runtime.chanrecv2"); __asm__ (GOSYM_PREFIX "runtime.chanrecv2");
_Bool _Bool
runtime_chanrecv2(ChanType *t, Hchan* c, byte* p) runtime_chanrecv2(ChanType *t, Hchan* c, byte* p)
...@@ -613,7 +613,7 @@ runtime_selectnbrecv2(ChanType *t, byte *v, _Bool *received, Hchan *c) ...@@ -613,7 +613,7 @@ runtime_selectnbrecv2(ChanType *t, byte *v, _Bool *received, Hchan *c)
// the actual data if it fits, or else a pointer to the data. // the actual data if it fits, or else a pointer to the data.
_Bool reflect_chansend(ChanType *, Hchan *, uintptr, _Bool) _Bool reflect_chansend(ChanType *, Hchan *, uintptr, _Bool)
__asm__("reflect.chansend"); __asm__ (GOSYM_PREFIX "reflect.chansend");
_Bool _Bool
reflect_chansend(ChanType *t, Hchan *c, uintptr val, _Bool nb) reflect_chansend(ChanType *t, Hchan *c, uintptr val, _Bool nb)
...@@ -650,7 +650,7 @@ struct chanrecv_ret ...@@ -650,7 +650,7 @@ struct chanrecv_ret
}; };
struct chanrecv_ret reflect_chanrecv(ChanType *, Hchan *, _Bool) struct chanrecv_ret reflect_chanrecv(ChanType *, Hchan *, _Bool)
__asm__("reflect.chanrecv"); __asm__ (GOSYM_PREFIX "reflect.chanrecv");
struct chanrecv_ret struct chanrecv_ret
reflect_chanrecv(ChanType *t, Hchan *c, _Bool nb) reflect_chanrecv(ChanType *t, Hchan *c, _Bool nb)
...@@ -686,7 +686,7 @@ static void newselect(int32, Select**); ...@@ -686,7 +686,7 @@ static void newselect(int32, Select**);
// newselect(size uint32) (sel *byte); // newselect(size uint32) (sel *byte);
void* runtime_newselect(int32) __asm__("runtime.newselect"); void* runtime_newselect(int32) __asm__ (GOSYM_PREFIX "runtime.newselect");
void* void*
runtime_newselect(int32 size) runtime_newselect(int32 size)
...@@ -732,7 +732,7 @@ static void selectsend(Select *sel, Hchan *c, int index, void *elem); ...@@ -732,7 +732,7 @@ static void selectsend(Select *sel, Hchan *c, int index, void *elem);
// selectsend(sel *byte, hchan *chan any, elem *any) (selected bool); // selectsend(sel *byte, hchan *chan any, elem *any) (selected bool);
void runtime_selectsend(Select *, Hchan *, void *, int32) void runtime_selectsend(Select *, Hchan *, void *, int32)
__asm__("runtime.selectsend"); __asm__ (GOSYM_PREFIX "runtime.selectsend");
void void
runtime_selectsend(Select *sel, Hchan *c, void *elem, int32 index) runtime_selectsend(Select *sel, Hchan *c, void *elem, int32 index)
...@@ -772,7 +772,7 @@ static void selectrecv(Select *sel, Hchan *c, int index, void *elem, bool*); ...@@ -772,7 +772,7 @@ static void selectrecv(Select *sel, Hchan *c, int index, void *elem, bool*);
// selectrecv(sel *byte, hchan *chan any, elem *any) (selected bool); // selectrecv(sel *byte, hchan *chan any, elem *any) (selected bool);
void runtime_selectrecv(Select *, Hchan *, void *, int32) void runtime_selectrecv(Select *, Hchan *, void *, int32)
__asm__("runtime.selectrecv"); __asm__ (GOSYM_PREFIX "runtime.selectrecv");
void void
runtime_selectrecv(Select *sel, Hchan *c, void *elem, int32 index) runtime_selectrecv(Select *sel, Hchan *c, void *elem, int32 index)
...@@ -787,7 +787,7 @@ runtime_selectrecv(Select *sel, Hchan *c, void *elem, int32 index) ...@@ -787,7 +787,7 @@ runtime_selectrecv(Select *sel, Hchan *c, void *elem, int32 index)
// selectrecv2(sel *byte, hchan *chan any, elem *any, received *bool) (selected bool); // selectrecv2(sel *byte, hchan *chan any, elem *any, received *bool) (selected bool);
void runtime_selectrecv2(Select *, Hchan *, void *, bool *, int32) void runtime_selectrecv2(Select *, Hchan *, void *, bool *, int32)
__asm__("runtime.selectrecv2"); __asm__ (GOSYM_PREFIX "runtime.selectrecv2");
void void
runtime_selectrecv2(Select *sel, Hchan *c, void *elem, bool *received, int32 index) runtime_selectrecv2(Select *sel, Hchan *c, void *elem, bool *received, int32 index)
...@@ -827,7 +827,7 @@ static void selectdefault(Select*, int); ...@@ -827,7 +827,7 @@ static void selectdefault(Select*, int);
// selectdefault(sel *byte) (selected bool); // selectdefault(sel *byte) (selected bool);
void runtime_selectdefault(Select *, int32) __asm__("runtime.selectdefault"); void runtime_selectdefault(Select *, int32) __asm__ (GOSYM_PREFIX "runtime.selectdefault");
void void
runtime_selectdefault(Select *sel, int32 index) runtime_selectdefault(Select *sel, int32 index)
...@@ -898,7 +898,7 @@ static int selectgo(Select**); ...@@ -898,7 +898,7 @@ static int selectgo(Select**);
// selectgo(sel *byte); // selectgo(sel *byte);
int runtime_selectgo(Select *) __asm__("runtime.selectgo"); int runtime_selectgo(Select *) __asm__ (GOSYM_PREFIX "runtime.selectgo");
int int
runtime_selectgo(Select *sel) runtime_selectgo(Select *sel)
...@@ -1181,7 +1181,7 @@ struct rselect_ret { ...@@ -1181,7 +1181,7 @@ struct rselect_ret {
// func rselect(cases []runtimeSelect) (chosen int, word uintptr, recvOK bool) // func rselect(cases []runtimeSelect) (chosen int, word uintptr, recvOK bool)
struct rselect_ret reflect_rselect(Slice) struct rselect_ret reflect_rselect(Slice)
asm("reflect.rselect"); __asm__ (GOSYM_PREFIX "reflect.rselect");
struct rselect_ret struct rselect_ret
reflect_rselect(Slice cases) reflect_rselect(Slice cases)
...@@ -1309,7 +1309,7 @@ __go_builtin_close(Hchan *c) ...@@ -1309,7 +1309,7 @@ __go_builtin_close(Hchan *c)
// For reflect // For reflect
// func chanclose(c chan) // func chanclose(c chan)
void reflect_chanclose(uintptr) __asm__("reflect.chanclose"); void reflect_chanclose(uintptr) __asm__ (GOSYM_PREFIX "reflect.chanclose");
void void
reflect_chanclose(uintptr c) reflect_chanclose(uintptr c)
...@@ -1320,7 +1320,7 @@ reflect_chanclose(uintptr c) ...@@ -1320,7 +1320,7 @@ reflect_chanclose(uintptr c)
// For reflect // For reflect
// func chanlen(c chan) (len int) // func chanlen(c chan) (len int)
intgo reflect_chanlen(uintptr) __asm__("reflect.chanlen"); intgo reflect_chanlen(uintptr) __asm__ (GOSYM_PREFIX "reflect.chanlen");
intgo intgo
reflect_chanlen(uintptr ca) reflect_chanlen(uintptr ca)
...@@ -1345,7 +1345,7 @@ __go_chan_len(Hchan *c) ...@@ -1345,7 +1345,7 @@ __go_chan_len(Hchan *c)
// For reflect // For reflect
// func chancap(c chan) (cap intgo) // func chancap(c chan) (cap intgo)
intgo reflect_chancap(uintptr) __asm__("reflect.chancap"); intgo reflect_chancap(uintptr) __asm__ (GOSYM_PREFIX "reflect.chancap");
intgo intgo
reflect_chancap(uintptr ca) reflect_chancap(uintptr ca)
......
...@@ -125,7 +125,7 @@ static void LostProfileData(void) { ...@@ -125,7 +125,7 @@ static void LostProfileData(void) {
} }
extern void runtime_SetCPUProfileRate(intgo) extern void runtime_SetCPUProfileRate(intgo)
__asm__("runtime.SetCPUProfileRate"); __asm__ (GOSYM_PREFIX "runtime.SetCPUProfileRate");
// SetCPUProfileRate sets the CPU profiling rate. // SetCPUProfileRate sets the CPU profiling rate.
// The user documentation is in debug.go. // The user documentation is in debug.go.
...@@ -436,7 +436,7 @@ breakflush: ...@@ -436,7 +436,7 @@ breakflush:
} }
extern Slice runtime_CPUProfile(void) extern Slice runtime_CPUProfile(void)
__asm__("runtime.CPUProfile"); __asm__ (GOSYM_PREFIX "runtime.CPUProfile");
// CPUProfile returns the next cpu profile block as a []byte. // CPUProfile returns the next cpu profile block as a []byte.
// The user documentation is in debug.go. // The user documentation is in debug.go.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "runtime.h" #include "runtime.h"
#include "array.h" #include "array.h"
extern Slice syscall_Envs asm ("syscall.Envs"); extern Slice syscall_Envs __asm__ (GOSYM_PREFIX "syscall.Envs");
const byte* const byte*
runtime_getenv(const char *s) runtime_getenv(const char *s)
......
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
#include <sched.h> #include <sched.h>
void Breakpoint (void) asm ("runtime.Breakpoint"); #include "runtime.h"
void Breakpoint (void) __asm__ (GOSYM_PREFIX "runtime.Breakpoint");
void void
Breakpoint (void) Breakpoint (void)
......
...@@ -156,9 +156,9 @@ struct caller_ret ...@@ -156,9 +156,9 @@ struct caller_ret
_Bool ok; _Bool ok;
}; };
struct caller_ret Caller (int n) asm ("runtime.Caller"); struct caller_ret Caller (int n) __asm__ (GOSYM_PREFIX "runtime.Caller");
Func *FuncForPC (uintptr_t) asm ("runtime.FuncForPC"); Func *FuncForPC (uintptr_t) __asm__ (GOSYM_PREFIX "runtime.FuncForPC");
/* Implement runtime.Caller. */ /* Implement runtime.Caller. */
...@@ -216,7 +216,7 @@ struct funcline_go_return ...@@ -216,7 +216,7 @@ struct funcline_go_return
struct funcline_go_return struct funcline_go_return
runtime_funcline_go (Func *f, uintptr targetpc) runtime_funcline_go (Func *f, uintptr targetpc)
__asm__ ("runtime.funcline_go"); __asm__ (GOSYM_PREFIX "runtime.funcline_go");
struct funcline_go_return struct funcline_go_return
runtime_funcline_go (Func *f __attribute__((unused)), uintptr targetpc) runtime_funcline_go (Func *f __attribute__((unused)), uintptr targetpc)
......
...@@ -60,7 +60,7 @@ runtime_callers (int32 skip, uintptr *pcbuf, int32 m) ...@@ -60,7 +60,7 @@ runtime_callers (int32 skip, uintptr *pcbuf, int32 m)
} }
int Callers (int, struct __go_open_array) int Callers (int, struct __go_open_array)
__asm__ ("runtime.Callers"); __asm__ (GOSYM_PREFIX "runtime.Callers");
int int
Callers (int skip, struct __go_open_array pc) Callers (int skip, struct __go_open_array pc)
......
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
*/ */
/* We let Go code call these via the syscall package. */ /* We let Go code call these via the syscall package. */
void syscall_cgocall(void) __asm__ ("syscall.Cgocall"); void syscall_cgocall(void) __asm__ (GOSYM_PREFIX "syscall.Cgocall");
void syscall_cgocalldone(void) __asm__ ("syscall.CgocallDone"); void syscall_cgocalldone(void) __asm__ (GOSYM_PREFIX "syscall.CgocallDone");
void syscall_cgocallback(void) __asm__ ("syscall.CgocallBack"); void syscall_cgocallback(void) __asm__ (GOSYM_PREFIX "syscall.CgocallBack");
void syscall_cgocallbackdone(void) __asm__ ("syscall.CgocallBackDone"); void syscall_cgocallbackdone(void) __asm__ (GOSYM_PREFIX "syscall.CgocallBackDone");
void void
syscall_cgocall () syscall_cgocall ()
...@@ -119,7 +119,7 @@ _cgo_allocate (size_t n) ...@@ -119,7 +119,7 @@ _cgo_allocate (size_t n)
} }
extern const struct __go_type_descriptor string_type_descriptor extern const struct __go_type_descriptor string_type_descriptor
asm ("__go_tdn_string"); __asm__ (GOSYM_PREFIX "__go_tdn_string");
void void
_cgo_panic (const char *p) _cgo_panic (const char *p)
...@@ -152,7 +152,7 @@ _cgo_panic (const char *p) ...@@ -152,7 +152,7 @@ _cgo_panic (const char *p)
/* Return the number of CGO calls. */ /* Return the number of CGO calls. */
int64 runtime_NumCgoCall (void) __asm__ ("runtime.NumCgoCall"); int64 runtime_NumCgoCall (void) __asm__ (GOSYM_PREFIX "runtime.NumCgoCall");
int64 int64
runtime_NumCgoCall (void) runtime_NumCgoCall (void)
......
...@@ -34,7 +34,7 @@ extern const char _edata[] __attribute__ ((weak)); ...@@ -34,7 +34,7 @@ extern const char _edata[] __attribute__ ((weak));
extern const char __edata[] __attribute__ ((weak)); extern const char __edata[] __attribute__ ((weak));
extern const char __bss_start[] __attribute__ ((weak)); extern const char __bss_start[] __attribute__ ((weak));
void runtime_Fieldtrack (struct __go_map *) __asm__ ("runtime.Fieldtrack"); void runtime_Fieldtrack (struct __go_map *) __asm__ (GOSYM_PREFIX "runtime.Fieldtrack");
void void
runtime_Fieldtrack (struct __go_map *m) runtime_Fieldtrack (struct __go_map *m)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "runtime.h" #include "runtime.h"
String getgoroot (void) asm ("runtime.getgoroot"); String getgoroot (void) __asm__ (GOSYM_PREFIX "runtime.getgoroot");
String String
getgoroot () getgoroot ()
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include <stdint.h> #include <stdint.h>
#include <sys/time.h> #include <sys/time.h>
#include "runtime.h"
// Return current time. This is the implementation of time.now(). // Return current time. This is the implementation of time.now().
struct time_now_ret struct time_now_ret
...@@ -15,7 +17,7 @@ struct time_now_ret ...@@ -15,7 +17,7 @@ struct time_now_ret
}; };
struct time_now_ret now() struct time_now_ret now()
__asm__ ("time.now") __asm__ (GOSYM_PREFIX "time.now")
__attribute__ ((no_split_stack)); __attribute__ ((no_split_stack));
struct time_now_ret struct time_now_ret
......
...@@ -24,7 +24,7 @@ struct mapaccess_ret ...@@ -24,7 +24,7 @@ struct mapaccess_ret
extern struct mapaccess_ret mapaccess (struct __go_map_type *, uintptr_t, extern struct mapaccess_ret mapaccess (struct __go_map_type *, uintptr_t,
uintptr_t) uintptr_t)
asm ("reflect.mapaccess"); __asm__ (GOSYM_PREFIX "reflect.mapaccess");
struct mapaccess_ret struct mapaccess_ret
mapaccess (struct __go_map_type *mt, uintptr_t m, uintptr_t key_i) mapaccess (struct __go_map_type *mt, uintptr_t m, uintptr_t key_i)
...@@ -77,7 +77,7 @@ mapaccess (struct __go_map_type *mt, uintptr_t m, uintptr_t key_i) ...@@ -77,7 +77,7 @@ mapaccess (struct __go_map_type *mt, uintptr_t m, uintptr_t key_i)
extern void mapassign (struct __go_map_type *, uintptr_t, uintptr_t, extern void mapassign (struct __go_map_type *, uintptr_t, uintptr_t,
uintptr_t, _Bool) uintptr_t, _Bool)
asm ("reflect.mapassign"); __asm__ (GOSYM_PREFIX "reflect.mapassign");
void void
mapassign (struct __go_map_type *mt, uintptr_t m, uintptr_t key_i, mapassign (struct __go_map_type *mt, uintptr_t m, uintptr_t key_i,
...@@ -118,7 +118,7 @@ mapassign (struct __go_map_type *mt, uintptr_t m, uintptr_t key_i, ...@@ -118,7 +118,7 @@ mapassign (struct __go_map_type *mt, uintptr_t m, uintptr_t key_i,
} }
extern int32_t maplen (uintptr_t) extern int32_t maplen (uintptr_t)
asm ("reflect.maplen"); __asm__ (GOSYM_PREFIX "reflect.maplen");
int32_t int32_t
maplen (uintptr_t m) maplen (uintptr_t m)
...@@ -131,7 +131,7 @@ maplen (uintptr_t m) ...@@ -131,7 +131,7 @@ maplen (uintptr_t m)
} }
extern unsigned char *mapiterinit (struct __go_map_type *, uintptr_t) extern unsigned char *mapiterinit (struct __go_map_type *, uintptr_t)
asm ("reflect.mapiterinit"); __asm__ (GOSYM_PREFIX "reflect.mapiterinit");
unsigned char * unsigned char *
mapiterinit (struct __go_map_type *mt, uintptr_t m) mapiterinit (struct __go_map_type *mt, uintptr_t m)
...@@ -145,7 +145,7 @@ mapiterinit (struct __go_map_type *mt, uintptr_t m) ...@@ -145,7 +145,7 @@ mapiterinit (struct __go_map_type *mt, uintptr_t m)
} }
extern void mapiternext (unsigned char *) extern void mapiternext (unsigned char *)
asm ("reflect.mapiternext"); __asm__ (GOSYM_PREFIX "reflect.mapiternext");
void void
mapiternext (unsigned char *it) mapiternext (unsigned char *it)
...@@ -160,7 +160,7 @@ struct mapiterkey_ret ...@@ -160,7 +160,7 @@ struct mapiterkey_ret
}; };
extern struct mapiterkey_ret mapiterkey (unsigned char *) extern struct mapiterkey_ret mapiterkey (unsigned char *)
asm ("reflect.mapiterkey"); __asm__ (GOSYM_PREFIX "reflect.mapiterkey");
struct mapiterkey_ret struct mapiterkey_ret
mapiterkey (unsigned char *ita) mapiterkey (unsigned char *ita)
...@@ -203,7 +203,7 @@ mapiterkey (unsigned char *ita) ...@@ -203,7 +203,7 @@ mapiterkey (unsigned char *ita)
/* Make a new map. We have to build our own map descriptor. */ /* Make a new map. We have to build our own map descriptor. */
extern uintptr_t makemap (const struct __go_map_type *) extern uintptr_t makemap (const struct __go_map_type *)
asm ("reflect.makemap"); __asm__ (GOSYM_PREFIX "reflect.makemap");
uintptr_t uintptr_t
makemap (const struct __go_map_type *t) makemap (const struct __go_map_type *t)
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/* Set the C environment from Go. This is called by syscall.Setenv. */ /* Set the C environment from Go. This is called by syscall.Setenv. */
void setenv_c (String, String) __asm__ ("syscall.setenv_c"); void setenv_c (String, String) __asm__ (GOSYM_PREFIX "syscall.setenv_c");
void void
setenv_c (String k, String v) setenv_c (String k, String v)
......
...@@ -457,7 +457,7 @@ runtime_setsig (int32 i, bool def __attribute__ ((unused)), bool restart) ...@@ -457,7 +457,7 @@ runtime_setsig (int32 i, bool def __attribute__ ((unused)), bool restart)
/* Used by the os package to raise SIGPIPE. */ /* Used by the os package to raise SIGPIPE. */
void os_sigpipe (void) __asm__ ("os.sigpipe"); void os_sigpipe (void) __asm__ (GOSYM_PREFIX "os.sigpipe");
void void
os_sigpipe (void) os_sigpipe (void)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "interface.h" #include "interface.h"
#include "go-type.h" #include "go-type.h"
String typestring(struct __go_empty_interface) asm ("runtime.typestring"); String typestring(struct __go_empty_interface) __asm__ (GOSYM_PREFIX "runtime.typestring");
String String
typestring (struct __go_empty_interface e) typestring (struct __go_empty_interface e)
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/* Implement unsafe_New, called from the reflect package. */ /* Implement unsafe_New, called from the reflect package. */
void *unsafe_New (const struct __go_type_descriptor *) void *unsafe_New (const struct __go_type_descriptor *)
asm ("reflect.unsafe_New"); __asm__ (GOSYM_PREFIX "reflect.unsafe_New");
/* The dynamic type of the argument will be a pointer to a type /* The dynamic type of the argument will be a pointer to a type
descriptor. */ descriptor. */
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/* Implement unsafe_NewArray, called from the reflect package. */ /* Implement unsafe_NewArray, called from the reflect package. */
void *unsafe_NewArray (const struct __go_type_descriptor *, intgo) void *unsafe_NewArray (const struct __go_type_descriptor *, intgo)
asm ("reflect.unsafe_NewArray"); __asm__ (GOSYM_PREFIX "reflect.unsafe_NewArray");
/* The dynamic type of the argument will be a pointer to a type /* The dynamic type of the argument will be a pointer to a type
descriptor. */ descriptor. */
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
descriptor. */ descriptor. */
extern const struct __go_type_descriptor unsafe_Pointer extern const struct __go_type_descriptor unsafe_Pointer
asm ("__go_tdn_unsafe.Pointer"); __asm__ (GOSYM_PREFIX "__go_tdn_unsafe.Pointer");
/* Used to determine the field alignment. */ /* Used to determine the field alignment. */
struct field_align struct field_align
...@@ -61,7 +61,7 @@ const struct __go_type_descriptor unsafe_Pointer = ...@@ -61,7 +61,7 @@ const struct __go_type_descriptor unsafe_Pointer =
it to be defined elsewhere. */ it to be defined elsewhere. */
extern const struct __go_ptr_type pointer_unsafe_Pointer extern const struct __go_ptr_type pointer_unsafe_Pointer
asm ("__go_td_pN14_unsafe.Pointer"); __asm__ (GOSYM_PREFIX "__go_td_pN14_unsafe.Pointer");
/* The reflection string. */ /* The reflection string. */
#define PREFLECTION "*unsafe.Pointer" #define PREFLECTION "*unsafe.Pointer"
......
...@@ -488,7 +488,7 @@ write_gcc_func_header(char *package, char *name, struct params *params, ...@@ -488,7 +488,7 @@ write_gcc_func_header(char *package, char *name, struct params *params,
printf(" %s_%s(", package, name); printf(" %s_%s(", package, name);
first = 1; first = 1;
write_params(params, &first); write_params(params, &first);
printf(") asm (\""); printf(") __asm__ (GOSYM_PREFIX \"");
if (pkgpath != NULL) if (pkgpath != NULL)
printf("%s", pkgpath); printf("%s", pkgpath);
else if (prefix != NULL) else if (prefix != NULL)
......
...@@ -57,7 +57,7 @@ runtime_lfstackpop(uint64 *head) ...@@ -57,7 +57,7 @@ runtime_lfstackpop(uint64 *head)
} }
LFNode* runtime_lfstackpop2(uint64*) LFNode* runtime_lfstackpop2(uint64*)
asm("runtime.lfstackpop2"); __asm__ (GOSYM_PREFIX "runtime.lfstackpop2");
LFNode* LFNode*
runtime_lfstackpop2(uint64 *head) runtime_lfstackpop2(uint64 *head)
......
...@@ -23,7 +23,7 @@ MHeap runtime_mheap; ...@@ -23,7 +23,7 @@ MHeap runtime_mheap;
extern MStats mstats; // defined in zruntime_def_$GOOS_$GOARCH.go extern MStats mstats; // defined in zruntime_def_$GOOS_$GOARCH.go
extern volatile intgo runtime_MemProfileRate extern volatile intgo runtime_MemProfileRate
__asm__ ("runtime.MemProfileRate"); __asm__ (GOSYM_PREFIX "runtime.MemProfileRate");
// Allocate an object of at least size bytes. // Allocate an object of at least size bytes.
// Small objects are allocated from the per-thread cache's free lists. // Small objects are allocated from the per-thread cache's free lists.
...@@ -308,7 +308,7 @@ runtime_purgecachedstats(MCache *c) ...@@ -308,7 +308,7 @@ runtime_purgecachedstats(MCache *c)
} }
extern uintptr runtime_sizeof_C_MStats extern uintptr runtime_sizeof_C_MStats
__asm__ ("runtime.Sizeof_C_MStats"); __asm__ (GOSYM_PREFIX "runtime.Sizeof_C_MStats");
#define MaxArena32 (2U<<30) #define MaxArena32 (2U<<30)
......
...@@ -247,7 +247,7 @@ struct MStats ...@@ -247,7 +247,7 @@ struct MStats
}; };
extern MStats mstats extern MStats mstats
__asm__ ("runtime.VmemStats"); __asm__ (GOSYM_PREFIX "runtime.VmemStats");
// Size classes. Computed and initialized by InitSizes. // Size classes. Computed and initialized by InitSizes.
......
...@@ -1449,7 +1449,7 @@ gc(struct gc_args *args) ...@@ -1449,7 +1449,7 @@ gc(struct gc_args *args)
} }
void runtime_ReadMemStats(MStats *) void runtime_ReadMemStats(MStats *)
__asm__("runtime.ReadMemStats"); __asm__ (GOSYM_PREFIX "runtime.ReadMemStats");
void void
runtime_ReadMemStats(MStats *stats) runtime_ReadMemStats(MStats *stats)
......
...@@ -285,7 +285,7 @@ runtime_MProf_Free(void *p, uintptr size) ...@@ -285,7 +285,7 @@ runtime_MProf_Free(void *p, uintptr size)
int64 runtime_blockprofilerate; // in CPU ticks int64 runtime_blockprofilerate; // in CPU ticks
void runtime_SetBlockProfileRate(intgo) asm("runtime.SetBlockProfileRate"); void runtime_SetBlockProfileRate(intgo) __asm__ (GOSYM_PREFIX "runtime.SetBlockProfileRate");
void void
runtime_SetBlockProfileRate(intgo rate) runtime_SetBlockProfileRate(intgo rate)
......
...@@ -106,7 +106,7 @@ runtime_panicstring(const char *s) ...@@ -106,7 +106,7 @@ runtime_panicstring(const char *s)
runtime_panic(err); runtime_panic(err);
} }
void runtime_Goexit (void) asm ("runtime.Goexit"); void runtime_Goexit (void) __asm__ (GOSYM_PREFIX "runtime.Goexit");
void void
runtime_Goexit(void) runtime_Goexit(void)
......
...@@ -37,7 +37,7 @@ runtime_parforalloc(uint32 nthrmax) ...@@ -37,7 +37,7 @@ runtime_parforalloc(uint32 nthrmax)
// func parforalloc2(nthrmax uint32) *ParFor // func parforalloc2(nthrmax uint32) *ParFor
ParFor *runtime_parforalloc2(uint32) ParFor *runtime_parforalloc2(uint32)
asm("runtime.parforalloc2"); __asm__ (GOSYM_PREFIX "runtime.parforalloc2");
ParFor * ParFor *
runtime_parforalloc2(uint32 nthrmax) runtime_parforalloc2(uint32 nthrmax)
...@@ -78,7 +78,7 @@ runtime_parforsetup(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, v ...@@ -78,7 +78,7 @@ runtime_parforsetup(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, v
// func parforsetup2(desc *ParFor, nthr, n uint32, ctx *byte, wait bool, body func(*ParFor, uint32)) // func parforsetup2(desc *ParFor, nthr, n uint32, ctx *byte, wait bool, body func(*ParFor, uint32))
void runtime_parforsetup2(ParFor *, uint32, uint32, void *, bool, void *) void runtime_parforsetup2(ParFor *, uint32, uint32, void *, bool, void *)
asm("runtime.parforsetup2"); __asm__ (GOSYM_PREFIX "runtime.parforsetup2");
void void
runtime_parforsetup2(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, void *body) runtime_parforsetup2(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, void *body)
...@@ -219,7 +219,7 @@ struct parforiters_ret { ...@@ -219,7 +219,7 @@ struct parforiters_ret {
}; };
struct parforiters_ret runtime_parforiters(ParFor *, uintptr) struct parforiters_ret runtime_parforiters(ParFor *, uintptr)
asm("runtime.parforiters"); __asm__ (GOSYM_PREFIX "runtime.parforiters");
struct parforiters_ret struct parforiters_ret
runtime_parforiters(ParFor *desc, uintptr tid) runtime_parforiters(ParFor *desc, uintptr tid)
......
...@@ -503,8 +503,8 @@ runtime_schedinit(void) ...@@ -503,8 +503,8 @@ runtime_schedinit(void)
runtime_raceinit(); runtime_raceinit();
} }
extern void main_init(void) __asm__ ("__go_init_main"); extern void main_init(void) __asm__ (GOSYM_PREFIX "__go_init_main");
extern void main_main(void) __asm__ ("main.main"); extern void main_main(void) __asm__ (GOSYM_PREFIX "main.main");
// The main goroutine. // The main goroutine.
void void
...@@ -1500,7 +1500,7 @@ runtime_malg(int32 stacksize, byte** ret_stack, size_t* ret_stacksize) ...@@ -1500,7 +1500,7 @@ runtime_malg(int32 stacksize, byte** ret_stack, size_t* ret_stacksize)
/* For runtime package testing. */ /* For runtime package testing. */
void runtime_testing_entersyscall(void) void runtime_testing_entersyscall(void)
__asm__("runtime.entersyscall"); __asm__ (GOSYM_PREFIX "runtime.entersyscall");
void void
runtime_testing_entersyscall() runtime_testing_entersyscall()
...@@ -1509,7 +1509,7 @@ runtime_testing_entersyscall() ...@@ -1509,7 +1509,7 @@ runtime_testing_entersyscall()
} }
void runtime_testing_exitsyscall(void) void runtime_testing_exitsyscall(void)
__asm__("runtime.exitsyscall"); __asm__ (GOSYM_PREFIX "runtime.exitsyscall");
void void
runtime_testing_exitsyscall() runtime_testing_exitsyscall()
...@@ -1609,7 +1609,7 @@ gfget(void) ...@@ -1609,7 +1609,7 @@ gfget(void)
return gp; return gp;
} }
void runtime_Gosched (void) asm ("runtime.Gosched"); void runtime_Gosched (void) __asm__ (GOSYM_PREFIX "runtime.Gosched");
void void
runtime_Gosched(void) runtime_Gosched(void)
...@@ -1688,7 +1688,7 @@ runtime_lockedOSThread(void) ...@@ -1688,7 +1688,7 @@ runtime_lockedOSThread(void)
// for testing of callbacks // for testing of callbacks
_Bool runtime_golockedOSThread(void) _Bool runtime_golockedOSThread(void)
asm("runtime.golockedOSThread"); __asm__ (GOSYM_PREFIX "runtime.golockedOSThread");
_Bool _Bool
runtime_golockedOSThread(void) runtime_golockedOSThread(void)
...@@ -1704,7 +1704,7 @@ runtime_mid() ...@@ -1704,7 +1704,7 @@ runtime_mid()
} }
intgo runtime_NumGoroutine (void) intgo runtime_NumGoroutine (void)
__asm__ ("runtime.NumGoroutine"); __asm__ (GOSYM_PREFIX "runtime.NumGoroutine");
intgo intgo
runtime_NumGoroutine() runtime_NumGoroutine()
......
...@@ -24,8 +24,8 @@ runtime_gotraceback(void) ...@@ -24,8 +24,8 @@ runtime_gotraceback(void)
static int32 argc; static int32 argc;
static byte** argv; static byte** argv;
extern Slice os_Args asm ("os.Args"); extern Slice os_Args __asm__ (GOSYM_PREFIX "os.Args");
extern Slice syscall_Envs asm ("syscall.Envs"); extern Slice syscall_Envs __asm__ (GOSYM_PREFIX "syscall.Envs");
void (*runtime_sysargs)(int32, uint8**); void (*runtime_sysargs)(int32, uint8**);
...@@ -172,7 +172,7 @@ runtime_tickspersecond(void) ...@@ -172,7 +172,7 @@ runtime_tickspersecond(void)
} }
int64 runtime_pprof_runtime_cyclesPerSecond(void) int64 runtime_pprof_runtime_cyclesPerSecond(void)
asm("runtime_pprof.runtime_cyclesPerSecond"); __asm__ (GOSYM_PREFIX "runtime_pprof.runtime_cyclesPerSecond");
int64 int64
runtime_pprof_runtime_cyclesPerSecond(void) runtime_pprof_runtime_cyclesPerSecond(void)
......
...@@ -24,6 +24,10 @@ ...@@ -24,6 +24,10 @@
#include "interface.h" #include "interface.h"
#include "go-alloc.h" #include "go-alloc.h"
#define _STRINGIFY2_(x) #x
#define _STRINGIFY_(x) _STRINGIFY2_(x)
#define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__)
/* This file supports C files copied from the 6g runtime library. /* This file supports C files copied from the 6g runtime library.
This is a version of the 6g runtime.h rewritten for gccgo's version This is a version of the 6g runtime.h rewritten for gccgo's version
of the code. */ of the code. */
...@@ -387,8 +391,8 @@ void runtime_park(void(*)(Lock*), Lock*, const char*); ...@@ -387,8 +391,8 @@ void runtime_park(void(*)(Lock*), Lock*, const char*);
void runtime_tsleep(int64, const char*); void runtime_tsleep(int64, const char*);
M* runtime_newm(void); M* runtime_newm(void);
void runtime_goexit(void); void runtime_goexit(void);
void runtime_entersyscall(void) __asm__("syscall.Entersyscall"); void runtime_entersyscall(void) __asm__ (GOSYM_PREFIX "syscall.Entersyscall");
void runtime_exitsyscall(void) __asm__("syscall.Exitsyscall"); void runtime_exitsyscall(void) __asm__ (GOSYM_PREFIX "syscall.Exitsyscall");
void siginit(void); void siginit(void);
bool __go_sigsend(int32 sig); bool __go_sigsend(int32 sig);
int32 runtime_callers(int32, uintptr*, int32); int32 runtime_callers(int32, uintptr*, int32);
...@@ -453,7 +457,7 @@ void runtime_futexwakeup(uint32*, uint32); ...@@ -453,7 +457,7 @@ void runtime_futexwakeup(uint32*, uint32);
* so they can be garbage collected if there are no other pointers to nodes. * so they can be garbage collected if there are no other pointers to nodes.
*/ */
void runtime_lfstackpush(uint64 *head, LFNode *node) void runtime_lfstackpush(uint64 *head, LFNode *node)
asm("runtime.lfstackpush"); __asm__ (GOSYM_PREFIX "runtime.lfstackpush");
LFNode* runtime_lfstackpop(uint64 *head); LFNode* runtime_lfstackpop(uint64 *head);
/* /*
...@@ -466,7 +470,7 @@ LFNode* runtime_lfstackpop(uint64 *head); ...@@ -466,7 +470,7 @@ LFNode* runtime_lfstackpop(uint64 *head);
*/ */
ParFor* runtime_parforalloc(uint32 nthrmax); ParFor* runtime_parforalloc(uint32 nthrmax);
void runtime_parforsetup(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, void (*body)(ParFor*, uint32)); void runtime_parforsetup(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, void (*body)(ParFor*, uint32));
void runtime_parfordo(ParFor *desc) asm("runtime.parfordo"); void runtime_parfordo(ParFor *desc) __asm__ (GOSYM_PREFIX "runtime.parfordo");
/* /*
* low level C-called * low level C-called
...@@ -514,7 +518,7 @@ void runtime_printcomplex(__complex double); ...@@ -514,7 +518,7 @@ void runtime_printcomplex(__complex double);
struct __go_func_type; struct __go_func_type;
void reflect_call(const struct __go_func_type *, const void *, _Bool, _Bool, void reflect_call(const struct __go_func_type *, const void *, _Bool, _Bool,
void **, void **) void **, void **)
asm ("reflect.call"); __asm__ (GOSYM_PREFIX "reflect.call");
/* Functions. */ /* Functions. */
#define runtime_panic __go_panic #define runtime_panic __go_panic
...@@ -562,11 +566,11 @@ void runtime_usleep(uint32); ...@@ -562,11 +566,11 @@ void runtime_usleep(uint32);
* runtime c-called (but written in Go) * runtime c-called (but written in Go)
*/ */
void runtime_printany(Eface) void runtime_printany(Eface)
__asm__("runtime.Printany"); __asm__ (GOSYM_PREFIX "runtime.Printany");
void runtime_newTypeAssertionError(const String*, const String*, const String*, const String*, Eface*) void runtime_newTypeAssertionError(const String*, const String*, const String*, const String*, Eface*)
__asm__("runtime.NewTypeAssertionError"); __asm__ (GOSYM_PREFIX "runtime.NewTypeAssertionError");
void runtime_newErrorString(String, Eface*) void runtime_newErrorString(String, Eface*)
__asm__("runtime.NewErrorString"); __asm__ (GOSYM_PREFIX "runtime.NewErrorString");
/* /*
* wrapped for go users * wrapped for go users
...@@ -577,8 +581,8 @@ void runtime_semrelease(uint32 volatile *); ...@@ -577,8 +581,8 @@ void runtime_semrelease(uint32 volatile *);
int32 runtime_gomaxprocsfunc(int32 n); int32 runtime_gomaxprocsfunc(int32 n);
void runtime_procyield(uint32); void runtime_procyield(uint32);
void runtime_osyield(void); void runtime_osyield(void);
void runtime_LockOSThread(void) __asm__("runtime.LockOSThread"); void runtime_LockOSThread(void) __asm__ (GOSYM_PREFIX "runtime.LockOSThread");
void runtime_UnlockOSThread(void) __asm__("runtime.UnlockOSThread"); void runtime_UnlockOSThread(void) __asm__ (GOSYM_PREFIX "runtime.UnlockOSThread");
bool runtime_showframe(String); bool runtime_showframe(String);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment