From: David du Colombier <0intro@gmail.com> Date: Tue, 13 Jan 2015 07:01:18 +0000 (+0100) Subject: build: bootstrap on Plan 9 X-Git-Tag: go1.5beta1~2327^2~3 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b46b9429f05362b2b2227861811e50b47b9ec928;p=gostls13.git build: bootstrap on Plan 9 This change implements the requirement of old Go to build new Go on Plan 9. Also fix the build of the new cmd/dist written in Go. This is similar to the make.bash change in CL 2470, but applied to make.rc for Plan 9. Change-Id: Ifd9a3bd8658e2cee6f92b4c7f29ce86ee2a93c53 Reviewed-on: https://go-review.googlesource.com/2662 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/cmd/dist/sys_default.go b/src/cmd/dist/sys_default.go index ab97f19b3d..d7bc464f2a 100644 --- a/src/cmd/dist/sys_default.go +++ b/src/cmd/dist/sys_default.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !windows,!plan9 +// +build !windows package main diff --git a/src/make.rc b/src/make.rc index 7a62d6af00..2d2076297e 100755 --- a/src/make.rc +++ b/src/make.rc @@ -3,6 +3,8 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. +# See golang.org/s/go15bootstrap for an overview of the build process. + # Environment variables that control make.rc: # # GOROOT_FINAL: The expected final Go root, baked into binaries. @@ -45,17 +47,18 @@ rm -f ./runtime/runtime_defs.go # Determine the host compiler toolchain. eval `{grep '^(CC|LD|O)=' /$objtype/mkfile} -echo '# Building C bootstrap tool.' +echo '# Building Go bootstrap tool.' echo cmd/dist GOROOT = `{cd .. && pwd} -if(! ~ $#GOROOT_FINAL 1) - GOROOT_FINAL = $GOROOT -DEFGOROOT='-DGOROOT_FINAL="'$GOROOT_FINAL'"' - -for(i in cmd/dist/*.c) - $CC -FTVwp+ -DPLAN9 $DEFGOROOT $i -$LD -o cmd/dist/dist *.$O -rm *.$O +if(! ~ $#GOROOT_BOOTSTRAP 1) + GOROOT_BOOTSTRAP = $home/go1.4 +if(! test -x $GOROOT_BOOTSTRAP/bin/go){ + echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go.' >[1=2] + echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2] + exit bootstrap +} +rm -f cmd/dist/dist +GOROOT=$GOROOT_BOOTSTRAP $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist eval `{./cmd/dist/dist env -9} echo