From: Shenghou Ma Date: Tue, 24 Jan 2012 20:03:41 +0000 (-0500) Subject: build: do not build all C compilers X-Git-Tag: weekly.2012-01-27~71 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0ae6084fefd3707766e98e20e775b2fb4c0c4dc7;p=gostls13.git build: do not build all C compilers In order to allow buildscript.sh to generate buildscripts for all $GOOS/$GOARCH combinations, we have to generate dummy files for cmd/go. Fixes #2586. R=rsc, golang-dev CC=golang-dev https://golang.org/cl/5557050 --- diff --git a/src/cmd/Makefile b/src/cmd/Makefile index c2f817a916..40d2778420 100644 --- a/src/cmd/Makefile +++ b/src/cmd/Makefile @@ -8,12 +8,9 @@ all: install # Only build tools for current architecture, and only tools written in C. # The tools written in Go are managed by ../pkg/Makefile. -# We need all the C compilers for rebuilding generated files in runtime. DIRS=\ $(O)a\ - 5c\ - 6c\ - 8c\ + $(O)c\ $(O)g\ $(O)l\ cc\ diff --git a/src/pkg/runtime/mkasmh.sh b/src/pkg/runtime/mkasmh.sh index ba48d0a137..26a1263bed 100755 --- a/src/pkg/runtime/mkasmh.sh +++ b/src/pkg/runtime/mkasmh.sh @@ -29,6 +29,10 @@ cat <<'EOF' // AUTO-GENERATED by autogen.sh; DO NOT EDIT EOF +if [ ! -x "${GOBIN:=$GOROOT/bin}/$CC" ]; then + echo "// dummy file for cmd/go to correctly generate buildscript" + exit +fi case "$GOARCH" in 386) @@ -110,7 +114,7 @@ arm) esac echo -$CC $CFLAGS -a proc.c | +$GOBIN/$CC $CFLAGS -a proc.c | awk ' { gsub(/\r/, ""); } /^aggr G$/ { aggr="g" } diff --git a/src/pkg/runtime/mkgodefs.sh b/src/pkg/runtime/mkgodefs.sh index 1f9feac4e1..b7cd229b78 100755 --- a/src/pkg/runtime/mkgodefs.sh +++ b/src/pkg/runtime/mkgodefs.sh @@ -27,7 +27,14 @@ cp signals_$GOOS.h signals_GOOS.h cat <