From b7f0580274cf90e5c7488e0aa17600b5fdb4eb9d Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sat, 6 Jun 2009 22:04:50 -0700 Subject: [PATCH] move src/runtime -> src/lib/runtime; hand-edited files. R=r DELTA=125 (77 added, 16 deleted, 32 changed) OCL=30001 CL=30008 --- src/clean.bash | 2 +- src/cmd/5l/obj.c | 4 +- src/cmd/6l/obj.c | 2 +- src/cmd/8l/obj.c | 2 +- src/lib/reflect/typestring.c | 5 +- src/lib/runtime/Makefile | 142 +++++++++++++++++++++++++---------- src/make.bash | 2 +- 7 files changed, 110 insertions(+), 49 deletions(-) diff --git a/src/clean.bash b/src/clean.bash index c4c74dde7a..15a46a76a1 100755 --- a/src/clean.bash +++ b/src/clean.bash @@ -5,7 +5,7 @@ rm -rf $GOROOT/pkg/[0-9a-zA-Z_]* rm -f $GOROOT/lib/*.[6a] -for i in lib9 libbio libmach_amd64 libregexp cmd runtime lib +for i in lib9 libbio libmach_amd64 libregexp cmd lib do cd $i case $i in diff --git a/src/cmd/5l/obj.c b/src/cmd/5l/obj.c index d939ea9777..30f60e07dd 100644 --- a/src/cmd/5l/obj.c +++ b/src/cmd/5l/obj.c @@ -275,7 +275,7 @@ main(int argc, char *argv[]) if(!debug['l']) { loadlib(); a = mal(strlen(goroot)+strlen(goarch)+strlen(goos)+20); - sprint(a, "%s/lib/lib_%s_%s.a", goroot, goarch, goos); + sprint(a, "%s/pkg/%s_%s/runtime.a", goroot, goos, goarch); objfile(a); } firstp = firstp->link; @@ -955,7 +955,7 @@ loop: p->link = datap; datap = p; break; - + case ADATA: if(p->from.sym == S) { diag("DATA without a sym\n%P", p); diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c index 23e794c2af..a149ed07fd 100644 --- a/src/cmd/6l/obj.c +++ b/src/cmd/6l/obj.c @@ -359,7 +359,7 @@ main(int argc, char *argv[]) if(!debug['l']) { loadlib(); a = mal(strlen(goroot)+strlen(goarch)+strlen(goos)+20); - sprint(a, "%s/lib/lib_%s_%s.a", goroot, goarch, goos); + sprint(a, "%s/pkg/%s_%s/runtime.a", goroot, goos, goarch); objfile(a); } definetypestrings(); diff --git a/src/cmd/8l/obj.c b/src/cmd/8l/obj.c index fdcf45c882..c3d4b9f659 100644 --- a/src/cmd/8l/obj.c +++ b/src/cmd/8l/obj.c @@ -329,7 +329,7 @@ main(int argc, char *argv[]) if(!debug['l']) { loadlib(); a = mal(strlen(goroot)+strlen(goarch)+strlen(goos)+20); - sprint(a, "%s/lib/lib_%s_%s.a", goroot, goarch, goos); + sprint(a, "%s/pkg/%s_%s/runtime.a", goroot, goos, goarch); objfile(a); } definetypestrings(); diff --git a/src/lib/reflect/typestring.c b/src/lib/reflect/typestring.c index af3f366a9b..667037bb14 100644 --- a/src/lib/reflect/typestring.c +++ b/src/lib/reflect/typestring.c @@ -5,10 +5,7 @@ extern char gotypestrings[]; // 4-byte count followed by byte[count] -void -FLUSH(void*) -{ -} +void FLUSH(void*); typedef struct String String; struct String diff --git a/src/lib/runtime/Makefile b/src/lib/runtime/Makefile index 21bf4a8a88..d4652a34f2 100644 --- a/src/lib/runtime/Makefile +++ b/src/lib/runtime/Makefile @@ -2,59 +2,123 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -# DO NOT EDIT. Automatically generated by gobuild. -# gobuild -m >Makefile +# Set SIZE to 32 or 64. +SIZE_386=32 +SIZE_amd64=64 +SIZE_arm=32 +SIZE=$(SIZE_$(GOARCH)) -D= +# Setup CFLAGS. Add -D_64BIT on 64-bit platforms (sorry). +CFLAGS_64=-D_64BIT +CFLAGS=-I$(GOOS) -I$(GOOS)/$(GOARCH) -wF $(CFLAGS_$(SIZE)) -include $(GOROOT)/src/Make.$(GOARCH) -AR=gopack +# Set O to right letter. +O_386=8 +O_amd64=6 +O_arm=5 +O=$(O_$(GOARCH)) -default: packages +# Tools +CC=$(O)c +GC=$(O)g +AS=$(O)a +AR=6ar # sic + +LIB=runtime.a + +# 386-specific object files +OFILES_386=\ + vlop.$O\ + vlrt.$O\ + +OFILES=\ + array.$O\ + asm.$O\ + chan.$O\ + closure.$O\ + extern.$O\ + float.$O\ + float_go.$O\ + hashmap.$O\ + iface.$O\ + malloc.$O\ + malloc_go.$O\ + mcache.$O\ + mcentral.$O\ + mem.$O\ + mfixalloc.$O\ + mgc0.$O\ + mheap.$O\ + mheapmap$(SIZE).$O\ + msize.$O\ + print.$O\ + proc.$O\ + rune.$O\ + runtime.$O\ + rt0.$O\ + sema.$O\ + sema_go.$O\ + signal.$O\ + string.$O\ + symtab.$O\ + sys.$O\ + thread.$O\ + traceback.$O\ + $(OFILES_$(GOARCH))\ + +HFILES=\ + runtime.h\ + hashmap.h\ + malloc.h\ + $(GOOS)/os.h\ + $(GOOS)/$(GOARCH)/defs.h\ + +install: $(LIB) runtime.acid + cp $(LIB) $(GOROOT)/pkg/$(GOOS)_$(GOARCH)/$(LIB) + cp runtime.acid $(GOROOT)/acid/runtime.acid + +$(LIB): $(OFILES) + $(AR) grc $(LIB) $(OFILES) + +$(OFILES): $(HFILES) + +nuke: + rm -f *.[568] *.a $(GOROOT)/lib/$(LIB) clean: - rm -rf *.[$(OS)] *.a [$(OS)].out _obj + rm -f *.[568] *.a runtime.acid cgo2c -test: packages - gotest +%.$O: %.go + $(GC) $< -coverage: packages - gotest - 6cov -g `pwd` | grep -v '_test\.go:' +%.$O: %.c + $(CC) $(CFLAGS) $< -%.$O: %.go - $(GC) -I_obj $*.go +%.$O: $(GOARCH)/%.c + $(CC) $(CFLAGS) $< -%.$O: %.c - $(CC) $*.c +%.$O: $(GOOS)/%.c + $(CC) $(CFLAGS) $< -%.$O: %.s - $(AS) $*.s +%.$O: $(GOOS)/$(GOARCH)/%.c + $(CC) $(CFLAGS) $< -O1=\ - runtime.$O\ +%.$O: $(GOARCH)/%.s + $(AS) $< +%.$O: $(GOOS)/$(GOARCH)/%.s + $(AS) $< -phases: a1 -_obj$D/runtime.a: phases +cgo2c: cgo2c.c + quietgcc -o $@ $< -a1: $(O1) - $(AR) grc _obj$D/runtime.a runtime.$O - rm -f $(O1) +%.c: %.cgo cgo2c + ./cgo2c $< > $@.tmp + mv -f $@.tmp $@ +runtime.acid: runtime.h proc.c + $(CC) -a proc.c >runtime.acid -newpkg: clean - mkdir -p _obj$D - $(AR) grc _obj$D/runtime.a +chan.acid: runtime.h chan.c + $(CC) -a chan.c >chan.acid -$(O1): newpkg -$(O2): a1 - -nuke: clean - rm -f $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/runtime.a - -packages: _obj$D/runtime.a - -install: packages - test -d $(GOROOT)/pkg && mkdir -p $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D - cp _obj$D/runtime.a $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/runtime.a diff --git a/src/make.bash b/src/make.bash index 5c5e36eff0..f6ee91ad07 100755 --- a/src/make.bash +++ b/src/make.bash @@ -18,7 +18,7 @@ rm -f $HOME/bin/quietgcc cp quietgcc.bash $HOME/bin/quietgcc chmod +x $HOME/bin/quietgcc -for i in lib9 libbio libmach_amd64 libregexp cmd runtime lib cmd/gobuild +for i in lib9 libbio libmach_amd64 libregexp cmd lib cmd/gobuild do echo; echo; echo %%%% making $i %%%%; echo cd $i