diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c index 2a0df3237e4..470095467d9 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 9b852d46eff..8d3e431eca7 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 similarity index 87% rename from src/runtime/amd64_darwin.h rename to src/runtime/darwin/amd64/defs.h index 28e58972b15..359b476a300 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 similarity index 100% rename from src/runtime/rt0_amd64_darwin.s rename to src/runtime/darwin/amd64/rt0.s diff --git a/src/runtime/rt1_amd64_darwin.c b/src/runtime/darwin/amd64/rt1.c similarity index 99% rename from src/runtime/rt1_amd64_darwin.c rename to src/runtime/darwin/amd64/rt1.c index c476f89b589..e9b5c20b2aa 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 similarity index 100% rename from src/runtime/sys_amd64_darwin.s rename to src/runtime/darwin/amd64/sys.s diff --git a/src/runtime/signals_darwin.h b/src/runtime/darwin/signals.h similarity index 100% rename from src/runtime/signals_darwin.h rename to src/runtime/darwin/signals.h diff --git a/src/runtime/amd64_linux.h b/src/runtime/linux/amd64/defs.h similarity index 88% rename from src/runtime/amd64_linux.h rename to src/runtime/linux/amd64/defs.h index 0bc8283f21b..e4c9ec08cac 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 similarity index 100% rename from src/runtime/rt0_amd64_linux.s rename to src/runtime/linux/amd64/rt0.s diff --git a/src/runtime/rt1_amd64_linux.c b/src/runtime/linux/amd64/rt1.c similarity index 100% rename from src/runtime/rt1_amd64_linux.c rename to src/runtime/linux/amd64/rt1.c diff --git a/src/runtime/sys_amd64_linux.s b/src/runtime/linux/amd64/sys.s similarity index 100% rename from src/runtime/sys_amd64_linux.s rename to src/runtime/linux/amd64/sys.s diff --git a/src/runtime/signals_linux.h b/src/runtime/linux/signals.h similarity index 100% rename from src/runtime/signals_linux.h rename to src/runtime/linux/signals.h