1
0
mirror of https://github.com/golang/go synced 2024-11-22 08:14:40 -07:00

gc: do not build builtin.c automatically; use golden copy instead.

R=r
CC=golang-dev
https://golang.org/cl/190104
This commit is contained in:
Russ Cox 2010-01-22 16:58:33 -08:00
parent c634189d56
commit ce7f345cd1
4 changed files with 17 additions and 17 deletions

View File

@ -54,9 +54,8 @@ y.tab.h: $(YFILES)
y.tab.c: y.tab.h y.tab.c: y.tab.h
test -f y.tab.c && touch y.tab.c test -f y.tab.c && touch y.tab.c
builtin.c: runtime.go unsafe.go mkbuiltin1.c mkbuiltin builtin.c: builtin.c.boot
./mkbuiltin || \ cp builtin.c.boot builtin.c
(echo 'mkbuiltin failed; using bootstrap copy of builtin.c'; cp builtin.c.boot builtin.c)
subr.$O: opnames.h subr.$O: opnames.h

View File

@ -3,6 +3,11 @@
# Use of this source code is governed by a BSD-style # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file. # 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 set -e
GOBIN="${GOBIN:-$HOME/bin}" GOBIN="${GOBIN:-$HOME/bin}"
@ -22,19 +27,7 @@ do
done done
# If _builtin.c has changed vs builtin.c.boot, # If _builtin.c has changed vs builtin.c.boot,
# check in the new change if being run by # check in the new change.
# one of the people who tends to work on cmp -s _builtin.c builtin.c.boot || cp _builtin.c builtin.c.boot
# 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
mv _builtin.c builtin.c mv _builtin.c builtin.c

View File

@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // 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 package PACKAGE
// emitted by compiler, not referred to by go programs // emitted by compiler, not referred to by go programs

View File

@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // 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 package PACKAGE
type Pointer *any type Pointer *any