]> Cypherpunks repositories - gostls13.git/commitdiff
move darwin specific code into runtime/darwin/
authorRuss Cox <rsc@golang.org>
Tue, 24 Mar 2009 20:06:51 +0000 (13:06 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 24 Mar 2009 20:06:51 +0000 (13:06 -0700)
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

12 files changed:
src/cmd/6l/obj.c
src/runtime/Makefile
src/runtime/darwin/amd64/defs.h [moved from src/runtime/amd64_darwin.h with 87% similarity]
src/runtime/darwin/amd64/rt0.s [moved from src/runtime/rt0_amd64_darwin.s with 100% similarity]
src/runtime/darwin/amd64/rt1.c [moved from src/runtime/rt1_amd64_darwin.c with 99% similarity]
src/runtime/darwin/amd64/sys.s [moved from src/runtime/sys_amd64_darwin.s with 100% similarity]
src/runtime/darwin/signals.h [moved from src/runtime/signals_darwin.h with 100% similarity]
src/runtime/linux/amd64/defs.h [moved from src/runtime/amd64_linux.h with 88% similarity]
src/runtime/linux/amd64/rt0.s [moved from src/runtime/rt0_amd64_linux.s with 100% similarity]
src/runtime/linux/amd64/rt1.c [moved from src/runtime/rt1_amd64_linux.c with 100% similarity]
src/runtime/linux/amd64/sys.s [moved from src/runtime/sys_amd64_linux.s with 100% similarity]
src/runtime/linux/signals.h [moved from src/runtime/signals_linux.h with 100% similarity]

index 2a0df3237e4aaa5237693a707eadf5512ec22a43..470095467d9a518c3f9f5c44898a57441392b8ec 100644 (file)
@@ -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++);
 
index 9b852d46eff6072c109a36074b117dd8c0c28271..8d3e431eca72806ceb76d9126e483f6790e2b726 100644 (file)
@@ -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 $@ $<
 
similarity index 87%
rename from src/runtime/amd64_darwin.h
rename to src/runtime/darwin/amd64/defs.h
index 28e58972b15ac178f2d2cba7e8b78590e433e312..359b476a3004595fefe91aa5c951c6cd3f53b752 100644 (file)
@@ -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
  */
similarity index 99%
rename from src/runtime/rt1_amd64_darwin.c
rename to src/runtime/darwin/amd64/rt1.c
index c476f89b5895c564e1df26cf78b0d1feaf4ae4db..e9b5c20b2aa504f9f54360616e3663f283f5cdcf 100644 (file)
@@ -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;
 
similarity index 88%
rename from src/runtime/amd64_linux.h
rename to src/runtime/linux/amd64/defs.h
index 0bc8283f21be4d253a65c1c8bfd21409b0caef51..e4c9ec08cac68024c96af569d201932c9ba97dad 100644 (file)
@@ -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
  */