Re: libgo patch committed: Update to Go1.17rc2 release

2021-09-07 Thread Ian Lance Taylor via Gcc-patches
On Fri, Sep 3, 2021 at 2:00 AM Matthias Klose  wrote:
>
> On 8/31/21 3:24 PM, H.J. Lu via Gcc-patches wrote:
> > On Thu, Aug 12, 2021 at 8:24 PM Ian Lance Taylor via Gcc-patches
> >  wrote:
> >>
> >> This patch updates libgo from the Go1.16.5 release to the Go 1.17rc2
> >> release.  As usual with these version updates, the patch itself is too
> >> large to attach to this e-mail message.  I've attached the changes to
> >> files that are specific to gccgo.  Bootstraped and ran Go testsuite on
> >> x86_64-pc-linux-gnu.  Committed to mainline.
> >>
> >> Ian
> >
> > This breaks build with x32:
>
> This is PR/102102
>
> Also seen on x86_64-linux-gnu, when configuring with
> --with-multilib-list=m32,m64,mx32

Should be fixed now, I hope.

I don't know how to test this, as my desktop does not support x32 mode.

Ian


Re: libgo patch committed: Update to Go1.17rc2 release

2021-09-03 Thread Matthias Klose
On 8/31/21 3:24 PM, H.J. Lu via Gcc-patches wrote:
> On Thu, Aug 12, 2021 at 8:24 PM Ian Lance Taylor via Gcc-patches
>  wrote:
>>
>> This patch updates libgo from the Go1.16.5 release to the Go 1.17rc2
>> release.  As usual with these version updates, the patch itself is too
>> large to attach to this e-mail message.  I've attached the changes to
>> files that are specific to gccgo.  Bootstraped and ran Go testsuite on
>> x86_64-pc-linux-gnu.  Committed to mainline.
>>
>> Ian
> 
> This breaks build with x32:

This is PR/102102

Also seen on x86_64-linux-gnu, when configuring with
--with-multilib-list=m32,m64,mx32

Matthias


Re: libgo patch committed: Update to Go1.17rc2 release

2021-08-31 Thread H.J. Lu via Gcc-patches
On Thu, Aug 12, 2021 at 8:24 PM Ian Lance Taylor via Gcc-patches
 wrote:
>
> This patch updates libgo from the Go1.16.5 release to the Go 1.17rc2
> release.  As usual with these version updates, the patch itself is too
> large to attach to this e-mail message.  I've attached the changes to
> files that are specific to gccgo.  Bootstraped and ran Go testsuite on
> x86_64-pc-linux-gnu.  Committed to mainline.
>
> Ian

This breaks build with x32:

/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:35:30:
error: integer constant overflow
   35 | seed ^= hashkey[0] ^ m1
  |  ^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:61:50:
error: integer constant overflow
   61 | seed = mix(r8(p)^m2, r8(add(p, 8))^seed)
  |  ^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:62:60:
error: integer constant overflow
   62 | seed1 = mix(r8(add(p, 16))^m3,
r8(add(p, 24))^seed1)
  |^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:63:60:
error: integer constant overflow
   63 | seed2 = mix(r8(add(p, 32))^m4,
r8(add(p, 40))^seed2)
  |^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:69:42:
error: integer constant overflow
   69 | seed = mix(r8(p)^m2, r8(add(p, 8))^seed)
  |  ^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:76:20:
error: integer constant overflow
   76 | return mix(m5^s, mix(a^m2, b^seed))
  |^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:76:32:
error: integer constant overflow
   76 | return mix(m5^s, mix(a^m2, b^seed))
  |^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:81:22:
error: integer constant overflow
   81 | return mix(m5^4, mix(a^m2, a^seed^hashkey[0]^m1))
  |  ^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:81:32:
error: integer constant overflow
   81 | return mix(m5^4, mix(a^m2, a^seed^hashkey[0]^m1))
  |^
/export/gnu/import/git/gitlab/x86-gcc/libgo/go/runtime/hash64.go:81:54:
error: integer constant overflow
   81 | return mix(m5^4, mix(a^m2, a^seed^hashkey[0]^m1))

The problem is that hashkey is an array of uintptr, but hash64.go is enabled for
many targets with 32-bit uintptr:

commit c5b21c3f4c17b0649155035d2f9aa97b2da8a813
Author: Ian Lance Taylor 
Date:   Fri Jul 30 14:28:58 2021 -0700

libgo: update to Go1.17rc2

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/341629

diff --git a/libgo/go/runtime/hash64.go b/libgo/go/runtime/hash64.go
index 704bbe6f62b..4b32d515c4b 100644
--- a/libgo/go/runtime/hash64.go
+++ b/libgo/go/runtime/hash64.go
@@ -3,113 +3,98 @@
 // license that can be found in the LICENSE file.

 // Hashing algorithm inspired by
-//   xxhash: https://code.google.com/p/xxhash/
-// cityhash: https://code.google.com/p/cityhash/
+// wyhash: https://github.com/wangyi-fudan/wyhash

+//go:build amd64 || arm64 || mips64 || mips64le || ppc64 || ppc64le
|| riscv64 || s390x || wasm || alpha || amd64p32 || arm64be || ia64 ||
mips64p32 || mips64p32le || sparc64
 // +build amd64 arm64 mips64 mips64le ppc64 ppc64le riscv64 s390x
wasm alpha amd64p32 arm64be ia64 mips64p32 mips64p32le sparc64


-- 
H.J.


Re: libgo patch committed: Update to Go1.17rc2 release

2021-08-14 Thread Ian Lance Taylor via Gcc-patches
On Fri, Aug 13, 2021 at 2:08 PM Rainer Orth  
wrote:
>
> unfortunately, things are considerably worse: syscall.lo fails to build
> and go1 even ICEs:
>
> /vol/gcc/src/hg/master/local/libgo/go/syscall/libcall_posix_utimesnano.go:13:1:
>  error: redefinition of ‘UtimesNano’
>13 | func UtimesNano(path string, ts []Timespec) error {
>   | ^
> /vol/gcc/src/hg/master/local/libgo/go/syscall/libcall_linux_utimesnano.go:13:1:
>  note: previous definition of ‘UtimesNano’ was here
>13 | func UtimesNano(path string, ts []Timespec) (err error) {
>   | ^
>
> The second file is Linux-only and needs a corresponding build guard.
>
> /vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:193:16: error: use 
> of undefined type ‘SysProcAttr’
>   193 | Sys   *SysProcAttr
>   |^
> /vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:235:15: error: 
> reference to field ‘Chroot’ in object which has no fields or methods
>   235 | if sys.Chroot != "" {
>   |   ^
> /vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:236:52: error: 
> reference to field ‘Chroot’ in object which has no fields or methods
>   236 | chroot, err = BytePtrFromString(sys.Chroot)
>   |^
> /vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:251:15: error: 
> reference to field ‘Setctty’ in object which has no fields or methods
>   251 | if sys.Setctty && sys.Foreground {
>   |   ^
> /vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:251:30: error: 
> reference to field ‘Foreground’ in object which has no fields or methods
>   251 | if sys.Setctty && sys.Foreground {
>   |  ^
> /vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:254:15: error: 
> reference to field ‘Setctty’ in object which has no fields or methods
>   254 | if sys.Setctty && sys.Ctty >= len(attr.Files) {
>   |   ^
> /vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:254:30: error: 
> reference to field ‘Ctty’ in object which has no fields or methods
>   254 | if sys.Setctty && sys.Ctty >= len(attr.Files) {
>   |  ^
> /vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:269:21: error: 
> reference to undefined name ‘forkAndExecInChild’
>   269 | pid, err1 = forkAndExecInChild(argv0p, argvp, envvp, chroot, 
> dir, attr, sys, p[1])
>   | ^
>
> I found that upstream has exec_libc.go for AIX and Solaris with the
> missing SysProcAttr and forkAndExecInChild definitions.  It doesn't work
> out of the box, though:
>
> /vol/gcc/src/hg/master/local/libgo/go/syscall/exec_libc.go:63:9: error: 
> reference to undefined name ‘execveLibc’
>63 | execveLibc = execve
>   | ^
> /vol/gcc/src/hg/master/local/libgo/go/syscall/exec_libc.go:137:25: error: 
> reference to undefined name ‘_Pid_t’
>   137 | pgrp := _Pid_t(sys.Pgid)
>   | ^
> /vol/gcc/src/hg/master/local/libgo/go/syscall/exec_libc.go:144:32: error: 
> reference to undefined name ‘_Pid_t’
>   144 | pgrp = _Pid_t(r1)
>   |^
>
> For one, switching to Pid_t is needed:
>
>
> Besides, support for execveLibc has been dropped in exec_unix.go
> compared to upstream.
>
> terminate called after throwing an instance of 'std::out_of_range'
>   what():  vector::_M_range_check: __n (which is 1) >= this->size() (which is 
> 1)
> go1: internal compiler error: Abort
> 0xce1abf crash_signal
> /vol/gcc/src/hg/master/local/gcc/toplev.c:328
>
> This went away after the fixes above.
>
> Next, I get
>
> /vol/gcc/src/hg/master/local/libgo/go/internal/syscall/unix/getrandom_solaris.go:10:15:
>  error: imported and not used: unsafe
>10 | "unsafe"
>   |   ^
> /vol/gcc/src/hg/master/local/libgo/go/internal/syscall/unix/getrandom_solaris.go:32:30:
>  error: reference to undefined name 'getrandomUnsupported'
>32 | if atomic.LoadInt32() != 0 {
>   |  ^
> /vol/gcc/src/hg/master/local/libgo/go/internal/syscall/unix/getrandom_solaris.go:41:44:
>  error: reference to undefined name 'getrandomUnsupported'
>41 | atomic.StoreInt32(, 1)
>   |^
> make[4]: *** [Makefile:3008: internal/syscall/unix.lo] Error 1
>
> The definition dropped compared to upstream.
>
> /vol/gcc/src/hg/master/local/libgo/go/os/user/listgroups_unix.go:39:15: 
> error: reference to undefined name ‘libc_getgrouplist’
>39 | rv := libc_getgrouplist(nameC, userGID, [0], )
>   |   ^
> /vol/gcc/src/hg/master/local/libgo/go/os/user/listgroups_unix.go:49:23: 
> error: reference to undefined name ‘libc_getgrouplist’
>49 | rv := libc_getgrouplist(nameC, 

Re: libgo patch committed: Update to Go1.17rc2 release

2021-08-13 Thread Rainer Orth
Hi Ian,

> Sorry about that.  I've committed this patch.

thanks.

unfortunately, things are considerably worse: syscall.lo fails to build
and go1 even ICEs:

/vol/gcc/src/hg/master/local/libgo/go/syscall/libcall_posix_utimesnano.go:13:1: 
error: redefinition of ‘UtimesNano’
   13 | func UtimesNano(path string, ts []Timespec) error {
  | ^
/vol/gcc/src/hg/master/local/libgo/go/syscall/libcall_linux_utimesnano.go:13:1: 
note: previous definition of ‘UtimesNano’ was here
   13 | func UtimesNano(path string, ts []Timespec) (err error) {
  | ^

The second file is Linux-only and needs a corresponding build guard.

/vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:193:16: error: use 
of undefined type ‘SysProcAttr’
  193 | Sys   *SysProcAttr
  |^
/vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:235:15: error: 
reference to field ‘Chroot’ in object which has no fields or methods
  235 | if sys.Chroot != "" {
  |   ^
/vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:236:52: error: 
reference to field ‘Chroot’ in object which has no fields or methods
  236 | chroot, err = BytePtrFromString(sys.Chroot)
  |^
/vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:251:15: error: 
reference to field ‘Setctty’ in object which has no fields or methods
  251 | if sys.Setctty && sys.Foreground {
  |   ^
/vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:251:30: error: 
reference to field ‘Foreground’ in object which has no fields or methods
  251 | if sys.Setctty && sys.Foreground {
  |  ^
/vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:254:15: error: 
reference to field ‘Setctty’ in object which has no fields or methods
  254 | if sys.Setctty && sys.Ctty >= len(attr.Files) {
  |   ^
/vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:254:30: error: 
reference to field ‘Ctty’ in object which has no fields or methods
  254 | if sys.Setctty && sys.Ctty >= len(attr.Files) {
  |  ^
/vol/gcc/src/hg/master/local/libgo/go/syscall/exec_unix.go:269:21: error: 
reference to undefined name ‘forkAndExecInChild’
  269 | pid, err1 = forkAndExecInChild(argv0p, argvp, envvp, chroot, 
dir, attr, sys, p[1])
  | ^

I found that upstream has exec_libc.go for AIX and Solaris with the
missing SysProcAttr and forkAndExecInChild definitions.  It doesn't work
out of the box, though:

/vol/gcc/src/hg/master/local/libgo/go/syscall/exec_libc.go:63:9: error: 
reference to undefined name ‘execveLibc’
   63 | execveLibc = execve
  | ^
/vol/gcc/src/hg/master/local/libgo/go/syscall/exec_libc.go:137:25: error: 
reference to undefined name ‘_Pid_t’
  137 | pgrp := _Pid_t(sys.Pgid)
  | ^
/vol/gcc/src/hg/master/local/libgo/go/syscall/exec_libc.go:144:32: error: 
reference to undefined name ‘_Pid_t’
  144 | pgrp = _Pid_t(r1)
  |^

For one, switching to Pid_t is needed:

--- /vol/gcc/src/go/go/dist-1.17/src/syscall/exec_libc.go	2021-08-13 22:10:42.0 +
+++ go/syscall/exec_libc.go	2021-08-13 22:41:34.028618677 +
@@ -134,14 +134,14 @@ func forkAndExecInChild(argv0 *byte, arg
 	}
 
 	if sys.Foreground {
-		pgrp := _Pid_t(sys.Pgid)
+		pgrp := Pid_t(sys.Pgid)
 		if pgrp == 0 {
 			r1, err1 = getpid()
 			if err1 != 0 {
 goto childerror
 			}
 
-			pgrp = _Pid_t(r1)
+			pgrp = Pid_t(r1)
 		}
 
 		// Place process group in foreground.

Besides, support for execveLibc has been dropped in exec_unix.go
compared to upstream.

terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 1) >= this->size() (which is 1)
go1: internal compiler error: Abort
0xce1abf crash_signal
/vol/gcc/src/hg/master/local/gcc/toplev.c:328

This went away after the fixes above.

Next, I get

/vol/gcc/src/hg/master/local/libgo/go/internal/syscall/unix/getrandom_solaris.go:10:15:
 error: imported and not used: unsafe
   10 | "unsafe"
  |   ^
/vol/gcc/src/hg/master/local/libgo/go/internal/syscall/unix/getrandom_solaris.go:32:30:
 error: reference to undefined name 'getrandomUnsupported'
   32 | if atomic.LoadInt32() != 0 {
  |  ^
/vol/gcc/src/hg/master/local/libgo/go/internal/syscall/unix/getrandom_solaris.go:41:44:
 error: reference to undefined name 'getrandomUnsupported'
   41 | atomic.StoreInt32(, 1)
  |^
make[4]: *** [Makefile:3008: internal/syscall/unix.lo] Error 1

The definition dropped compared to upstream.

/vol/gcc/src/hg/master/local/libgo/go/os/user/listgroups_unix.go:39:15: error: 
reference to 

Re: libgo patch committed: Update to Go1.17rc2 release

2021-08-13 Thread Ian Lance Taylor via Gcc-patches
On Fri, Aug 13, 2021 at 5:43 AM Rainer Orth  
wrote:
>
> Hi Ian,
>
> > This patch updates libgo from the Go1.16.5 release to the Go 1.17rc2
> > release.  As usual with these version updates, the patch itself is too
> > large to attach to this e-mail message.  I've attached the changes to
> > files that are specific to gccgo.  Bootstraped and ran Go testsuite on
> > x86_64-pc-linux-gnu.  Committed to mainline.
>
> this patch broke Solaris bootstrap:
>
> /vol/gcc/src/hg/master/local/libgo/runtime/stack.c: In function 
> 'onCurrentStack':
> /vol/gcc/src/hg/master/local/libgo/runtime/stack.c:177:21: error: expected 
> expression before 'uintptr'
>   177 | if (uintptr(initialsp2) < uintptr(nextsp2)) {
>   | ^~~
>
> Fixed by turning those into proper casts.

Sorry about that.  I've committed this patch.

Ian
a91ca5ff5fa56b54cfc03f43891ff613d714b722
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index bcbe1d93018..3000285fbf0 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-33f65dce43bd01c1fa38cd90a78c9aea6ca6dd59
+f2b7a2ce94127ad444a772bd1631516c5c67fb73
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
diff --git a/libgo/runtime/stack.c b/libgo/runtime/stack.c
index 0c0c30e46ac..65e8fa30077 100644
--- a/libgo/runtime/stack.c
+++ b/libgo/runtime/stack.c
@@ -174,7 +174,7 @@ bool onCurrentStack(uintptr p)
nextsp2 = secondary_stack_pointer();
if (nextsp2 != nil) {
initialsp2 = (byte*)(void*)(gp->gcinitialsp2);
-   if (uintptr(initialsp2) < uintptr(nextsp2)) {
+   if ((uintptr)(initialsp2) < (uintptr)(nextsp2)) {
temp = initialsp2;
initialsp2 = nextsp2;
nextsp2 = temp;


Re: libgo patch committed: Update to Go1.17rc2 release

2021-08-13 Thread Rainer Orth
Hi Ian,

> This patch updates libgo from the Go1.16.5 release to the Go 1.17rc2
> release.  As usual with these version updates, the patch itself is too
> large to attach to this e-mail message.  I've attached the changes to
> files that are specific to gccgo.  Bootstraped and ran Go testsuite on
> x86_64-pc-linux-gnu.  Committed to mainline.

this patch broke Solaris bootstrap:

/vol/gcc/src/hg/master/local/libgo/runtime/stack.c: In function 
'onCurrentStack':
/vol/gcc/src/hg/master/local/libgo/runtime/stack.c:177:21: error: expected 
expression before 'uintptr'
  177 | if (uintptr(initialsp2) < uintptr(nextsp2)) {
  | ^~~

Fixed by turning those into proper casts.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


libgo patch committed: Update to Go1.17rc2 release

2021-08-12 Thread Ian Lance Taylor via Gcc-patches
This patch updates libgo from the Go1.16.5 release to the Go 1.17rc2
release.  As usual with these version updates, the patch itself is too
large to attach to this e-mail message.  I've attached the changes to
files that are specific to gccgo.  Bootstraped and ran Go testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian
5fe441d33024fe33b9835c3e8d6b9f6cf24715f1
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 539d886b08f..bcbe1d93018 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-5edbb624b2595d644eb6842c952a292c41f7d6fa
+33f65dce43bd01c1fa38cd90a78c9aea6ca6dd59
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
diff --git a/libgo/MERGE b/libgo/MERGE
index ac842716022..4286d5c5433 100644
--- a/libgo/MERGE
+++ b/libgo/MERGE
@@ -1,4 +1,4 @@
-7677616a263e8ded606cc8297cb67ddc667a876e
+72ab3ff68b1ec894fe5599ec82b8849f3baa9d94
 
 The first line of this file holds the git revision number of the
 last merge done from the master library sources.
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index dec98756673..92fedcf6eb8 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -366,6 +366,7 @@ toolexeclibgoregexp_DATA = \
 toolexeclibgoruntimedir = $(toolexeclibgodir)/runtime
 
 toolexeclibgoruntime_DATA = \
+   runtime/cgo.gox \
runtime/debug.gox \
runtime/metrics.gox \
runtime/pprof.gox \
@@ -428,7 +429,9 @@ noinst_DATA = \
internal/testenv.gox \
internal/trace.gox \
net/internal/socktest.gox \
-   os/signal/internal/pty.gox
+   os/signal/internal/pty.gox \
+   reflect/internal/example1.gox \
+   reflect/internal/example2.gox
 
 if LIBGO_IS_RTEMS
 rtems_task_variable_add_file = runtime/rtems-task-variable-add.c
@@ -480,14 +483,10 @@ version.go: s-version; @true
 s-version: Makefile
rm -f version.go.tmp
echo "package sys" > version.go.tmp
-   echo 'func init() { DefaultGoroot = "$(prefix)" }' >> version.go.tmp
-   echo 'const TheVersion = "'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) 
--version | sed 1q`'"' >> version.go.tmp
-   echo 'const Goexperiment = ``' >> version.go.tmp
echo 'const GOARCH = "'$(GOARCH)'"' >> version.go.tmp
echo 'const GOOS = "'$(GOOS)'"' >> version.go.tmp
echo 'const GccgoToolDir = "$(libexecsubdir)"' >> version.go.tmp
-   echo >> version.go.tmp
-   echo "type ArchFamilyType int" >> version.go.tmp
+   echo 'const StackGuardMultiplierDefault = 1' >> version.go.tmp
echo >> version.go.tmp
echo "const (" >> version.go.tmp
echo "  UNKNOWN ArchFamilyType = iota" >> version.go.tmp
@@ -507,13 +506,13 @@ s-version: Makefile
done
echo >> version.go.tmp
echo "const (" >> version.go.tmp
-   echo "  ArchFamily = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) family`" 
>> version.go.tmp
-   echo "  BigEndian = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) bigendian`" 
>> version.go.tmp
-   echo "  CacheLineSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) 
cachelinesize`" >> version.go.tmp
-   echo "  DefaultPhysPageSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) 
defaultphyspagesize`" >> version.go.tmp
-   echo "  Int64Align = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) 
int64align`" >> version.go.tmp
-   echo "  MinFrameSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) 
minframesize`" >> version.go.tmp
-   echo "  PCQuantum = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) pcquantum`" 
>> version.go.tmp
+   echo "  _ArchFamily = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) family`" 
>> version.go.tmp
+   echo "  _BigEndian = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) 
bigendian`" >> version.go.tmp
+   echo "  _DefaultPhysPageSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) 
defaultphyspagesize`" >> version.go.tmp
+   echo "  _Int64Align = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) 
int64align`" >> version.go.tmp
+   echo "  _MinFrameSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) 
minframesize`" >> version.go.tmp
+   echo "  _PCQuantum = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) 
pcquantum`" >> version.go.tmp
+   echo "  _StackAlign = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) 
stackalign`" >> version.go.tmp
echo ")" >> version.go.tmp
echo >> version.go.tmp
for a in $(ALLGOOS); do \
@@ -526,7 +525,6 @@ s-version: Makefile
  fi; \
done
echo >> version.go.tmp
-   echo "type Uintreg uintptr" >> version.go.tmp
$(SHELL) $(srcdir)/mvifdiff.sh version.go.tmp version.go
$(STAMP) $@
 
@@ -547,24 +545,31 @@ s-gcpu: Makefile
$(SHELL) $(srcdir)/mvifdiff.sh gcpugen.go.tmp gcpugen.go
$(STAMP) $@
 
+buildcfg.go: s-buildcfg; @true
+s-buildcfg: Makefile
+   rm -f buildcfg.go.tmp
+   echo "package buildcfg" > buildcfg.go.tmp
+   echo "import \"runtime\"" >> buildcfg.go.tmp
+   echo 'func