{
        int p[2], pid, i, j, n, off, npad, prefix;
        char **av, *q, *r, *tofree, *name;
+       char nambuf[100];
        Biobuf *bin, *bout;
        Type *t;
        Field *f;
                                name = f->name;
                                if(cutprefix(name))
                                        name += prefix;
+                               if(strcmp(name, "") == 0) {
+                                       snprint(nambuf, sizeof nambuf, "Pad%d", npad++);
+                                       name = nambuf;
+                               }
                                Bprint(bout, "\t%lT;\n", name, f->type);
                                if(t->kind == Union && lang == &go)
                                        break;
 {
        char *p;
 
+       // special case: orig_ in register struct
+       if(strncmp(name, "orig_", 5) == 0)
+               return 0;
+
        for(p=name; *p; p++) {
                if(*p == '_')
                        return p-name > 0;
 
 
 OFILES=\
        asm_$(GOOS)_$(GOARCH).$O\
-       types_$(GOOS)_$(GOARCH).$O\
 
 include $(GOROOT)/src/Make.pkg
 
 # there is almost always a #define that can get the real ones.
 # See types_darwin.c and types_linux.c for examples.
 #
-# * types_${GOOS}_${GOARCH}.c
-#
-# Same as types_${GOOS}_${GOARCH}.go except that it contains
-# definitions specific to ${GOOS} one one particular architecture.
-#
 # * zerror_${GOOS}_${GOARCH}.go
 #
 # This machine-generated file defines the system's error numbers,
 echo "$mkerrors >zerrors_$GOOSARCH.go"
 echo "$mksyscall syscall_$GOOS.go syscall_$GOOSARCH.go >zsyscall_$GOOSARCH.go"
 echo "$mksysnum >zsysnum_$GOOSARCH.go"
-echo "$mktypes types_$GOOS.c types_$GOOSARCH.c >ztypes_$GOOSARCH.go"
-
-port=$(ls *.go | grep -v _)
-arch=$(ls *_$GOOSARCH.s *_$GOOSARCH.go *_$GOOS.go)
-all=$(ls $port $arch)  # sort them
-echo gobuild $all
+echo "$mktypes types_$GOOS.c >ztypes_$GOOSARCH.go"
 
 
 # Run C program to print error strings.
 (
-       echo "
+       /bin/echo "
 #include <stdio.h>
 #include <errno.h>
 #include <ctype.h>
 "
        for i in $errors
        do
-               echo '  '$i,
+               /bin/echo '     '$i,
        done
 
-       echo '
+       # Use /bin/echo to avoid builtin echo,
+       # which interprets \n itself
+       /bin/echo '
 };
 
 int
 '
 ) >_errors.c
 
-gcc -o _errors _errors.c && ./_errors
-rm -f _errors.c _errors
+gcc -o _errors _errors.c && ./_errors && rm -f _errors.c _errors
 
 
 package syscall
 
-import (
-       "syscall";
-       "unsafe";
-)
+import "unsafe"
 
 $text
 
 
 // license that can be found in the LICENSE file.
 
 /*
-Input to godefs.  See PORT.
+Input to godefs.  See PORT.sh
  */
 
 #define __DARWIN_UNIX03 0
 
+++ /dev/null
-// Nothing to see here.
 
+++ /dev/null
-// Nothing to see here.
 
 // license that can be found in the LICENSE file.
 
 /*
-Input to godefs.  See PORT.
+Input to godefs.  See PORT.sh
  */
 
 #define _LARGEFILE_SOURCE
 
+++ /dev/null
-// Nothing to see here
 
+++ /dev/null
-// Nothing to see here
 
-// godefs -gsyscall -f-m32 types_darwin.c types_darwin_386.c
+// godefs -gsyscall -f-m32 types_darwin.c
 
 // MACHINE GENERATED - DO NOT EDIT.
 
 
-// godefs -gsyscall -f-m64 types_darwin.c types_darwin_amd64.c
+// godefs -gsyscall -f-m64 types_darwin.c
 
 // MACHINE GENERATED - DO NOT EDIT.
 
 
-// godefs -gsyscall -f-m32 types_linux.c types_linux_386.c
+// godefs -gsyscall -f-m32 types_linux.c
 
 // MACHINE GENERATED - DO NOT EDIT.
 
        Calcnt int32;
        Errcnt int32;
        Stbcnt int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
+       Pad0 int32;
+       Pad1 int32;
+       Pad2 int32;
+       Pad3 int32;
+       Pad4 int32;
+       Pad5 int32;
+       Pad6 int32;
+       Pad7 int32;
+       Pad8 int32;
+       Pad9 int32;
+       Pad10 int32;
+       Pad11 int32;
 }
 
 type Time_t int32
        __fs uint16;
        Gs uint16;
        __gs uint16;
-       Eax int32;
+       Orig_eax int32;
        Eip int32;
        Cs uint16;
        __cs uint16;
 
-// godefs -gsyscall -f-m64 types_linux.c types_linux_amd64.c
+// godefs -gsyscall -f-m64 types_linux.c
 
 // MACHINE GENERATED - DO NOT EDIT.
 
        Calcnt int64;
        Errcnt int64;
        Stbcnt int64;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
-        int32;
+       Pad3 int32;
+       Pad4 int32;
+       Pad5 int32;
+       Pad6 int32;
+       Pad7 int32;
+       Pad8 int32;
+       Pad9 int32;
+       Pad10 int32;
+       Pad11 int32;
+       Pad12 int32;
+       Pad13 int32;
+       Pad14 int32;
 }
 
 type Time_t int64