]> Cypherpunks repositories - gostls13.git/commitdiff
gc: do not build builtin.c automatically; use golden copy instead.
authorRuss Cox <rsc@golang.org>
Sat, 23 Jan 2010 00:58:33 +0000 (16:58 -0800)
committerRuss Cox <rsc@golang.org>
Sat, 23 Jan 2010 00:58:33 +0000 (16:58 -0800)
R=r
CC=golang-dev
https://golang.org/cl/190104

src/cmd/gc/Makefile
src/cmd/gc/mkbuiltin
src/cmd/gc/runtime.go
src/cmd/gc/unsafe.go

index 40254c709c9d1ca35ae7f2a034eff99a51ef93a9..99dbd51622f6569cd5ad68d82a9dfea916031107 100644 (file)
@@ -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
 
index ea12b686f29cfe358f12ff36cf8d03f922095153..13309ec320f87c452094fcc903e5d35ff341338b 100755 (executable)
@@ -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
index 2e21d25119602d692990b0096d322780ded2a80e..880b9c9d8d1197ea9e1ee4b21738b07dd5b7e6f0 100644 (file)
@@ -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
index 00fae062e5008c141980314fb4d1d56a9b9030eb..bd7b7771a7938ddb35345a6e014bc894d6e8ee7b 100644 (file)
@@ -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