aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-05-14 22:08:42 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-05-14 22:08:42 +0000
commitf3ab5720f7ce7835a905e6783b5b6720676331fb (patch)
treeb119ee23a08a92b43632e3c7e227b3862c869fba /libgo/runtime
parent517f1b3430f929a25694d29dc787ec33e2cbd47f (diff)
downloadgcc-f3ab5720f7ce7835a905e6783b5b6720676331fb.zip
gcc-f3ab5720f7ce7835a905e6783b5b6720676331fb.tar.gz
gcc-f3ab5720f7ce7835a905e6783b5b6720676331fb.tar.bz2
libgo: Use -fgo-pkgpath.
From-SVN: r187485
Diffstat (limited to 'libgo/runtime')
-rw-r--r--libgo/runtime/chan.c12
-rw-r--r--libgo/runtime/cpuprof.c4
-rw-r--r--libgo/runtime/go-breakpoint.c2
-rw-r--r--libgo/runtime/go-caller.c8
-rw-r--r--libgo/runtime/go-callers.c2
-rw-r--r--libgo/runtime/go-getgoroot.c2
-rw-r--r--libgo/runtime/go-now.c2
-rw-r--r--libgo/runtime/go-reflect-map.c14
-rw-r--r--libgo/runtime/go-setenv.c2
-rw-r--r--libgo/runtime/go-signal.c2
-rw-r--r--libgo/runtime/go-typestring.c2
-rw-r--r--libgo/runtime/go-unsafe-new.c2
-rw-r--r--libgo/runtime/go-unsafe-newarray.c2
-rw-r--r--libgo/runtime/go-unsafe-pointer.c4
-rw-r--r--libgo/runtime/goc2c.c21
-rw-r--r--libgo/runtime/malloc.goc4
-rw-r--r--libgo/runtime/malloc.h2
-rw-r--r--libgo/runtime/mgc0.c2
-rw-r--r--libgo/runtime/proc.c12
-rw-r--r--libgo/runtime/runtime.c4
-rw-r--r--libgo/runtime/runtime.h16
21 files changed, 66 insertions, 55 deletions
diff --git a/libgo/runtime/chan.c b/libgo/runtime/chan.c
index db91d2c4..7cf307f 100644
--- a/libgo/runtime/chan.c
+++ b/libgo/runtime/chan.c
@@ -109,7 +109,7 @@ runtime_makechan_c(ChanType *t, int64 hint)
// For reflect
// func makechan(typ *ChanType, size uint32) (chan)
uintptr reflect_makechan(ChanType *, uint32)
- asm ("libgo_reflect.reflect.makechan");
+ asm ("reflect.makechan");
uintptr
reflect_makechan(ChanType *t, uint32 size)
@@ -568,7 +568,7 @@ runtime_selectnbrecv2(ChanType *t, byte *v, _Bool *received, Hchan *c)
// the actual data if it fits, or else a pointer to the data.
_Bool reflect_chansend(ChanType *, Hchan *, uintptr, _Bool)
- __asm__("libgo_reflect.reflect.chansend");
+ __asm__("reflect.chansend");
_Bool
reflect_chansend(ChanType *t, Hchan *c, uintptr val, _Bool nb)
@@ -605,7 +605,7 @@ struct chanrecv_ret
};
struct chanrecv_ret reflect_chanrecv(ChanType *, Hchan *, _Bool)
- __asm__("libgo_reflect.reflect.chanrecv");
+ __asm__("reflect.chanrecv");
struct chanrecv_ret
reflect_chanrecv(ChanType *t, Hchan *c, _Bool nb)
@@ -1161,7 +1161,7 @@ __go_builtin_close(Hchan *c)
// For reflect
// func chanclose(c chan)
-void reflect_chanclose(uintptr) __asm__("libgo_reflect.reflect.chanclose");
+void reflect_chanclose(uintptr) __asm__("reflect.chanclose");
void
reflect_chanclose(uintptr c)
@@ -1172,7 +1172,7 @@ reflect_chanclose(uintptr c)
// For reflect
// func chanlen(c chan) (len int32)
-int32 reflect_chanlen(uintptr) __asm__("libgo_reflect.reflect.chanlen");
+int32 reflect_chanlen(uintptr) __asm__("reflect.chanlen");
int32
reflect_chanlen(uintptr ca)
@@ -1197,7 +1197,7 @@ __go_chan_len(Hchan *c)
// For reflect
// func chancap(c chan) (cap int32)
-int32 reflect_chancap(uintptr) __asm__("libgo_reflect.reflect.chancap");
+int32 reflect_chancap(uintptr) __asm__("reflect.chancap");
int32
reflect_chancap(uintptr ca)
diff --git a/libgo/runtime/cpuprof.c b/libgo/runtime/cpuprof.c
index 5e3fc99..252948d 100644
--- a/libgo/runtime/cpuprof.c
+++ b/libgo/runtime/cpuprof.c
@@ -122,7 +122,7 @@ static void LostProfileData(void) {
}
extern void runtime_SetCPUProfileRate(int32)
- __asm__("libgo_runtime.runtime.SetCPUProfileRate");
+ __asm__("runtime.SetCPUProfileRate");
// SetCPUProfileRate sets the CPU profiling rate.
// The user documentation is in debug.go.
@@ -422,7 +422,7 @@ breakflush:
}
extern Slice runtime_CPUProfile(void)
- __asm__("libgo_runtime.runtime.CPUProfile");
+ __asm__("runtime.CPUProfile");
// CPUProfile returns the next cpu profile block as a []byte.
// The user documentation is in debug.go.
diff --git a/libgo/runtime/go-breakpoint.c b/libgo/runtime/go-breakpoint.c
index bb6eddc..5eebe18 100644
--- a/libgo/runtime/go-breakpoint.c
+++ b/libgo/runtime/go-breakpoint.c
@@ -6,7 +6,7 @@
#include <sched.h>
-void Breakpoint (void) asm ("libgo_runtime.runtime.Breakpoint");
+void Breakpoint (void) asm ("runtime.Breakpoint");
void
Breakpoint (void)
diff --git a/libgo/runtime/go-caller.c b/libgo/runtime/go-caller.c
index f2bebeb..dda3960 100644
--- a/libgo/runtime/go-caller.c
+++ b/libgo/runtime/go-caller.c
@@ -36,7 +36,7 @@ static symvalfn_type symvalfn;
function/file/line information. */
void RegisterDebugLookup (infofn_type, symvalfn_type)
- __asm__ ("libgo_runtime.runtime.RegisterDebugLookup");
+ __asm__ ("runtime.RegisterDebugLookup");
void
RegisterDebugLookup (infofn_type pi, symvalfn_type ps)
@@ -76,9 +76,9 @@ struct caller_ret
_Bool ok;
};
-struct caller_ret Caller (int n) asm ("libgo_runtime.runtime.Caller");
+struct caller_ret Caller (int n) asm ("runtime.Caller");
-Func *FuncForPC (uintptr_t) asm ("libgo_runtime.runtime.FuncForPC");
+Func *FuncForPC (uintptr_t) asm ("runtime.FuncForPC");
/* Implement runtime.Caller. */
@@ -132,7 +132,7 @@ struct funcline_go_return
struct funcline_go_return
runtime_funcline_go (Func *f, uintptr targetpc)
- __asm__ ("libgo_runtime.runtime.funcline_go");
+ __asm__ ("runtime.funcline_go");
struct funcline_go_return
runtime_funcline_go (Func *f __attribute__((unused)), uintptr targetpc)
diff --git a/libgo/runtime/go-callers.c b/libgo/runtime/go-callers.c
index 09556c3..2d8fce7 100644
--- a/libgo/runtime/go-callers.c
+++ b/libgo/runtime/go-callers.c
@@ -67,7 +67,7 @@ runtime_callers (int32 skip, uintptr *pcbuf, int32 m)
}
int Callers (int, struct __go_open_array)
- __asm__ ("libgo_runtime.runtime.Callers");
+ __asm__ ("runtime.Callers");
int
Callers (int skip, struct __go_open_array pc)
diff --git a/libgo/runtime/go-getgoroot.c b/libgo/runtime/go-getgoroot.c
index e74fee8..1db4afe 100644
--- a/libgo/runtime/go-getgoroot.c
+++ b/libgo/runtime/go-getgoroot.c
@@ -8,7 +8,7 @@
#include "go-string.h"
-struct __go_string getgoroot (void) asm ("libgo_runtime.runtime.getgoroot");
+struct __go_string getgoroot (void) asm ("runtime.getgoroot");
struct __go_string
getgoroot ()
diff --git a/libgo/runtime/go-now.c b/libgo/runtime/go-now.c
index 5df8085..ede4493 100644
--- a/libgo/runtime/go-now.c
+++ b/libgo/runtime/go-now.c
@@ -15,7 +15,7 @@ struct time_now_ret
};
struct time_now_ret now()
- __asm__ ("libgo_time.time.now")
+ __asm__ ("time.now")
__attribute__ ((no_split_stack));
struct time_now_ret
diff --git a/libgo/runtime/go-reflect-map.c b/libgo/runtime/go-reflect-map.c
index c06aef1..7ef632c 100644
--- a/libgo/runtime/go-reflect-map.c
+++ b/libgo/runtime/go-reflect-map.c
@@ -24,7 +24,7 @@ struct mapaccess_ret
extern struct mapaccess_ret mapaccess (struct __go_map_type *, uintptr_t,
uintptr_t)
- asm ("libgo_reflect.reflect.mapaccess");
+ asm ("reflect.mapaccess");
struct mapaccess_ret
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,
uintptr_t, _Bool)
- asm ("libgo_reflect.reflect.mapassign");
+ asm ("reflect.mapassign");
void
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)
- asm ("libgo_reflect.reflect.maplen");
+ asm ("reflect.maplen");
int32_t
maplen (uintptr_t m)
@@ -131,7 +131,7 @@ maplen (uintptr_t m)
}
extern unsigned char *mapiterinit (struct __go_map_type *, uintptr_t)
- asm ("libgo_reflect.reflect.mapiterinit");
+ asm ("reflect.mapiterinit");
unsigned char *
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 *)
- asm ("libgo_reflect.reflect.mapiternext");
+ asm ("reflect.mapiternext");
void
mapiternext (unsigned char *it)
@@ -160,7 +160,7 @@ struct mapiterkey_ret
};
extern struct mapiterkey_ret mapiterkey (unsigned char *)
- asm ("libgo_reflect.reflect.mapiterkey");
+ asm ("reflect.mapiterkey");
struct mapiterkey_ret
mapiterkey (unsigned char *ita)
@@ -203,7 +203,7 @@ mapiterkey (unsigned char *ita)
/* Make a new map. We have to build our own map descriptor. */
extern uintptr_t makemap (const struct __go_map_type *)
- asm ("libgo_reflect.reflect.makemap");
+ asm ("reflect.makemap");
uintptr_t
makemap (const struct __go_map_type *t)
diff --git a/libgo/runtime/go-setenv.c b/libgo/runtime/go-setenv.c
index a62796b..789ffdf 100644
--- a/libgo/runtime/go-setenv.c
+++ b/libgo/runtime/go-setenv.c
@@ -15,7 +15,7 @@
/* Set the C environment from Go. This is called by syscall.Setenv. */
void setenv_c (struct __go_string, struct __go_string)
- __asm__ ("libgo_syscall.syscall.setenv_c");
+ __asm__ ("syscall.setenv_c");
void
setenv_c (struct __go_string k, struct __go_string v)
diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c
index b698ae2..abe78c4 100644
--- a/libgo/runtime/go-signal.c
+++ b/libgo/runtime/go-signal.c
@@ -408,7 +408,7 @@ runtime_setsig (int32 i, bool def __attribute__ ((unused)), bool restart)
/* Used by the os package to raise SIGPIPE. */
-void os_sigpipe (void) __asm__ ("libgo_os.os.sigpipe");
+void os_sigpipe (void) __asm__ ("os.sigpipe");
void
os_sigpipe (void)
diff --git a/libgo/runtime/go-typestring.c b/libgo/runtime/go-typestring.c
index dcbbc65..d40c6ad 100644
--- a/libgo/runtime/go-typestring.c
+++ b/libgo/runtime/go-typestring.c
@@ -9,7 +9,7 @@
#include "go-string.h"
struct __go_string typestring(struct __go_empty_interface)
- asm ("libgo_runtime.runtime.typestring");
+ asm ("runtime.typestring");
struct __go_string
typestring (struct __go_empty_interface e)
diff --git a/libgo/runtime/go-unsafe-new.c b/libgo/runtime/go-unsafe-new.c
index 2b9e044..a75c388 100644
--- a/libgo/runtime/go-unsafe-new.c
+++ b/libgo/runtime/go-unsafe-new.c
@@ -12,7 +12,7 @@
/* Implement unsafe_New, called from the reflect package. */
void *unsafe_New (struct __go_empty_interface type)
- asm ("libgo_reflect.reflect.unsafe_New");
+ asm ("reflect.unsafe_New");
/* The dynamic type of the argument will be a pointer to a type
descriptor. */
diff --git a/libgo/runtime/go-unsafe-newarray.c b/libgo/runtime/go-unsafe-newarray.c
index f4c5595..67399ea 100644
--- a/libgo/runtime/go-unsafe-newarray.c
+++ b/libgo/runtime/go-unsafe-newarray.c
@@ -12,7 +12,7 @@
/* Implement unsafe_NewArray, called from the reflect package. */
void *unsafe_NewArray (struct __go_empty_interface type, int n)
- asm ("libgo_reflect.reflect.unsafe_NewArray");
+ asm ("reflect.unsafe_NewArray");
/* The dynamic type of the argument will be a pointer to a type
descriptor. */
diff --git a/libgo/runtime/go-unsafe-pointer.c b/libgo/runtime/go-unsafe-pointer.c
index 9ec1800..cda5936 100644
--- a/libgo/runtime/go-unsafe-pointer.c
+++ b/libgo/runtime/go-unsafe-pointer.c
@@ -15,7 +15,7 @@
descriptor. */
extern const struct __go_type_descriptor unsafe_Pointer
- asm ("__go_tdn_libgo_unsafe.unsafe.Pointer");
+ asm ("__go_tdn_unsafe.Pointer");
/* Used to determine the field alignment. */
struct field_align
@@ -61,7 +61,7 @@ const struct __go_type_descriptor unsafe_Pointer =
it to be defined elsewhere. */
extern const struct __go_ptr_type pointer_unsafe_Pointer
- asm ("__go_td_pN27_libgo_unsafe.unsafe.Pointer");
+ asm ("__go_td_pN14_unsafe.Pointer");
/* The reflection string. */
#define PREFLECTION "*unsafe.Pointer"
diff --git a/libgo/runtime/goc2c.c b/libgo/runtime/goc2c.c
index 93031ff..55c6d9b 100644
--- a/libgo/runtime/goc2c.c
+++ b/libgo/runtime/goc2c.c
@@ -33,6 +33,9 @@
/* Whether we're emitting for gcc */
static int gcc;
+/* Package path to use; only meaningful for gcc */
+static const char *pkgpath;
+
/* Package prefix to use; only meaningful for gcc */
static const char *prefix;
@@ -579,9 +582,13 @@ write_gcc_func_header(char *package, char *name, struct params *params,
first = 1;
write_params(params, &first);
printf(") asm (\"");
- if (prefix != NULL)
- printf("%s.", prefix);
- printf("%s.%s\");\n", package, name);
+ if (pkgpath != NULL)
+ printf("%s", pkgpath);
+ else if (prefix != NULL)
+ printf("%s.%s", prefix, package);
+ else
+ printf("%s", package);
+ printf(".%s\");\n", name);
write_gcc_return_type(package, name, rets);
printf(" %s_%s(", package, name);
first = 1;
@@ -724,7 +731,7 @@ process_file(void)
static void
usage(void)
{
- sysfatal("Usage: goc2c [--6g | --gc] [--go-prefix PREFIX] [file]\n");
+ sysfatal("Usage: goc2c [--6g | --gc] [--go-pkgpath PKGPATH] [--go-prefix PREFIX] [file]\n");
}
void
@@ -740,7 +747,11 @@ main(int argc, char **argv)
gcc = 0;
else if(strcmp(argv[1], "--gcc") == 0)
gcc = 1;
- else if (strcmp(argv[1], "--go-prefix") == 0 && argc > 2) {
+ else if (strcmp(argv[1], "--go-pkgpath") == 0 && argc > 2) {
+ pkgpath = argv[2];
+ argc--;
+ argv++;
+ } else if (strcmp(argv[1], "--go-prefix") == 0 && argc > 2) {
prefix = argv[2];
argc--;
argv++;
diff --git a/libgo/runtime/malloc.goc b/libgo/runtime/malloc.goc
index 253fdbe..ae5e15f 100644
--- a/libgo/runtime/malloc.goc
+++ b/libgo/runtime/malloc.goc
@@ -23,7 +23,7 @@ MHeap runtime_mheap;
extern MStats mstats; // defined in extern.go
extern volatile int32 runtime_MemProfileRate
- __asm__ ("libgo_runtime.runtime.MemProfileRate");
+ __asm__ ("runtime.MemProfileRate");
// Allocate an object of at least size bytes.
// Small objects are allocated from the per-thread cache's free lists.
@@ -266,7 +266,7 @@ runtime_purgecachedstats(M* m)
}
extern uintptr runtime_sizeof_C_MStats
- __asm__ ("libgo_runtime.runtime.Sizeof_C_MStats");
+ __asm__ ("runtime.Sizeof_C_MStats");
#define MaxArena32 (2U<<30)
diff --git a/libgo/runtime/malloc.h b/libgo/runtime/malloc.h
index 4cb07477..16bb449 100644
--- a/libgo/runtime/malloc.h
+++ b/libgo/runtime/malloc.h
@@ -237,7 +237,7 @@ struct MStats
};
extern MStats mstats
- __asm__ ("libgo_runtime.runtime.VmemStats");
+ __asm__ ("runtime.VmemStats");
// Size classes. Computed and initialized by InitSizes.
diff --git a/libgo/runtime/mgc0.c b/libgo/runtime/mgc0.c
index 7e68535..c08d5c1 100644
--- a/libgo/runtime/mgc0.c
+++ b/libgo/runtime/mgc0.c
@@ -1078,7 +1078,7 @@ runtime_gc(int32 force)
}
void runtime_ReadMemStats(MStats *)
- __asm__("libgo_runtime.runtime.ReadMemStats");
+ __asm__("runtime.ReadMemStats");
void
runtime_ReadMemStats(MStats *stats)
diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c
index 660c69f..eabd5e8 100644
--- a/libgo/runtime/proc.c
+++ b/libgo/runtime/proc.c
@@ -1300,7 +1300,7 @@ runtime_malg(int32 stacksize, byte** ret_stack, size_t* ret_stacksize)
/* For runtime package testing. */
void runtime_testing_entersyscall(void)
- __asm__("libgo_runtime.runtime.entersyscall");
+ __asm__("runtime.entersyscall");
void
runtime_testing_entersyscall()
@@ -1309,7 +1309,7 @@ runtime_testing_entersyscall()
}
void runtime_testing_exitsyscall(void)
- __asm__("libgo_runtime.runtime.exitsyscall");
+ __asm__("runtime.exitsyscall");
void
runtime_testing_exitsyscall()
@@ -1416,7 +1416,7 @@ rundefer(void)
}
}
-void runtime_Goexit (void) asm ("libgo_runtime.runtime.Goexit");
+void runtime_Goexit (void) asm ("runtime.Goexit");
void
runtime_Goexit(void)
@@ -1425,7 +1425,7 @@ runtime_Goexit(void)
runtime_goexit();
}
-void runtime_Gosched (void) asm ("libgo_runtime.runtime.Gosched");
+void runtime_Gosched (void) asm ("runtime.Gosched");
void
runtime_Gosched(void)
@@ -1504,7 +1504,7 @@ runtime_lockedOSThread(void)
// for testing of callbacks
_Bool runtime_golockedOSThread(void)
- asm("libgo_runtime.runtime.golockedOSThread");
+ asm("runtime.golockedOSThread");
_Bool
runtime_golockedOSThread(void)
@@ -1520,7 +1520,7 @@ runtime_mid()
}
int32 runtime_NumGoroutine (void)
- __asm__ ("libgo_runtime.runtime.NumGoroutine");
+ __asm__ ("runtime.NumGoroutine");
int32
runtime_NumGoroutine()
diff --git a/libgo/runtime/runtime.c b/libgo/runtime/runtime.c
index a0dbf80..c8443cb 100644
--- a/libgo/runtime/runtime.c
+++ b/libgo/runtime/runtime.c
@@ -86,8 +86,8 @@ runtime_panicstring(const char *s)
static int32 argc;
static byte** argv;
-extern Slice os_Args asm ("libgo_os.os.Args");
-extern Slice syscall_Envs asm ("libgo_syscall.syscall.Envs");
+extern Slice os_Args asm ("os.Args");
+extern Slice syscall_Envs asm ("syscall.Envs");
void
runtime_args(int32 c, byte **v)
diff --git a/libgo/runtime/runtime.h b/libgo/runtime/runtime.h
index d379f99..3e75b15 100644
--- a/libgo/runtime/runtime.h
+++ b/libgo/runtime/runtime.h
@@ -298,8 +298,8 @@ void runtime_gosched(void);
void runtime_tsleep(int64);
M* runtime_newm(void);
void runtime_goexit(void);
-void runtime_entersyscall(void) __asm__("libgo_syscall.syscall.Entersyscall");
-void runtime_exitsyscall(void) __asm__("libgo_syscall.syscall.Exitsyscall");
+void runtime_entersyscall(void) __asm__("syscall.Entersyscall");
+void runtime_exitsyscall(void) __asm__("syscall.Exitsyscall");
void siginit(void);
bool __go_sigsend(int32 sig);
int32 runtime_callers(int32, uintptr*, int32);
@@ -374,7 +374,7 @@ void runtime_panic(Eface);
struct __go_func_type;
void reflect_call(const struct __go_func_type *, const void *, _Bool, _Bool,
void **, void **)
- asm ("libgo_reflect.reflect.call");
+ asm ("reflect.call");
/* Functions. */
#define runtime_panic __go_panic
@@ -417,11 +417,11 @@ void runtime_usleep(uint32);
* runtime c-called (but written in Go)
*/
void runtime_printany(Eface)
- __asm__("libgo_runtime.runtime.Printany");
+ __asm__("runtime.Printany");
void runtime_newTypeAssertionError(const String*, const String*, const String*, const String*, Eface*)
- __asm__("libgo_runtime.runtime.NewTypeAssertionError");
+ __asm__("runtime.NewTypeAssertionError");
void runtime_newErrorString(String, Eface*)
- __asm__("libgo_runtime.runtime.NewErrorString");
+ __asm__("runtime.NewErrorString");
/*
* wrapped for go users
@@ -431,8 +431,8 @@ void runtime_semrelease(uint32 volatile *);
int32 runtime_gomaxprocsfunc(int32 n);
void runtime_procyield(uint32);
void runtime_osyield(void);
-void runtime_LockOSThread(void) __asm__("libgo_runtime.runtime.LockOSThread");
-void runtime_UnlockOSThread(void) __asm__("libgo_runtime.runtime.UnlockOSThread");
+void runtime_LockOSThread(void) __asm__("runtime.LockOSThread");
+void runtime_UnlockOSThread(void) __asm__("runtime.UnlockOSThread");
uintptr runtime_memlimit(void);