aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-12-16 18:50:40 -0500
committerRuss Cox <rsc@golang.org>2011-12-16 18:50:40 -0500
commit86dcc431e9282013eb8ce6cce22c882f37a05147 (patch)
tree4d25909755a55f2cfbe8b12624d15e2e08dcf7f8 /src/pkg/runtime
parent541b67d051fbd26f3727d4d13c6d2b025af8a775 (diff)
downloadgo-86dcc431e9282013eb8ce6cce22c882f37a05147.tar.xz
runtime: hg revert -r 6ec0a5c12d75
That was the last build that was close to working. I will try that change again next week. Make is being very subtle today. At the reverted-to CL, the ARM traceback appears to be broken. I'll look into that next week too. R=golang-dev, r CC=golang-dev https://golang.org/cl/5492063
Diffstat (limited to 'src/pkg/runtime')
-rw-r--r--src/pkg/runtime/Makefile83
-rw-r--r--src/pkg/runtime/Makefile.auto101
-rw-r--r--src/pkg/runtime/asm_386.s2
-rw-r--r--src/pkg/runtime/asm_amd64.s2
-rw-r--r--src/pkg/runtime/asm_arm.s2
-rw-r--r--src/pkg/runtime/defs1_linux.go2
-rw-r--r--src/pkg/runtime/defs2_linux.go2
-rw-r--r--src/pkg/runtime/defs_arm_linux.go2
-rw-r--r--src/pkg/runtime/defs_darwin.go2
-rw-r--r--src/pkg/runtime/defs_freebsd.go2
-rw-r--r--src/pkg/runtime/defs_linux.go2
-rw-r--r--src/pkg/runtime/defs_netbsd.go2
-rw-r--r--src/pkg/runtime/defs_openbsd.go2
-rw-r--r--src/pkg/runtime/defs_windows.go2
-rw-r--r--src/pkg/runtime/goc2c.c3
-rw-r--r--src/pkg/runtime/lock_futex.c2
-rw-r--r--src/pkg/runtime/lock_sema.c2
-rwxr-xr-xsrc/pkg/runtime/mkasmh.sh25
-rwxr-xr-xsrc/pkg/runtime/mkgodefs.sh24
-rw-r--r--src/pkg/runtime/mkversion.c8
-rw-r--r--src/pkg/runtime/rt0_windows_amd64.s2
-rw-r--r--src/pkg/runtime/signal_darwin_amd64.c2
-rw-r--r--src/pkg/runtime/sys_darwin_386.s2
-rw-r--r--src/pkg/runtime/sys_darwin_amd64.s2
-rw-r--r--src/pkg/runtime/sys_freebsd_386.s2
-rw-r--r--src/pkg/runtime/sys_freebsd_amd64.s2
-rw-r--r--src/pkg/runtime/sys_linux_386.s2
-rw-r--r--src/pkg/runtime/sys_linux_amd64.s2
-rw-r--r--src/pkg/runtime/sys_linux_arm.s2
-rw-r--r--src/pkg/runtime/sys_netbsd_386.s2
-rw-r--r--src/pkg/runtime/sys_netbsd_amd64.s2
-rw-r--r--src/pkg/runtime/sys_openbsd_386.s2
-rw-r--r--src/pkg/runtime/sys_openbsd_amd64.s2
-rw-r--r--src/pkg/runtime/sys_plan9_386.s2
-rw-r--r--src/pkg/runtime/sys_windows_386.s2
-rw-r--r--src/pkg/runtime/sys_windows_amd64.s2
36 files changed, 81 insertions, 223 deletions
diff --git a/src/pkg/runtime/Makefile b/src/pkg/runtime/Makefile
index 4d81def5a8..651fa02d0b 100644
--- a/src/pkg/runtime/Makefile
+++ b/src/pkg/runtime/Makefile
@@ -4,7 +4,8 @@
include ../../Make.inc
-x:=$(shell gomake -f Makefile.auto)
+# Go tool will do this for package runtime.
+CFLAGS+=-DGOOS_$(GOOS) -DGOARCH_$(GOARCH)
TARG=runtime
@@ -13,13 +14,15 @@ GOFILES=\
error.go\
extern.go\
mem.go\
+ runtime_defs.go\
sig.go\
softfloat64.go\
type.go\
- zgoarch_$(GOARCH).go\
- zgoos_$(GOOS).go\
- zruntime_defs_$(GOOS)_$(GOARCH).go\
- zversion.go\
+ version.go\
+ version_$(GOOS).go\
+ version_$(GOARCH).go\
+
+CLEANFILES+=version.go version_*.go
OFILES_darwin=\
lock_sema.$O\
@@ -42,7 +45,7 @@ OFILES_plan9=\
OFILES_windows=\
callback_windows_$(GOARCH).$O\
lock_sema.$O\
- zsyscall_windows_$(GOARCH).$O\
+ syscall_windows.$O\
# 386-specific object files
OFILES_386=\
@@ -63,8 +66,6 @@ OFILES_arm=\
traceback_x86.$O\
OFILES=\
- $(OFILES_$(GOARCH))\
- $(OFILES_$(GOOS))\
alg.$O\
asm_$(GOARCH).$O\
atomic_$(GOARCH).$O\
@@ -76,6 +77,7 @@ OFILES=\
float.$O\
hashmap.$O\
iface.$O\
+ malloc.$O\
mcache.$O\
mcentral.$O\
mem_$(GOOS).$O\
@@ -84,24 +86,25 @@ OFILES=\
mfixalloc.$O\
mgc0.$O\
mheap.$O\
+ mprof.$O\
msize.$O\
print.$O\
proc.$O\
rt0_$(GOOS)_$(GOARCH).$O\
rune.$O\
runtime.$O\
+ runtime1.$O\
+ sema.$O\
signal_$(GOOS)_$(GOARCH).$O\
+ sigqueue.$O\
slice.$O\
+ string.$O\
symtab.$O\
sys_$(GOOS)_$(GOARCH).$O\
thread_$(GOOS).$O\
- zmalloc_$(GOARCH).$O\
- zmprof_$(GOARCH).$O\
- zruntime1_$(GOARCH).$O\
- zsema_$(GOARCH).$O\
- zsigqueue_$(GOARCH).$O\
- zstring_$(GOARCH).$O\
- ztime_$(GOARCH).$O\
+ time.$O\
+ $(OFILES_$(GOARCH))\
+ $(OFILES_$(GOOS))\
AUTOHFILES=\
arch_GOARCH.h\
@@ -115,6 +118,7 @@ HFILES=\
hashmap.h\
malloc.h\
stack.h\
+ asm_$(GOARCH).h\
$(AUTOHFILES)\
GOFILES+=$(GOFILES_$(GOOS))
@@ -122,10 +126,6 @@ GOFILES+=$(GOFILES_$(GOOS))
# For use by cgo.
INSTALLFILES=$(pkgdir)/runtime.h $(pkgdir)/cgocall.h
-# Go tool will do this for package runtime.
-AFLAGS+=-DGOOS_$(GOOS) -DGOARCH_$(GOARCH)
-CFLAGS+=-DGOOS_$(GOOS) -DGOARCH_$(GOARCH)
-
# special, out of the way compiler flag that means "add runtime metadata to output"
GC+= -+
@@ -138,8 +138,44 @@ $(pkgdir)/%.h: %.h
clean: clean-local
clean-local:
- rm -f $(AUTOHFILES)
- make -f Makefile.auto clean
+ rm -f goc2c mkversion version.go runtime.acid.* runtime_defs.go $$(ls *.goc | sed 's/goc$$/c/') $(AUTOHFILES)
+
+asm_$(GOARCH).h: mkasmh.sh runtime.acid.$(GOARCH)
+ ./mkasmh.sh >$@.x
+ mv -f $@.x $@
+
+goc2c: goc2c.c
+ quietgcc -o $@ -I "$(GOROOT)/include" $< "$(GOROOT)/lib/lib9.a"
+
+mkversion: mkversion.c
+ quietgcc -o $@ -I "$(GOROOT)/include" $< "$(GOROOT)/lib/lib9.a"
+
+version.go: mkversion
+ GOROOT="$(GOROOT_FINAL)" ./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 $@
+
+# for discovering offsets inside structs when debugging
+runtime.acid.$(GOARCH): runtime.h proc.c $(AUTOHFILES)
+ $(CC) $(CFLAGS) -a proc.c >$@
+
+# 386 traceback is really amd64 traceback
+ifeq ($(GOARCH),386)
+traceback.$O: amd64/traceback.c
+ $(CC) $(CFLAGS) $<
+endif
+
+runtime_defs.go: proc.c iface.c hashmap.c chan.c $(HFILES)
+ CC="$(CC)" CFLAGS="$(CFLAGS)" ./mkgodefs.sh proc.c iface.c hashmap.c chan.c > $@.x
+ mv -f $@.x $@
arch_GOARCH.h: arch_$(GOARCH).h
cp $^ $@
@@ -152,8 +188,3 @@ os_GOOS.h: os_$(GOOS).h
signals_GOOS.h: signals_$(GOOS).h
cp $^ $@
-
-zasm_GOOS_GOARCH.h: zasm_$(GOOS)_$(GOARCH).h
- cp $^ $@
-
-%.$O: zasm_GOOS_GOARCH.h
diff --git a/src/pkg/runtime/Makefile.auto b/src/pkg/runtime/Makefile.auto
deleted file mode 100644
index 13db81aa9d..0000000000
--- a/src/pkg/runtime/Makefile.auto
+++ /dev/null
@@ -1,101 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-GOARCHES=\
- 386\
- amd64\
- arm\
-
-GOOSES=\
- darwin\
- freebsd\
- linux\
- netbsd\
- openbsd\
- plan9\
- windows\
-
-GOOSARCHES=\
- darwin_386\
- darwin_amd64\
- freebsd_386\
- freebsd_amd64\
- linux_386\
- linux_amd64\
- linux_arm\
- netbsd_386\
- netbsd_amd64\
- openbsd_386\
- openbsd_amd64\
- plan9_386\
- windows_386\
- windows_amd64\
-
-AUTO=\
- $(GOARCHES:%=zmalloc_%.c)\
- $(GOARCHES:%=zmprof_%.c)\
- $(GOARCHES:%=zruntime1_%.c)\
- $(GOARCHES:%=zsema_%.c)\
- $(GOARCHES:%=zsigqueue_%.c)\
- $(GOARCHES:%=zstring_%.c)\
- $(GOARCHES:%=ztime_%.c)\
- $(GOARCHES:%=zgoarch_%.go)\
- $(GOOSES:%=zgoos_%.go)\
- $(GOOSARCHES:%=zruntime_defs_%.go)\
- $(GOOSARCHES:%=zasm_%.h)\
- zsyscall_windows_386.c\
- zsyscall_windows_amd64.c\
- zversion.go\
-
-all: auto
-auto: $(AUTO)
-
-# .goc -> .c (specific to os/arch combination)
-goc2c: goc2c.c
- quietgcc -o $@ -I "$(GOROOT)/include" $< "$(GOROOT)/lib/lib9.a"
-
-z%_386.c: %.goc goc2c
- GOARCH=386 ./goc2c "`pwd`/$<" >$@.tmp
- mv -f $@.tmp $@
-
-z%_amd64.c: %.goc goc2c
- GOARCH=amd64 ./goc2c "`pwd`/$<" >$@.tmp
- mv -f $@.tmp $@
-
-z%_arm.c: %.goc goc2c
- GOARCH=arm ./goc2c "`pwd`/$<" >$@.tmp
- mv -f $@.tmp $@
-
-# version files
-mkversion: mkversion.c ../../../lib/lib9.a
- quietgcc -o $@ -I "$(GOROOT)/include" $< "$(GOROOT)/lib/lib9.a"
-
-zversion.go: mkversion
- GOROOT="$(GOROOT_FINAL)" ./mkversion >$@
-
-zgoos_%.go:
- (echo '// AUTO-GENERATED; run make -f Makefile.auto'; echo; echo 'package runtime'; echo; echo 'const theGoos = "$*"') >$@
-
-zgoarch_%.go:
- (echo '// AUTO-GENERATED; run make -f Makefile.auto'; echo; echo 'package runtime'; echo; echo 'const theGoarch = "$*"') >$@
-
-# definitions of runtime structs, translated from C to Go
-zruntime_defs_%.go: proc.c iface.c hashmap.c chan.c mkgodefs.sh
- ./mkgodefs.sh $* proc.c iface.c hashmap.c chan.c >$@.tmp
- mv -f $@.tmp $@
-
-# struct field offsets #defined for assembly
-zasm_%.h: mkasmh.sh proc.c
- ./mkasmh.sh $* >$@.tmp
- mv -f $@.tmp $@
-
-clean:
- rm -f goc2c mkversion $(AUTO)
-
-# This file must not run targets in parallel:
-# mkgodefs.sh and mkasmh.sh scribble on the same files.
-# This is a magic name known to GNU make.
-.NOTPARALLEL:
diff --git a/src/pkg/runtime/asm_386.s b/src/pkg/runtime/asm_386.s
index 52400637be..c39f365d59 100644
--- a/src/pkg/runtime/asm_386.s
+++ b/src/pkg/runtime/asm_386.s
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_386.h"
TEXT _rt0_386(SB),7,$0
// Linux, Windows start the FPU in extended double precision.
diff --git a/src/pkg/runtime/asm_amd64.s b/src/pkg/runtime/asm_amd64.s
index 9053334993..d91421e9e3 100644
--- a/src/pkg/runtime/asm_amd64.s
+++ b/src/pkg/runtime/asm_amd64.s
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_amd64.h"
TEXT _rt0_amd64(SB),7,$-8
// copy arguments forward on an even stack
diff --git a/src/pkg/runtime/asm_arm.s b/src/pkg/runtime/asm_arm.s
index b36bbe3047..533c0744d7 100644
--- a/src/pkg/runtime/asm_arm.s
+++ b/src/pkg/runtime/asm_arm.s
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_arm.h"
// using frame size $-4 means do not save LR on stack.
TEXT _rt0_arm(SB),7,$-4
diff --git a/src/pkg/runtime/defs1_linux.go b/src/pkg/runtime/defs1_linux.go
index 451817a67a..6d84e84d76 100644
--- a/src/pkg/runtime/defs1_linux.go
+++ b/src/pkg/runtime/defs1_linux.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build ignore
-
/*
Input to cgo -cdefs
diff --git a/src/pkg/runtime/defs2_linux.go b/src/pkg/runtime/defs2_linux.go
index 9b07029556..1fafb7bfc1 100644
--- a/src/pkg/runtime/defs2_linux.go
+++ b/src/pkg/runtime/defs2_linux.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build ignore
-
/*
* Input to cgo -cdefs
diff --git a/src/pkg/runtime/defs_arm_linux.go b/src/pkg/runtime/defs_arm_linux.go
index 2063efb067..35f74e8dba 100644
--- a/src/pkg/runtime/defs_arm_linux.go
+++ b/src/pkg/runtime/defs_arm_linux.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build ignore
-
/*
Input to cgo.
On a Debian Lenny arm linux distribution:
diff --git a/src/pkg/runtime/defs_darwin.go b/src/pkg/runtime/defs_darwin.go
index 3f3e41d86b..6cd988def2 100644
--- a/src/pkg/runtime/defs_darwin.go
+++ b/src/pkg/runtime/defs_darwin.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build ignore
-
/*
Input to cgo.
diff --git a/src/pkg/runtime/defs_freebsd.go b/src/pkg/runtime/defs_freebsd.go
index 306e32197e..ee80bb2855 100644
--- a/src/pkg/runtime/defs_freebsd.go
+++ b/src/pkg/runtime/defs_freebsd.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build ignore
-
/*
Input to cgo.
diff --git a/src/pkg/runtime/defs_linux.go b/src/pkg/runtime/defs_linux.go
index c0275e1114..bbaab2d33e 100644
--- a/src/pkg/runtime/defs_linux.go
+++ b/src/pkg/runtime/defs_linux.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build ignore
-
/*
Input to cgo -cdefs
diff --git a/src/pkg/runtime/defs_netbsd.go b/src/pkg/runtime/defs_netbsd.go
index 47c30cf101..4fb3a04634 100644
--- a/src/pkg/runtime/defs_netbsd.go
+++ b/src/pkg/runtime/defs_netbsd.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build ignore
-
/*
Input to cgo.
diff --git a/src/pkg/runtime/defs_openbsd.go b/src/pkg/runtime/defs_openbsd.go
index 47c30cf101..4fb3a04634 100644
--- a/src/pkg/runtime/defs_openbsd.go
+++ b/src/pkg/runtime/defs_openbsd.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build ignore
-
/*
Input to cgo.
diff --git a/src/pkg/runtime/defs_windows.go b/src/pkg/runtime/defs_windows.go
index 0d525b9322..e23e4207de 100644
--- a/src/pkg/runtime/defs_windows.go
+++ b/src/pkg/runtime/defs_windows.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build ignore
-
/*
Input to cgo.
diff --git a/src/pkg/runtime/goc2c.c b/src/pkg/runtime/goc2c.c
index f1d07f61b3..fcac9c0600 100644
--- a/src/pkg/runtime/goc2c.c
+++ b/src/pkg/runtime/goc2c.c
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build ignore
-
/*
* Translate a .goc file into a .c file. A .goc file is a combination
* of a limited form of Go with C.
@@ -744,7 +742,6 @@ main(int argc, char **argv)
}
}
- printf("// AUTO-GENERATED; run make\n\n");
process_file();
exits(0);
}
diff --git a/src/pkg/runtime/lock_futex.c b/src/pkg/runtime/lock_futex.c
index c6b64ca6de..375b7d7d7c 100644
--- a/src/pkg/runtime/lock_futex.c
+++ b/src/pkg/runtime/lock_futex.c
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build freebsd linux
-
#include "runtime.h"
// This implementation depends on OS-specific implementations of
diff --git a/src/pkg/runtime/lock_sema.c b/src/pkg/runtime/lock_sema.c
index ae229ec728..8875b17a24 100644
--- a/src/pkg/runtime/lock_sema.c
+++ b/src/pkg/runtime/lock_sema.c
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build darwin netbsd openbsd plan9 windows
-
#include "runtime.h"
// This implementation depends on OS-specific implementations of
diff --git a/src/pkg/runtime/mkasmh.sh b/src/pkg/runtime/mkasmh.sh
index 3f6c2b2d2b..920e79a024 100755
--- a/src/pkg/runtime/mkasmh.sh
+++ b/src/pkg/runtime/mkasmh.sh
@@ -5,28 +5,9 @@
set -e
-SYS=$1
-export GOOS=$(echo $SYS | sed 's/_.*//')
-export GOARCH=$(echo $SYS | sed 's/.*_//')
-shift
-
-case "$GOARCH" in
-386) CC=8c;;
-amd64) CC=6c;;
-arm) CC=5c;;
-esac
-export CC
-
-export CFLAGS="-Dos_$GOOS -Darch_$GOARCH"
-
-cp arch_$GOARCH.h arch_GOARCH.h
-cp defs_${GOOS}_$GOARCH.h defs_GOOS_GOARCH.h
-cp os_$GOOS.h os_GOOS.h
-cp signals_$GOOS.h signals_GOOS.h
-
cat <<'EOF'
// Assembly constants.
-// AUTO-GENERATED; run make -f Makefile.auto
+// AUTOMATICALLY GENERATED BY mkasmh.sh DURING BUILD
EOF
@@ -110,7 +91,6 @@ arm)
esac
echo
-$CC $CFLAGS -a proc.c |
awk '
{ gsub(/\r/, ""); }
/^aggr G$/ { aggr="g" }
@@ -129,6 +109,5 @@ aggr != "" && /^ / {
offset=$(NF-1);
printf("#define %s_%s %s\n", aggr, name, offset);
}
-'
+' runtime.acid.$GOARCH
-rm -f arch_GOARCH.h defs_GOOS_GOARCH.h os_GOOS.h signals_GOOS.h
diff --git a/src/pkg/runtime/mkgodefs.sh b/src/pkg/runtime/mkgodefs.sh
index 87c31f28b6..b6e97213e0 100755
--- a/src/pkg/runtime/mkgodefs.sh
+++ b/src/pkg/runtime/mkgodefs.sh
@@ -5,28 +5,10 @@
set -e
-SYS=$1
-export GOOS=$(echo $SYS | sed 's/_.*//')
-export GOARCH=$(echo $SYS | sed 's/.*_//')
-shift
-
-case "$GOARCH" in
-386) CC=8c;;
-amd64) CC=6c;;
-arm) CC=5c;;
-esac
-export CC
-
-export CFLAGS="-DGOOS_$GOOS -DGOARCH_$GOARCH"
-
-cp arch_$GOARCH.h arch_GOARCH.h
-cp defs_${GOOS}_$GOARCH.h defs_GOOS_GOARCH.h
-cp os_$GOOS.h os_GOOS.h
-cp signals_$GOOS.h signals_GOOS.h
-
cat <<EOF
// Go definitions for C variables and types.
-// AUTO-GENERATED; run make -f Makefile.auto
+// AUTOMATICALLY GENERATED BY THE FOLLOWING COMMAND. DO NOT EDIT.
+// CC="$CC" CFLAGS="$CFLAGS" ./mkgodefs.sh $@
package runtime
import "unsafe"
@@ -55,5 +37,3 @@ skip {
{print}
'
-
-rm -f arch_GOARCH.h defs_GOOS_GOARCH.h os_GOOS.h signals_GOOS.h
diff --git a/src/pkg/runtime/mkversion.c b/src/pkg/runtime/mkversion.c
index 931302187f..0d96aa3569 100644
--- a/src/pkg/runtime/mkversion.c
+++ b/src/pkg/runtime/mkversion.c
@@ -1,14 +1,8 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
#include <u.h>
#include <libc.h>
char *template =
- "// AUTO-GENERATED; run make -f Makefile.auto\n\n"
+ "// generated by mkversion.c; do not edit.\n"
"package runtime\n"
"const defaultGoroot = `%s`\n"
"const theVersion = \"%s\"\n";
diff --git a/src/pkg/runtime/rt0_windows_amd64.s b/src/pkg/runtime/rt0_windows_amd64.s
index dc1408adc3..5dc6b6e51b 100644
--- a/src/pkg/runtime/rt0_windows_amd64.s
+++ b/src/pkg/runtime/rt0_windows_amd64.s
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_amd64.h"
TEXT _rt0_amd64_windows(SB),7,$-8
MOVQ $_rt0_amd64(SB), AX
diff --git a/src/pkg/runtime/signal_darwin_amd64.c b/src/pkg/runtime/signal_darwin_amd64.c
index c7621ddcaf..fd75e78454 100644
--- a/src/pkg/runtime/signal_darwin_amd64.c
+++ b/src/pkg/runtime/signal_darwin_amd64.c
@@ -152,7 +152,7 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
sa.sa_flags |= SA_RESTART;
sa.sa_mask = ~0ULL;
sa.sa_tramp = runtime·sigtramp; // runtime·sigtramp's job is to call into real handler
- *(uintptr*)sa.__sigaction_u = (uintptr)fn;
+ *(uintptr*)&sa.__sigaction_u = (uintptr)fn;
runtime·sigaction(i, &sa, nil);
}
diff --git a/src/pkg/runtime/sys_darwin_386.s b/src/pkg/runtime/sys_darwin_386.s
index 6ce1ba5533..9a513468a0 100644
--- a/src/pkg/runtime/sys_darwin_386.s
+++ b/src/pkg/runtime/sys_darwin_386.s
@@ -6,7 +6,7 @@
// See http://fxr.watson.org/fxr/source/bsd/kern/syscalls.c?v=xnu-1228
// or /usr/include/sys/syscall.h (on a Mac) for system call numbers.
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_386.h"
TEXT runtime·notok(SB),7,$0
MOVL $0xf1, 0xf1
diff --git a/src/pkg/runtime/sys_darwin_amd64.s b/src/pkg/runtime/sys_darwin_amd64.s
index 86f9936614..ac777656c5 100644
--- a/src/pkg/runtime/sys_darwin_amd64.s
+++ b/src/pkg/runtime/sys_darwin_amd64.s
@@ -11,7 +11,7 @@
// The high 8 bits specify the kind of system call: 1=Mach, 2=BSD, 3=Machine-Dependent.
//
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_amd64.h"
// Exit the entire program (like C exit)
TEXT runtime·exit(SB),7,$0
diff --git a/src/pkg/runtime/sys_freebsd_386.s b/src/pkg/runtime/sys_freebsd_386.s
index cec7a3e8e7..9833784efc 100644
--- a/src/pkg/runtime/sys_freebsd_386.s
+++ b/src/pkg/runtime/sys_freebsd_386.s
@@ -6,7 +6,7 @@
// /usr/src/sys/kern/syscalls.master for syscall numbers.
//
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_386.h"
TEXT runtime·sys_umtx_op(SB),7,$-4
MOVL $454, AX
diff --git a/src/pkg/runtime/sys_freebsd_amd64.s b/src/pkg/runtime/sys_freebsd_amd64.s
index c96b2f4d6b..991c33c825 100644
--- a/src/pkg/runtime/sys_freebsd_amd64.s
+++ b/src/pkg/runtime/sys_freebsd_amd64.s
@@ -6,7 +6,7 @@
// /usr/src/sys/kern/syscalls.master for syscall numbers.
//
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_amd64.h"
TEXT runtime·sys_umtx_op(SB),7,$0
MOVQ 8(SP), DI
diff --git a/src/pkg/runtime/sys_linux_386.s b/src/pkg/runtime/sys_linux_386.s
index b745bc502e..1763143f9e 100644
--- a/src/pkg/runtime/sys_linux_386.s
+++ b/src/pkg/runtime/sys_linux_386.s
@@ -6,7 +6,7 @@
// System calls and other sys.stuff for 386, Linux
//
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_386.h"
TEXT runtime·exit(SB),7,$0
MOVL $252, AX // syscall number
diff --git a/src/pkg/runtime/sys_linux_amd64.s b/src/pkg/runtime/sys_linux_amd64.s
index ef7bb2864c..d55518686c 100644
--- a/src/pkg/runtime/sys_linux_amd64.s
+++ b/src/pkg/runtime/sys_linux_amd64.s
@@ -6,7 +6,7 @@
// System calls and other sys.stuff for AMD64, Linux
//
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_amd64.h"
TEXT runtime·exit(SB),7,$0-8
MOVL 8(SP), DI
diff --git a/src/pkg/runtime/sys_linux_arm.s b/src/pkg/runtime/sys_linux_arm.s
index e0e4135b54..d0b36dedf9 100644
--- a/src/pkg/runtime/sys_linux_arm.s
+++ b/src/pkg/runtime/sys_linux_arm.s
@@ -6,7 +6,7 @@
// System calls and other sys.stuff for arm, Linux
//
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_arm.h"
// OABI
//#define SYS_BASE 0x00900000
diff --git a/src/pkg/runtime/sys_netbsd_386.s b/src/pkg/runtime/sys_netbsd_386.s
index 6322861024..bcb4fc5e71 100644
--- a/src/pkg/runtime/sys_netbsd_386.s
+++ b/src/pkg/runtime/sys_netbsd_386.s
@@ -6,7 +6,7 @@
// /usr/src/sys/kern/syscalls.master for syscall numbers.
//
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_386.h"
// Exit the entire program (like C exit)
TEXT runtime·exit(SB),7,$-4
diff --git a/src/pkg/runtime/sys_netbsd_amd64.s b/src/pkg/runtime/sys_netbsd_amd64.s
index 7abeb159b1..20817711fb 100644
--- a/src/pkg/runtime/sys_netbsd_amd64.s
+++ b/src/pkg/runtime/sys_netbsd_amd64.s
@@ -6,7 +6,7 @@
// /usr/src/sys/kern/syscalls.master for syscall numbers.
//
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_amd64.h"
// int64 rfork_thread(int32 flags, void *stack, M *m, G *g, void (*fn)(void));
TEXT runtime·rfork_thread(SB),7,$0
diff --git a/src/pkg/runtime/sys_openbsd_386.s b/src/pkg/runtime/sys_openbsd_386.s
index d49d32b95a..ae3275c852 100644
--- a/src/pkg/runtime/sys_openbsd_386.s
+++ b/src/pkg/runtime/sys_openbsd_386.s
@@ -6,7 +6,7 @@
// /usr/src/sys/kern/syscalls.master for syscall numbers.
//
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_386.h"
// Exit the entire program (like C exit)
TEXT runtime·exit(SB),7,$-4
diff --git a/src/pkg/runtime/sys_openbsd_amd64.s b/src/pkg/runtime/sys_openbsd_amd64.s
index 5bf2e813e8..f568ba4312 100644
--- a/src/pkg/runtime/sys_openbsd_amd64.s
+++ b/src/pkg/runtime/sys_openbsd_amd64.s
@@ -6,7 +6,7 @@
// /usr/src/sys/kern/syscalls.master for syscall numbers.
//
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_amd64.h"
// int64 rfork_thread(int32 flags, void *stack, M *m, G *g, void (*fn)(void));
TEXT runtime·rfork_thread(SB),7,$0
diff --git a/src/pkg/runtime/sys_plan9_386.s b/src/pkg/runtime/sys_plan9_386.s
index 94c36aa410..8c773eee9d 100644
--- a/src/pkg/runtime/sys_plan9_386.s
+++ b/src/pkg/runtime/sys_plan9_386.s
@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
#include "defs_GOOS_GOARCH.h"
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_386.h"
// setldt(int entry, int address, int limit)
TEXT runtime·setldt(SB),7,$0
diff --git a/src/pkg/runtime/sys_windows_386.s b/src/pkg/runtime/sys_windows_386.s
index c864c7f83c..307b93d5c7 100644
--- a/src/pkg/runtime/sys_windows_386.s
+++ b/src/pkg/runtime/sys_windows_386.s
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_386.h"
// void runtime·asmstdcall(void *c);
TEXT runtime·asmstdcall(SB),7,$0
diff --git a/src/pkg/runtime/sys_windows_amd64.s b/src/pkg/runtime/sys_windows_amd64.s
index e2a518884d..508759ff8f 100644
--- a/src/pkg/runtime/sys_windows_amd64.s
+++ b/src/pkg/runtime/sys_windows_amd64.s
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-#include "zasm_GOOS_GOARCH.h"
+#include "asm_amd64.h"
// maxargs should be divisible by 2, as Windows stack
// must be kept 16-byte aligned on syscall entry.