vadd(&link, bpathf(&b, "%s/%s", tooldir, name));
} else {
vcopy(&link, gccargs.p, gccargs.len);
+ if(sflag)
+ vadd(&link, "-static");
vadd(&link, "-o");
targ = link.len;
vadd(&link, bpathf(&b, "%s/%s%s", tooldir, name, exe));
case 'a':
rebuildall = 1;
break;
+ case 's':
+ sflag++;
+ break;
case 'v':
vflag++;
break;
int i;
ARGBEGIN{
+ case 's':
+ sflag++;
+ break;
case 'v':
vflag++;
break;
#
# CC: Command line to run to get at host C compiler.
# Default is "gcc". Also supported: "clang".
+# CXX: Command line to run to get at host C++ compiler, only recorded
+# for cgo use. Default is "g++". Also supported: "clang++".
+#
+# GO_DISTFLAGS: extra flags to provide to "dist bootstrap". Use "-s"
+# to build a statically linked toolchain.
set -e
if [ ! -f run.bash ]; then
if [ "$1" = "--no-clean" ]; then
buildall=""
fi
-./cmd/dist/dist bootstrap $buildall -v # builds go_bootstrap
+./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
# Delay move of dist tool to now, because bootstrap may clear tool directory.
mv cmd/dist/dist "$GOTOOLDIR"/dist
"$GOTOOLDIR"/go_bootstrap clean -i std