Commit d06a79e3 authored by Russ Cox's avatar Russ Cox

no need for compiler to hard-code definition of runtime.

use the actual go source instead.

R=r
DELTA=90  (66 added, 18 deleted, 6 changed)
OCL=28708
CL=28719
parent c7d30bce
...@@ -44,7 +44,7 @@ y.tab.h: $(YFILES) ...@@ -44,7 +44,7 @@ y.tab.h: $(YFILES)
y.tab.c: y.tab.h y.tab.c: y.tab.h
test -f y.tab.c && touch y.tab.c test -f y.tab.c && touch y.tab.c
builtin.c: sys.go unsafe.go runtime.go mkbuiltin1.c mkbuiltin builtin.c: sys.go unsafe.go mkbuiltin1.c mkbuiltin
./mkbuiltin >builtin.c || \ ./mkbuiltin >builtin.c || \
(echo 'mkbuiltin failed; using bootstrap copy of builtin.c'; cp builtin.c.boot builtin.c) (echo 'mkbuiltin failed; using bootstrap copy of builtin.c'; cp builtin.c.boot builtin.c)
......
...@@ -67,11 +67,3 @@ char *unsafeimport = ...@@ -67,11 +67,3 @@ char *unsafeimport =
"func unsafe.Unreflect (? uint64, ? string, ? bool) (ret interface { })\n" "func unsafe.Unreflect (? uint64, ? string, ? bool) (ret interface { })\n"
"\n" "\n"
"$$\n"; "$$\n";
char *runtimeimport =
"package runtime\n"
"func runtime.Breakpoint ()\n"
"func runtime.Gosched ()\n"
"func runtime.Goexit ()\n"
"func runtime.Caller (n int) (pc uint64, file string, line int, ok bool)\n"
"\n"
"$$\n";
...@@ -540,7 +540,6 @@ EXTERN Sym* pkgimportname; // package name from imported package ...@@ -540,7 +540,6 @@ EXTERN Sym* pkgimportname; // package name from imported package
EXTERN int tptr; // either TPTR32 or TPTR64 EXTERN int tptr; // either TPTR32 or TPTR64
extern char* sysimport; extern char* sysimport;
extern char* unsafeimport; extern char* unsafeimport;
extern char* runtimeimport;
EXTERN char* filename; // name to uniqify names EXTERN char* filename; // name to uniqify names
EXTERN Idir* idirs; EXTERN Idir* idirs;
......
...@@ -265,10 +265,6 @@ importfile(Val *f) ...@@ -265,10 +265,6 @@ importfile(Val *f)
cannedimports("unsafe.6", unsafeimport); cannedimports("unsafe.6", unsafeimport);
return; return;
} }
if(strcmp(f->u.sval->s, "runtime") == 0) {
cannedimports("runtime.6", runtimeimport);
return;
}
if(!findpkg(f->u.sval)) if(!findpkg(f->u.sval))
fatal("can't find import: %Z", f->u.sval); fatal("can't find import: %Z", f->u.sval);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
set -e set -e
gcc -o mkbuiltin1 mkbuiltin1.c gcc -o mkbuiltin1 mkbuiltin1.c
rm -f _builtin.c rm -f _builtin.c
for i in sys unsafe runtime for i in sys unsafe
do do
6g $i.go 6g $i.go
./mkbuiltin1 $i >>_builtin.c ./mkbuiltin1 $i >>_builtin.c
......
// 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.
package PACKAGE
func Breakpoint();
func Gosched();
func Goexit();
func Caller(n int) (pc uint64, file string, line int, ok bool);
...@@ -116,11 +116,11 @@ bufio.install: io.install os.install ...@@ -116,11 +116,11 @@ bufio.install: io.install os.install
exec.install: os.install strings.install exec.install: os.install strings.install
exvar.install: fmt.install http.install log.install strconv.install sync.install exvar.install: fmt.install http.install log.install strconv.install sync.install
flag.install: fmt.install os.install strconv.install flag.install: fmt.install os.install strconv.install
log.install: fmt.install io.install os.install time.install log.install: fmt.install io.install os.install runtime.install time.install
path.install: io.install path.install: io.install
once.install: sync.install once.install: sync.install
strings.install: utf8.install strings.install: utf8.install
testing.install: flag.install fmt.install testing.install: flag.install fmt.install runtime.install
fmt.install: io.install reflect.install strconv.install fmt.install: io.install reflect.install strconv.install
GODEPS=fmt.install io.install once.install regexp.install sort.install \ GODEPS=fmt.install io.install once.install regexp.install sort.install \
...@@ -142,13 +142,13 @@ json.install: container/vector.install fmt.install io.install math.install \ ...@@ -142,13 +142,13 @@ json.install: container/vector.install fmt.install io.install math.install \
# TODO(rsc): net is not supposed to depend on fmt or strings or strconv # TODO(rsc): net is not supposed to depend on fmt or strings or strconv
net.install: fmt.install once.install os.install strconv.install strings.install net.install: fmt.install once.install os.install strconv.install strings.install
os.install: syscall.install once.install os.install: syscall.install once.install
regexp.install: os.install regexp.install: os.install runtime.install
reflect.install: strconv.install sync.install reflect.install: strconv.install sync.install
strconv.install: math.install os.install utf8.install strconv.install: math.install os.install utf8.install
sync.install: sync.install:
syscall.install: sync.install syscall.install: sync.install
tabwriter.install: os.install io.install container/vector.install tabwriter.install: os.install io.install container/vector.install
template.install: container/vector.install fmt.install io.install os.install reflect.install strings.install template.install: container/vector.install fmt.install io.install os.install reflect.install runtime.install strings.install
time.install: once.install os.install io.install time.install: once.install os.install io.install
once.install os.install sort.install strings.install sync.install template.install time.install \ once.install os.install sort.install strings.install sync.install template.install time.install \
# 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.
# DO NOT EDIT. Automatically generated by gobuild.
# gobuild -m >Makefile
D=
O_arm=5
O_amd64=6
O_386=8
OS=568vq
O=$(O_$(GOARCH))
GC=$(O)g -I_obj
CC=$(O)c -FVw
AS=$(O)a
AR=6ar
default: packages
clean:
rm -rf *.[$(OS)] *.a [$(OS)].out _obj
test: packages
gotest
coverage: packages
gotest
6cov -g `pwd` | grep -v '_test\.go:'
%.$O: %.go
$(GC) $*.go
%.$O: %.c
$(CC) $*.c
%.$O: %.s
$(AS) $*.s
O1=\
runtime.$O\
phases: a1
_obj$D/runtime.a: phases
a1: $(O1)
$(AR) grc _obj$D/runtime.a runtime.$O
rm -f $(O1)
newpkg: clean
mkdir -p _obj$D
$(AR) grc _obj$D/runtime.a
$(O1): newpkg
$(O2): a1
nuke: clean
rm -f $(GOROOT)/pkg$D/runtime.a
packages: _obj$D/runtime.a
install: packages
test -d $(GOROOT)/pkg && mkdir -p $(GOROOT)/pkg$D
cp _obj$D/runtime.a $(GOROOT)/pkg$D/runtime.a
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
*/ */
package runtime package runtime
// These functions are implemented in the base runtime library, ../../runtime/.
// Gosched yields the processor, allowing other goroutines to run. It does not // Gosched yields the processor, allowing other goroutines to run. It does not
// suspend the current goroutine, so execution resumes automatically. // suspend the current goroutine, so execution resumes automatically.
func Gosched() func Gosched()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment