Commit 0ae6084f authored by Shenghou Ma's avatar Shenghou Ma Committed by Russ Cox

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
parent 37d2f819
...@@ -8,12 +8,9 @@ all: install ...@@ -8,12 +8,9 @@ all: install
# Only build tools for current architecture, and only tools written in C. # Only build tools for current architecture, and only tools written in C.
# The tools written in Go are managed by ../pkg/Makefile. # The tools written in Go are managed by ../pkg/Makefile.
# We need all the C compilers for rebuilding generated files in runtime.
DIRS=\ DIRS=\
$(O)a\ $(O)a\
5c\ $(O)c\
6c\
8c\
$(O)g\ $(O)g\
$(O)l\ $(O)l\
cc\ cc\
......
...@@ -29,6 +29,10 @@ cat <<'EOF' ...@@ -29,6 +29,10 @@ cat <<'EOF'
// AUTO-GENERATED by autogen.sh; DO NOT EDIT // AUTO-GENERATED by autogen.sh; DO NOT EDIT
EOF EOF
if [ ! -x "${GOBIN:=$GOROOT/bin}/$CC" ]; then
echo "// dummy file for cmd/go to correctly generate buildscript"
exit
fi
case "$GOARCH" in case "$GOARCH" in
386) 386)
...@@ -110,7 +114,7 @@ arm) ...@@ -110,7 +114,7 @@ arm)
esac esac
echo echo
$CC $CFLAGS -a proc.c | $GOBIN/$CC $CFLAGS -a proc.c |
awk ' awk '
{ gsub(/\r/, ""); } { gsub(/\r/, ""); }
/^aggr G$/ { aggr="g" } /^aggr G$/ { aggr="g" }
......
...@@ -27,7 +27,14 @@ cp signals_$GOOS.h signals_GOOS.h ...@@ -27,7 +27,14 @@ cp signals_$GOOS.h signals_GOOS.h
cat <<EOF cat <<EOF
// Go definitions for C variables and types. // Go definitions for C variables and types.
// AUTO-GENERATED by autogen.sh; DO NOT EDIT // 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"
echo "package runtime"
exit
fi
cat <<EOF
package runtime package runtime
import "unsafe" import "unsafe"
var _ unsafe.Pointer var _ unsafe.Pointer
...@@ -35,7 +42,7 @@ var _ unsafe.Pointer ...@@ -35,7 +42,7 @@ var _ unsafe.Pointer
EOF EOF
for i in "$@"; do for i in "$@"; do
$CC $CFLAGS -q $i $GOBIN/$CC $CFLAGS -q $i
done | awk ' done | awk '
/^func/ { next } /^func/ { next }
/^const/ { next } /^const/ { next }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment