diff options
| author | Yuval Pavel Zholkover <paulzhol@gmail.com> | 2010-10-18 12:32:55 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2010-10-18 12:32:55 -0400 |
| commit | 99a10eff16b79cfb8ccf36e586532a40b17a203c (patch) | |
| tree | 30ce7d1c68d3725a0e948a3b3267c6c611f37ee3 /src/pkg/runtime/runtime.c | |
| parent | 6ac08ba6387129d9cf9aef924b252270c407d4c1 (diff) | |
| download | go-99a10eff16b79cfb8ccf36e586532a40b17a203c.tar.xz | |
8l, runtime: initial support for Plan 9
No multiple processes/locks, managed to compile
and run a hello.go (with print not fmt). Also test/sieve.go
seems to run until 439 and stops with a
'throw: all goroutines are asleep - deadlock!'
- just like runtime/tiny.
based on Russ's suggestions at:
http://groups.google.com/group/comp.os.plan9/browse_thread/thread/cfda8b82535d2d68/243777a597ec1612
Build instructions:
cd src/pkg/runtime
make clean && GOOS=plan9 make install
this will build and install the runtime.
When linking with 8l, you should pass -s to suppress symbol
generation in the a.out, otherwise the generated executable will not run.
This is runtime only, the porting of the toolchain has already
been done: http://code.google.com/p/go-plan9/source/browse
in the plan9-quanstro branch.
R=rsc
CC=golang-dev
https://golang.org/cl/2273041
Diffstat (limited to 'src/pkg/runtime/runtime.c')
| -rw-r--r-- | src/pkg/runtime/runtime.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c index 4b09f7bcf7..a8f8177331 100644 --- a/src/pkg/runtime/runtime.c +++ b/src/pkg/runtime/runtime.c @@ -147,15 +147,20 @@ args(int32 c, uint8 **v) argv = v; } +extern int32 isplan9; + void goargs(void) { String *gargv; String *genvv; int32 i, envc; - - for(envc=0; argv[argc+1+envc] != 0; envc++) - ; + + if(isplan9) + envc=0; + else + for(envc=0; argv[argc+1+envc] != 0; envc++) + ; gargv = malloc(argc*sizeof gargv[0]); genvv = malloc(envc*sizeof genvv[0]); |
