PR 66147 points out that it doesn't work to build the gotools with a cross-compiler. This patch improves matters. I added a new host export to the top level Makefile. Build maintainers, does this change seem OK?
Ian ./ChangeLog: 2015-11-25 Ian Lance Taylor <i...@google.com> PR go/66147 * Makefile.tpl (HOST_EXPORTS): Add XGCC_FLAGS_FOR_TARGET. * Makefile.in: Regenerate. gotools/ChangeLog: 2015-11-25 Ian Lance Taylor <i...@google.com> PR go/66147 * Makefile.am (GOCOMPILER): In NATIVE case, add $(XGCC_FLAGS_FOR_TARGET).
Index: Makefile.tpl =================================================================== --- Makefile.tpl (revision 230759) +++ Makefile.tpl (working copy) @@ -227,6 +227,7 @@ HOST_EXPORTS = \ ISLINC="$(HOST_ISLINC)"; export ISLINC; \ LIBELFLIBS="$(HOST_LIBELFLIBS)"; export LIBELFLIBS; \ LIBELFINC="$(HOST_LIBELFINC)"; export LIBELFINC; \ + XGCC_FLAGS_FOR_TARGET="$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_FLAGS_FOR_TARGET; \ @if gcc-bootstrap $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ @endif gcc-bootstrap Index: gotools/Makefile.am =================================================================== --- gotools/Makefile.am (revision 230759) +++ gotools/Makefile.am (working copy) @@ -30,7 +30,7 @@ LIBGODEP = $(libgodir)/libgo.la if NATIVE # Use the compiler we just built. -GOCOMPILER = $(GOC_FOR_TARGET) +GOCOMPILER = $(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) else GOCOMPILER = $(GOC) endif