If the same directory was used for multiple builds,
it was possible for a stale version.go to contain the
wrong definitions for $GOOS and $GOARCH, because
they can change even if the hg version does not.
Split into multiple files to fix.
R=r, r2
CC=golang-dev
https://golang.org/cl/
4124050
softfloat64.go\
type.go\
version.go\
+ version_$(GOOS).go\
+ version_$(GOARCH).go\
runtime_defs.go\
+CLEANFILES+=version.go version_*.go
+
OFILES_windows=\
syscall.$O\
version.go: mkversion
./mkversion >version.go
+version_$(GOARCH).go:
+ (echo 'package runtime'; echo 'const theGoarch = "$(GOARCH)"') >$@
+
+version_$(GOOS).go:
+ (echo 'package runtime'; echo 'const theGoos = "$(GOOS)"') >$@
+
%.c: %.goc goc2c
./goc2c `pwd`/$< > $@.tmp
mv -f $@.tmp $@
"// generated by mkversion.c; do not edit.\n"
"package runtime\n"
"const defaultGoroot = \"%s\"\n"
- "const theVersion = \"%s\"\n"
- "const theGoarch = \"%s\"\n"
- "const theGoos = \"%s\"\n";
+ "const theVersion = \"%s\"\n";
void
main(void)
{
- print(template, getgoroot(), getgoversion(), getgoarch(), getgoos());
+ print(template, getgoroot(), getgoversion());
exits(0);
}