summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-03-24 13:06:51 -0700
committerRuss Cox <rsc@golang.org>2009-03-24 13:06:51 -0700
commit088b4dbf96402e0b32d24ee7f4a530ab5da79040 (patch)
tree0c46f57d924a0c5c35277dd9b924662525a90e4a
parent57ba0222ea5643ab726e9d924b19c73c2bfd6f5f (diff)
downloadgolang-088b4dbf96402e0b32d24ee7f4a530ab5da79040.tar.gz
move darwin specific code into runtime/darwin/
move darwin-amd64 specific code into runtime/darwin/amd64/ repeat for linux. move rt0 into runtime.a instead of keeping a separate .6 file. 6l seems to have no problem with that. TBR=r OCL=26680 CL=26680
-rw-r--r--src/cmd/6l/obj.c6
-rw-r--r--src/runtime/Makefile36
-rw-r--r--src/runtime/darwin/amd64/defs.h (renamed from src/runtime/amd64_darwin.h)4
-rw-r--r--src/runtime/darwin/amd64/rt0.s (renamed from src/runtime/rt0_amd64_darwin.s)0
-rw-r--r--src/runtime/darwin/amd64/rt1.c (renamed from src/runtime/rt1_amd64_darwin.c)4
-rw-r--r--src/runtime/darwin/amd64/sys.s (renamed from src/runtime/sys_amd64_darwin.s)0
-rw-r--r--src/runtime/darwin/signals.h (renamed from src/runtime/signals_darwin.h)0
-rw-r--r--src/runtime/linux/amd64/defs.h (renamed from src/runtime/amd64_linux.h)4
-rw-r--r--src/runtime/linux/amd64/rt0.s (renamed from src/runtime/rt0_amd64_linux.s)0
-rw-r--r--src/runtime/linux/amd64/rt1.c (renamed from src/runtime/rt1_amd64_linux.c)0
-rw-r--r--src/runtime/linux/amd64/sys.s (renamed from src/runtime/sys_amd64_linux.s)0
-rw-r--r--src/runtime/linux/signals.h (renamed from src/runtime/signals_linux.h)0
12 files changed, 20 insertions, 34 deletions
diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c
index 2a0df3237..470095467 100644
--- a/src/cmd/6l/obj.c
+++ b/src/cmd/6l/obj.c
@@ -353,12 +353,6 @@ main(int argc, char *argv[])
}
lookup(INITENTRY, 0)->type = SXREF;
- if(!debug['l']) {
- a = mal(strlen(goroot)+strlen(goarch)+strlen(goos)+20);
- sprint(a, "%s/lib/rt0_%s_%s.%c", goroot, goarch, goos, thechar);
- objfile(a);
- }
-
while(*argv)
objfile(*argv++);
diff --git a/src/runtime/Makefile b/src/runtime/Makefile
index 9b852d46e..8d3e431ec 100644
--- a/src/runtime/Makefile
+++ b/src/runtime/Makefile
@@ -2,19 +2,14 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-CFLAGS=
+CFLAGS=-I$(GOOS) -I$(GOOS)/$(GOARCH) -wF
O=6
CC=$(O)c
AS=$(O)a
LIB=lib_$(GOARCH)_$(GOOS).a
-RT0OFILES=\
- rt0_$(GOARCH)_$(GOOS).$O\
-
-LIBOFILES=\
- rt1_$(GOARCH)_$(GOOS).$O\
- sys_$(GOARCH)_$(GOOS).$O\
+OFILES=\
array.$O\
asm.$O\
chan.$O\
@@ -36,25 +31,24 @@ LIBOFILES=\
proc.$O\
rune.$O\
runtime.$O\
+ rt0.$O\
+ rt1.$O\
sema.$O\
sema_go.$O\
string.$O\
symtab.$O\
+ sys.$O\
traceback.$O\
-OFILES=$(RT0OFILES) $(LIBOFILES)
OS_H=$(GOARCH)_$(GOOS).h
HFILES=runtime.h hashmap.h malloc.h $(OS_H_)
-install: rt0 $(LIB) runtime.acid
- cp $(RT0OFILES) $(GOROOT)/lib
+install: $(LIB) runtime.acid
cp $(LIB) $(GOROOT)/lib
cp runtime.acid $(GOROOT)/acid/runtime.acid
-rt0: $(RT0OFILES)
-
-$(LIB): $(LIBOFILES)
- $(O)ar rc $(LIB) $(LIBOFILES)
+$(LIB): $(OFILES)
+ $(O)ar rc $(LIB) $(OFILES)
$(OFILES): $(HFILES)
@@ -65,17 +59,23 @@ clean:
rm -f *.$(O) *.a runtime.acid cgo2c
%.$O: %.c
- $(CC) $(CFLAGS) -wF $<
+ $(CC) $(CFLAGS) $<
%.$O: $(GOARCH)/%.c
- $(CC) $(CFLAGS) -wF $<
+ $(CC) $(CFLAGS) $<
-%.$O: %.s
- $(AS) $<
+%.$O: $(GOOS)/%.c
+ $(CC) $(CFLAGS) $<
+
+%.$O: $(GOOS)/$(GOARCH)/%.c
+ $(CC) $(CFLAGS) $<
%.$O: $(GOARCH)/%.s
$(AS) $<
+%.$O: $(GOOS)/$(GOARCH)/%.s
+ $(AS) $<
+
cgo2c: cgo2c.c
quietgcc -o $@ $<
diff --git a/src/runtime/amd64_darwin.h b/src/runtime/darwin/amd64/defs.h
index 28e58972b..359b476a3 100644
--- a/src/runtime/amd64_darwin.h
+++ b/src/runtime/darwin/amd64/defs.h
@@ -1,7 +1,3 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
/*
* System structs for Darwin, amd64
*/
diff --git a/src/runtime/rt0_amd64_darwin.s b/src/runtime/darwin/amd64/rt0.s
index 0a0011781..0a0011781 100644
--- a/src/runtime/rt0_amd64_darwin.s
+++ b/src/runtime/darwin/amd64/rt0.s
diff --git a/src/runtime/rt1_amd64_darwin.c b/src/runtime/darwin/amd64/rt1.c
index c476f89b5..e9b5c20b2 100644
--- a/src/runtime/rt1_amd64_darwin.c
+++ b/src/runtime/darwin/amd64/rt1.c
@@ -3,8 +3,8 @@
// license that can be found in the LICENSE file.
#include "runtime.h"
-#include "amd64_darwin.h"
-#include "signals_darwin.h"
+#include "defs.h"
+#include "signals.h"
typedef uint64 __uint64_t;
diff --git a/src/runtime/sys_amd64_darwin.s b/src/runtime/darwin/amd64/sys.s
index e16983346..e16983346 100644
--- a/src/runtime/sys_amd64_darwin.s
+++ b/src/runtime/darwin/amd64/sys.s
diff --git a/src/runtime/signals_darwin.h b/src/runtime/darwin/signals.h
index c4d586049..c4d586049 100644
--- a/src/runtime/signals_darwin.h
+++ b/src/runtime/darwin/signals.h
diff --git a/src/runtime/amd64_linux.h b/src/runtime/linux/amd64/defs.h
index 0bc8283f2..e4c9ec08c 100644
--- a/src/runtime/amd64_linux.h
+++ b/src/runtime/linux/amd64/defs.h
@@ -1,7 +1,3 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
/*
* System structs for Linux, amd64
*/
diff --git a/src/runtime/rt0_amd64_linux.s b/src/runtime/linux/amd64/rt0.s
index 55be5bcee..55be5bcee 100644
--- a/src/runtime/rt0_amd64_linux.s
+++ b/src/runtime/linux/amd64/rt0.s
diff --git a/src/runtime/rt1_amd64_linux.c b/src/runtime/linux/amd64/rt1.c
index 5b3e45809..5b3e45809 100644
--- a/src/runtime/rt1_amd64_linux.c
+++ b/src/runtime/linux/amd64/rt1.c
diff --git a/src/runtime/sys_amd64_linux.s b/src/runtime/linux/amd64/sys.s
index 49349bb48..49349bb48 100644
--- a/src/runtime/sys_amd64_linux.s
+++ b/src/runtime/linux/amd64/sys.s
diff --git a/src/runtime/signals_linux.h b/src/runtime/linux/signals.h
index 9e770e92f..9e770e92f 100644
--- a/src/runtime/signals_linux.h
+++ b/src/runtime/linux/signals.h