aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-01-22 16:58:33 -0800
committerRuss Cox <rsc@golang.org>2010-01-22 16:58:33 -0800
commitce7f345cd18f6cddcfa2a28434510e1dc8dadb96 (patch)
tree1b78d82515eab4cefe3ceae7eb9cb20acaa6eb8c /src
parentc634189d562cb1ef1496ddd8a8176ee0e88f8f80 (diff)
downloadgo-ce7f345cd18f6cddcfa2a28434510e1dc8dadb96.tar.xz
gc: do not build builtin.c automatically; use golden copy instead.
R=r CC=golang-dev https://golang.org/cl/190104
Diffstat (limited to 'src')
-rw-r--r--src/cmd/gc/Makefile5
-rwxr-xr-xsrc/cmd/gc/mkbuiltin21
-rw-r--r--src/cmd/gc/runtime.go4
-rw-r--r--src/cmd/gc/unsafe.go4
4 files changed, 17 insertions, 17 deletions
diff --git a/src/cmd/gc/Makefile b/src/cmd/gc/Makefile
index 40254c709c..99dbd51622 100644
--- a/src/cmd/gc/Makefile
+++ b/src/cmd/gc/Makefile
@@ -54,9 +54,8 @@ y.tab.h: $(YFILES)
y.tab.c: y.tab.h
test -f y.tab.c && touch y.tab.c
-builtin.c: runtime.go unsafe.go mkbuiltin1.c mkbuiltin
- ./mkbuiltin || \
- (echo 'mkbuiltin failed; using bootstrap copy of builtin.c'; cp builtin.c.boot builtin.c)
+builtin.c: builtin.c.boot
+ cp builtin.c.boot builtin.c
subr.$O: opnames.h
diff --git a/src/cmd/gc/mkbuiltin b/src/cmd/gc/mkbuiltin
index ea12b686f2..13309ec320 100755
--- a/src/cmd/gc/mkbuiltin
+++ b/src/cmd/gc/mkbuiltin
@@ -3,6 +3,11 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
+# Generate builtin.c and builtin.c.boot from $* (runtime.go and unsafe.go).
+# Run this after changing runtime.go and unsafe.go
+# or after changing the export metadata format in the compiler.
+# Either way, you need to have a working compiler binary first.
+
set -e
GOBIN="${GOBIN:-$HOME/bin}"
@@ -22,19 +27,7 @@ do
done
# If _builtin.c has changed vs builtin.c.boot,
-# check in the new change if being run by
-# one of the people who tends to work on
-# the compiler. This makes sure that changes
-# don't get forgotten, without causing problems
-# in end user Go repositories.
-case "$USER" in
-ken | r | rsc)
- if ! cmp _builtin.c builtin.c.boot >/dev/null 2>/dev/null
- then
- PATH=$PATH:/usr/local/bin # find p4 on OS X
- p4 open builtin.c.boot >/dev/null 2>/dev/null || true # if p4 is missing, so be it
- cp _builtin.c builtin.c.boot
- fi
-esac
+# check in the new change.
+cmp -s _builtin.c builtin.c.boot || cp _builtin.c builtin.c.boot
mv _builtin.c builtin.c
diff --git a/src/cmd/gc/runtime.go b/src/cmd/gc/runtime.go
index 2e21d25119..880b9c9d8d 100644
--- a/src/cmd/gc/runtime.go
+++ b/src/cmd/gc/runtime.go
@@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// NOTE: If you change this file you must run "./mkbuiltin"
+// to update builtin.c.boot. This is not done automatically
+// to avoid depending on having a working compiler binary.
+
package PACKAGE
// emitted by compiler, not referred to by go programs
diff --git a/src/cmd/gc/unsafe.go b/src/cmd/gc/unsafe.go
index 00fae062e5..bd7b7771a7 100644
--- a/src/cmd/gc/unsafe.go
+++ b/src/cmd/gc/unsafe.go
@@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// NOTE: If you change this file you must run "./mkbuiltin"
+// to update builtin.c.boot. This is not done automatically
+// to avoid depending on having a working compiler binary.
+
package PACKAGE
type Pointer *any