When not bootstrapping, the newly built Go compiler is not passed down to the Go tools as GOC. This patch changes the gotools Makefile to use GOC_FOR_TARGET for a native build. I also set MOSTLYCLEANFILES. Bootstrapped on x86_64-unknown-linux-gnu. Committed to mainline.
Ian 2015-01-09 Ian Lance Taylor <i...@google.com> * Makefile.am (GOCOMPILER): Set to GOC or GOC_FOR_TARGET depending on whether this is a native build or not. (GOCOMPILE, GOLINK): Use $(GOCOMPILER) instead of $(GOC). (MOSTLYCLEANFILES): Define. * Makefile.in: Rebuild.
Index: Makefile.am =================================================================== --- Makefile.am (revision 219408) +++ Makefile.am (working copy) @@ -28,11 +28,18 @@ STAMP = echo timestamp > libgodir = ../$(target_noncanonical)/libgo LIBGODEP = $(libgodir)/libgo.la +if NATIVE +# Use the compiler we just built. +GOCOMPILER = $(GOC_FOR_TARGET) +else +GOCOMPILER = $(GOC) +endif + GOCFLAGS = $(CFLAGS_FOR_TARGET) -GOCOMPILE = $(GOC) $(GOCFLAGS) +GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS) AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs -static-libgo -GOLINK = $(GOC) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@ +GOLINK = $(GOCOMPILER) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@ cmdsrcdir = $(srcdir)/../libgo/go/cmd @@ -89,6 +96,8 @@ s-zdefaultcc: Makefile $(SHELL) $(srcdir)/../move-if-change zdefaultcc.go.tmp zdefaultcc.go $(STAMP) $@ +MOSTLYCLEANFILES = zdefaultcc.go s-zdefaultcc + if NATIVE # For a native build we build the programs using the newly built libgo