libgo: eliminate a lot of duplication in Makefile.am
authorIan Lance Taylor <ian@gcc.gnu.org>
Sun, 30 Oct 2016 16:45:34 +0000 (16:45 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sun, 30 Oct 2016 16:45:34 +0000 (16:45 +0000)
    I read through the GNU make manual.  I knew there had to be a way to do it.

    Remove the special netgo library.  The essential feature--using the Go
    DNS resolver--is now available by setting GODEBUG=netdns=go.

    Reviewed-on: https://go-review.googlesource.com/32333

From-SVN: r241687

gcc/go/gofrontend/MERGE
libgo/Makefile.am
libgo/Makefile.in
libgo/runtime/runtime.c [deleted file]
libgo/runtime/runtime_c.c [new file with mode: 0644]

index 4d047056cbb6105b557cdb600b8e6e9a948eccef..f1520e4090a03a410cf50044ba7603f9f52a56db 100644 (file)
@@ -1,4 +1,4 @@
-fe38baff61b9b9426a4f60ff078cf3c8722bf94d
+4ca21c94f00c620bfde2f924e214c78fe2e1ff69
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 8237bb6af4d3f9c58d5855fea22083dea718f0fb..d9f84a009b325e455c8a36b6baacc2dae5d5d17b 100644 (file)
@@ -105,7 +105,7 @@ toolexeclib_LTLIBRARIES = libgo-llgo.la
 toolexeclib_LIBRARIES = libgobegin-llgo.a
 else
 toolexeclib_LTLIBRARIES = libgo.la
-toolexeclib_LIBRARIES = libgobegin.a libgolibbegin.a libnetgo.a
+toolexeclib_LIBRARIES = libgobegin.a libgolibbegin.a
 endif
 
 toolexeclibgo_DATA = \
@@ -479,7 +479,7 @@ runtime_files = \
        runtime/parfor.c \
        runtime/print.c \
        runtime/proc.c \
-       runtime/runtime.c \
+       runtime/runtime_c.c \
        runtime/signal_unix.c \
        runtime/thread.c \
        $(runtime_thread_files) \
@@ -572,6 +572,16 @@ s-runtime_sysinfo: $(srcdir)/mkrsysinfo.sh gen-sysinfo.go
        $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime_sysinfo.go runtime_sysinfo.go
        $(STAMP) $@
 
+runtime.inc: s-runtime-inc; @true
+s-runtime-inc: runtime.lo Makefile
+       rm -f runtime.inc.tmp2
+       grep -v "#define _" runtime.inc.tmp | grep -v "#define c0 " | grep -v "#define c1 " > runtime.inc.tmp2
+       for pattern in '_G[a-z]' '_P[a-z]' _Max _Lock _Sig _Trace _MHeap _Num; do \
+         grep "#define $$pattern" runtime.inc.tmp >> runtime.inc.tmp2; \
+       done
+       $(SHELL) $(srcdir)/mvifdiff.sh runtime.inc.tmp2 runtime.inc
+       $(STAMP) $@
+
 noinst_DATA = zstdpkglist.go
 
 # Generate the list of go std packages that were included in libgo
@@ -581,7 +591,7 @@ s-zstdpkglist: Makefile
        echo 'package main' > zstdpkglist.go.tmp
        echo "" >> zstdpkglist.go.tmp
        echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp
-       echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's/\.lo /\": true,\n/g' | sed 's/\.lo/\": true,/' | sed 's/-go//' | grep -v _c | sed 's/^/\t\"/' | sort | uniq >> zstdpkglist.go.tmp
+       echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's/\.lo /\": true,\n/g' | sed 's/\.lo/\": true,/' | grep -v _c | sed 's/^/\t\"/' | sort | uniq >> zstdpkglist.go.tmp
        echo '}' >> zstdpkglist.go.tmp
        $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go
        $(STAMP) $@
@@ -592,12 +602,6 @@ else
 syscall_epoll_file =
 endif
 
-extra_go_files_syscall = \
-       libcalls.go \
-       sysinfo.go \
-       syscall_arch.go \
-       $(syscall_epoll_file)
-
 libcalls.go: s-libcalls; @true
 s-libcalls: libcalls-list go/syscall/mksyscall.awk $(srcdir)/go/syscall/*.go
        rm -f libcalls.go.tmp
@@ -678,175 +682,178 @@ else
 syscall_lib_clone_lo =
 endif
 
+PACKAGES = \
+       archive/tar \
+       archive/zip \
+       bufio \
+       bytes \
+       compress/bzip2 \
+       compress/flate \
+       compress/gzip \
+       compress/lzw \
+       compress/zlib \
+       container/heap \
+       container/list \
+       container/ring \
+       context \
+       crypto \
+       crypto/aes \
+       crypto/cipher \
+       crypto/des \
+       crypto/dsa \
+       crypto/ecdsa \
+       crypto/elliptic \
+       crypto/hmac \
+       crypto/md5 \
+       crypto/rand \
+       crypto/rc4 \
+       crypto/rsa \
+       crypto/sha1 \
+       crypto/sha256 \
+       crypto/sha512 \
+       crypto/subtle \
+       crypto/tls \
+       crypto/x509 \
+       crypto/x509/pkix \
+       database/sql \
+       database/sql/driver \
+       debug/dwarf \
+       debug/elf \
+       debug/gosym \
+       debug/macho \
+       debug/pe \
+       debug/plan9obj \
+       encoding \
+       encoding/ascii85 \
+       encoding/asn1 \
+       encoding/base32 \
+       encoding/base64 \
+       encoding/binary \
+       encoding/csv \
+       encoding/gob \
+       encoding/hex \
+       encoding/json \
+       encoding/pem \
+       encoding/xml \
+       errors \
+       exp/proxy \
+       exp/terminal \
+       expvar \
+       flag \
+       fmt \
+       go/ast \
+       go/build \
+       go/constant \
+       go/doc \
+       go/format \
+       go/importer \
+       go/internal/gccgoimporter \
+       go/internal/gcimporter \
+       go/parser \
+       go/printer \
+       go/scanner \
+       go/token \
+       go/types \
+       golang_org/x/net/http2/hpack \
+       golang_org/x/net/lex/httplex \
+       hash \
+       hash/adler32 \
+       hash/crc32 \
+       hash/crc64 \
+       hash/fnv \
+       html \
+       html/template \
+       image \
+       image/color \
+       image/color/palette \
+       image/draw \
+       image/gif \
+       image/internal/imageutil \
+       image/jpeg \
+       image/png \
+       index/suffixarray \
+       internal/nettrace \
+       internal/race \
+       internal/singleflight \
+       internal/syscall/unix \
+       internal/testenv \
+       internal/trace \
+       io \
+       io/ioutil \
+       log \
+       log/syslog \
+       math \
+       math/big \
+       math/cmplx \
+       math/rand \
+       mime \
+       mime/multipart \
+       mime/quotedprintable \
+       net \
+       net/http \
+       net/http/cgi \
+       net/http/cookiejar \
+       net/http/fcgi \
+       net/http/httptest \
+       net/http/httptrace \
+       net/http/httputil \
+       net/http/internal \
+       net/http/pprof \
+       net/internal/socktest \
+       net/mail \
+       net/rpc \
+       net/rpc/jsonrpc \
+       net/smtp \
+       net/textproto \
+       net/url \
+       old/regexp \
+       old/template \
+       os \
+       os/exec \
+       os/signal \
+       os/user \
+       path \
+       path/filepath \
+       reflect \
+       regexp \
+       regexp/syntax \
+       runtime \
+       runtime/debug \
+       runtime/internal/atomic \
+       runtime/internal/sys \
+       runtime/pprof \
+       sort \
+       strconv \
+       strings \
+       sync \
+       sync/atomic \
+       syscall \
+       testing \
+       testing/iotest \
+       testing/quick \
+       text/scanner \
+       text/tabwriter \
+       text/template \
+       text/template/parse \
+       time \
+       unicode \
+       unicode/utf16 \
+       unicode/utf8
+
 libgo_go_objs = \
-       bufio.lo \
-       bytes.lo \
+       $(addsuffix .lo,$(PACKAGES)) \
        bytes/index.lo \
-       context.lo \
-       crypto.lo \
-       encoding.lo \
-       errors.lo \
-       expvar.lo \
-       flag.lo \
-       fmt.lo \
-       hash.lo \
-       html.lo \
-       image.lo \
-       io.lo \
-       log.lo \
-       math.lo \
-       mime.lo \
-       net.lo \
-       os.lo \
-       path.lo \
-       reflect-go.lo \
        reflect/makefunc_ffi_c.lo \
-       regexp.lo \
-       runtime-go.lo \
-       sort.lo \
-       strconv.lo \
-       strings.lo \
        strings/index.lo \
-       sync.lo \
-       syscall.lo \
        $(syscall_lib_clone_lo) \
        syscall/errno.lo \
        syscall/signame.lo \
        syscall/wait.lo \
-       testing.lo \
-       time-go.lo \
-       unicode.lo \
-       archive/tar.lo \
-       archive/zip.lo \
-       compress/bzip2.lo \
-       compress/flate.lo \
-       compress/gzip.lo \
-       compress/lzw.lo \
-       compress/zlib.lo \
-       container/heap.lo \
-       container/list.lo \
-       container/ring.lo \
-       crypto/aes.lo \
-       crypto/cipher.lo \
-       crypto/des.lo \
-       crypto/dsa.lo \
-       crypto/ecdsa.lo \
-       crypto/elliptic.lo \
-       crypto/hmac.lo \
-       crypto/md5.lo \
-       crypto/rand.lo \
-       crypto/rc4.lo \
-       crypto/rsa.lo \
-       crypto/sha1.lo \
-       crypto/sha256.lo \
-       crypto/sha512.lo \
-       crypto/subtle.lo \
-       crypto/tls.lo \
-       crypto/x509.lo \
-       crypto/x509/pkix.lo \
-       database/sql.lo \
-       database/sql/driver.lo \
-       debug/dwarf.lo \
-       debug/elf.lo \
-       debug/gosym.lo \
-       debug/macho.lo \
-       debug/pe.lo \
-       debug/plan9obj.lo \
-       encoding/ascii85.lo \
-       encoding/asn1.lo \
-       encoding/base32.lo \
-       encoding/base64.lo \
-       encoding/binary.lo \
-       encoding/csv.lo \
-       encoding/gob.lo \
-       encoding/hex.lo \
-       encoding/json.lo \
-       encoding/pem.lo \
-       encoding/xml.lo \
-       exp/proxy.lo \
-       exp/terminal.lo \
-       html/template.lo \
-       go/ast.lo \
-       go/build.lo \
-       go/constant.lo \
-       go/doc.lo \
-       go/format.lo \
-       go/importer.lo \
-       go/internal/gcimporter.lo \
-       go/internal/gccgoimporter.lo \
-       go/parser.lo \
-       go/printer.lo \
-       go/scanner.lo \
-       go/token.lo \
-       go/types.lo \
-       golang_org/x/net/http2/hpack.lo \
-       golang_org/x/net/lex/httplex.lo \
        $(golang_org_x_net_route_lo) \
-       hash/adler32.lo \
-       hash/crc32.lo \
-       hash/crc64.lo \
-       hash/fnv.lo \
-       net/http/cgi.lo \
-       net/http/cookiejar.lo \
-       net/http/fcgi.lo \
-       net/http/httptest.lo \
-       net/http/httptrace.lo \
-       net/http/httputil.lo \
-       net/http/internal.lo \
-       net/http/pprof.lo \
-       image/color.lo \
-       image/color/palette.lo \
-       image/draw.lo \
-       image/gif.lo \
-       image/internal/imageutil.lo \
-       image/jpeg.lo \
-       image/png.lo \
-       index/suffixarray.lo \
-       internal/nettrace.lo \
-       internal/race.lo \
-       internal/singleflight.lo \
-       internal/syscall/unix.lo \
-       internal/testenv.lo \
-       internal/trace.lo \
-       io/ioutil.lo \
-       log/syslog.lo \
        log/syslog/syslog_c.lo \
-       math/big.lo \
-       math/cmplx.lo \
-       math/rand.lo \
-       mime/multipart.lo \
-       mime/quotedprintable.lo \
-       net/http.lo \
-       net/internal/socktest.lo \
-       net/mail.lo \
-       net/rpc.lo \
-       net/smtp.lo \
-       net/textproto.lo \
-       net/url.lo \
-       old/regexp.lo \
-       old/template.lo \
-       os/exec.lo \
        $(os_lib_inotify_lo) \
-       os/signal.lo \
-       os/user.lo \
-       path/filepath.lo \
-       regexp/syntax.lo \
-       net/rpc/jsonrpc.lo \
-       runtime/debug.lo \
-       runtime/pprof.lo \
-       runtime/internal/atomic.lo \
        runtime/internal/atomic_c.lo \
-       runtime/internal/sys.lo \
-       sync/atomic.lo \
-       sync/atomic_c.lo \
-       text/scanner.lo \
-       text/tabwriter.lo \
-       text/template.lo \
-       text/template/parse.lo \
-       testing/iotest.lo \
-       testing/quick.lo \
-       unicode/utf16.lo \
-       unicode/utf8.lo
+       sync/atomic_c.lo
 
 libgo_ldflags = \
        -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
@@ -878,9 +885,6 @@ libgolibbegin_a_SOURCES = \
 
 libgolibbegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
 
-libnetgo_a_SOURCES =
-libnetgo_a_LIBADD = netgo.o
-
 # Make sure runtime.inc is built before compiling any .c file.
 $(libgo_la_OBJECTS): runtime.inc
 $(libgo_llgo_la_OBJECTS): runtime.inc
@@ -903,8 +907,8 @@ GOLINK = $(LIBTOOL) --tag GO --mode-link $(GOC) \
 # Build the dependencies for a Go package.
 BUILDDEPS = \
        $(MKDIR_P) $(@D); \
-       dir=`echo $@ | sed -e 's/.lo.dep$$//' -e 's/-go//'`; \
-       files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$$dir --extrafiles="$(extra_go_files_$(subst /,_,$(subst -go,,$(subst .lo.dep,,$@))))" $(matchargs_$(subst /,_,$(subst -go,,$(subst .lo.dep,,$@))))`; \
+       dir=`echo $@ | sed -e 's/.lo.dep$$//'`; \
+       files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$$dir --extrafiles="$(extra_go_files_$(subst /,_,$(subst .lo.dep,,$@)))" $(matchargs_$(subst /,_,$(subst .lo.dep,,$@)))`; \
        $(SHELL) $(srcdir)/godeps.sh `echo $@ | sed -e 's/.dep$$//'` $$files > $@.tmp; \
        if ! cmp $@.tmp $@ >/dev/null 2>/dev/null; then \
          rm -f `echo $@ | sed -e 's/\.dep$$//'`; \
@@ -915,20 +919,12 @@ BUILDDEPS = \
 BUILDPACKAGE = \
        $(MKDIR_P) $(@D); \
        files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \
-       $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//' -e 's/-go$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
+       $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
 
-# Build deps for netgo.o.
-BUILDNETGODEPS = \
-       $(MKDIR_P) $(@D); \
-       files=`$(SHELL) $(srcdir)/match.sh --nocgo --tag=netgo --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/net`; \
-       $(SHELL) $(srcdir)/godeps.sh netgo.o $$files > $@.tmp; \
-       mv -f $@.tmp $@
-
-# Build netgo.o.
-BUILDNETGO = \
-       $(MKDIR_P) $(@D); \
-       files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \
-       $(GOCOMPILE) -I . -c -fPIC -fgo-pkgpath=net -o $@ $$files
+# How to build a .gox file from a .lo file.
+BUILDGOX = \
+       f=`echo $< | sed -e 's/.lo$$/.o/'`; \
+       $(OBJCOPY) -j .go_export $$f $@.tmp && mv -f $@.tmp $@
 
 GOTESTFLAGS =
 GOBENCH = 
@@ -1003,1856 +999,137 @@ else
 CHECK_DEPS += libgo.la libgobegin.a
 endif
 
-@go_include@ bufio.lo.dep
-bufio.lo.dep: $(srcdir)/go/bufio/*.go
-       $(BUILDDEPS)
-bufio.lo:
-       $(BUILDPACKAGE)
-bufio/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: bufio/check
-
-@go_include@ bytes.lo.dep
-bytes.lo.dep: $(srcdir)/go/bytes/*.go
-       $(BUILDDEPS)
-bytes.lo:
-       $(BUILDPACKAGE)
-bytes/index.lo: go/bytes/indexbyte.c runtime.inc
-       @$(MKDIR_P) bytes
-       $(LTCOMPILE) -c -o bytes/index.lo $(srcdir)/go/bytes/indexbyte.c
-bytes/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: bytes/check
-
-@go_include@ context.lo.dep
-context.lo.dep: $(srcdir)/go/context/*.go
-       $(BUILDDEPS)
-context.lo:
-       $(BUILDPACKAGE)
-context/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: context/check
-
-@go_include@ crypto.lo.dep
-crypto.lo.dep: $(srcdir)/go/crypto/*.go
-       $(BUILDDEPS)
-crypto.lo:
-       $(BUILDPACKAGE)
-crypto/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/check
-
-@go_include@ encoding.lo.dep
-encoding.lo.dep: $(srcdir)/go/encoding/*.go
-       $(BUILDDEPS)
-encoding.lo:
-       $(BUILDPACKAGE)
-encoding/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/check
-
-@go_include@ errors.lo.dep
-errors.lo.dep: $(srcdir)/go/errors/*.go
-       $(BUILDDEPS)
-errors.lo:
-       $(BUILDPACKAGE)
-errors/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: errors/check
-
-@go_include@ expvar.lo.dep
-expvar.lo.dep: $(srcdir)/go/expvar/*.go
-       $(BUILDDEPS)
-expvar.lo:
-       $(BUILDPACKAGE)
-expvar/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: expvar/check
-
-@go_include@ flag.lo.dep
-flag.lo.dep: $(srcdir)/go/flag/*.go
-       $(BUILDDEPS)
-flag.lo:
-       $(BUILDPACKAGE)
-flag/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: flag/check
-
-@go_include@ fmt.lo.dep
-fmt.lo.dep: $(srcdir)/go/fmt/*.go
-       $(BUILDDEPS)
-fmt.lo:
-       $(BUILDPACKAGE)
-fmt/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: fmt/check
-
-@go_include@ hash.lo.dep
-hash.lo.dep: $(srcdir)/go/hash/*.go
-       $(BUILDDEPS)
-hash.lo:
-       $(BUILDPACKAGE)
-hash/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: hash/check
-
-@go_include@ html.lo.dep
-html.lo.dep: $(srcdir)/go/html/*.go
-       $(BUILDDEPS)
-html.lo:
-       $(BUILDPACKAGE)
-html/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: html/check
-
-@go_include@ image.lo.dep
-image.lo.dep: $(srcdir)/go/image/*.go
-       $(BUILDDEPS)
-image.lo:
-       $(BUILDPACKAGE)
-image/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/check
-
-@go_include@ io.lo.dep
-io.lo.dep: $(srcdir)/go/io/*.go
-       $(BUILDDEPS)
-io.lo:
-       $(BUILDPACKAGE)
-io/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: io/check
-
-@go_include@ log.lo.dep
-log.lo.dep: $(srcdir)/go/log/*.go
-       $(BUILDDEPS)
-log.lo:
-       $(BUILDPACKAGE)
-log/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: log/check
-
-@go_include@ math.lo.dep
-math.lo.dep: $(srcdir)/go/math/*.go
-       $(BUILDDEPS)
-math.lo:
-       $(MKDIR_P) $(@D)
-       files=`echo $^ | sed -e 's/[^ ]*\.gox//g'`; \
-       $(LTGOCOMPILE) $(MATH_FLAG) -I . -c -fgo-pkgpath=math -o $@ $$files
-math/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: math/check
-
-@go_include@ mime.lo.dep
-mime.lo.dep: $(srcdir)/go/mime/*.go
-       $(BUILDDEPS)
-mime.lo:
-       $(BUILDPACKAGE)
-mime/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: mime/check
-
-@go_include@ net.lo.dep
-net.lo.dep: $(srcdir)/go/net/*.go
-       $(BUILDDEPS)
-net.lo:
-       $(BUILDPACKAGE)
-net/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/check
-
-@go_include@ netgo.o.dep
-netgo.o.dep: $(srcdir)/go/net/*.go
-       $(BUILDNETGODEPS)
-netgo.o: netgo.o.dep
-       $(BUILDNETGO)
-
-if LIBGO_IS_SOLARIS
-if HAVE_STAT_TIMESPEC
-matchargs_os = --tag=solaristag
-else
-matchargs_os =
-endif
-else
-matchargs_os =
-endif
-
-@go_include@ os.lo.dep
-os.lo.dep: $(srcdir)/go/os/*.go
-       $(BUILDDEPS)
-os.lo:
-       $(BUILDPACKAGE)
-os/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: os/check
-
-@go_include@ path.lo.dep
-path.lo.dep: $(srcdir)/go/path/*.go
-       $(BUILDDEPS)
-path.lo:
-       $(BUILDPACKAGE)
-path/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: path/check
-
-@go_include@ reflect-go.lo.dep
-reflect-go.lo.dep: $(srcdir)/go/reflect/*.go
-       $(BUILDDEPS)
-reflect-go.lo:
-       $(BUILDPACKAGE)
-reflect/check: $(CHECK_DEPS)
-       @$(CHECK)
-reflect/makefunc_ffi_c.lo: go/reflect/makefunc_ffi_c.c runtime.inc
-       @$(MKDIR_P) reflect
-       $(LTCOMPILE) -c -o $@ $<
-.PHONY: reflect/check
-
-@go_include@ regexp.lo.dep
-regexp.lo.dep: $(srcdir)/go/regexp/*.go
-       $(BUILDDEPS)
-regexp.lo:
-       $(BUILDPACKAGE)
-regexp/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: regexp/check
-
+# PACKAGE_template defines the rules for each package.
+# For example, for the package bufio, it produces:
+#
+# @go_include@ bufio.lo.dep
+# bufio.lo.dep: $(srcdir)/go/bufio/*.go
+#      $(BUILDDEPS)
+# bufio.lo:
+#      $(BUILDPACKAGE)
+# bufio/check: $(CHECK_DEPS)
+#      @$(CHECK)
+# .PHONY: bufio/check
+#
+# This is invoked with $(1) set to a package, which is a directory name,
+# such as "bufio" or "archive/tar".
+define PACKAGE_template
+@go_include@ $(1).lo.dep
+$(1).lo.dep: $(srcdir)/go/$(1)/*.go
+       $$(BUILDDEPS)
+$(1).lo:
+       $$(BUILDPACKAGE)
+$(1)/check: $$(CHECK_DEPS)
+       @$$(CHECK)
+.PHONY: $(1)/check
+$(1).gox: $(1).lo
+       $$(BUILDGOX)
+endef
+
+# This line expands PACKAGE_template once for each package name listed
+# in $(PACKAGES).
+$(foreach package,$(PACKAGES),$(eval $(call PACKAGE_template,$(package))))
+
+# Pass -ffp-contract=off, or 386-specific options, when building the
+# math package.  MATH_FLAG is defined in configure.ac.
+math_lo_GOCFLAGS = $(MATH_FLAG)
+
+# Add the generated file runtime_sysinfo.go to the runtime package.
 extra_go_files_runtime = runtime_sysinfo.go
+runtime.lo.dep: $(extra_go_files_runtime)
 
-@go_include@ runtime-go.lo.dep
-runtime-go.lo.dep: $(srcdir)/go/runtime/*.go $(extra_go_files_runtime)
-       $(BUILDDEPS)
-runtime_go_lo_GOCFLAGS = -fgo-c-header=runtime.inc.tmp -fgo-compiling-runtime
-runtime-go.lo:
-       $(BUILDPACKAGE)
-runtime.inc: s-runtime-inc; @true
-s-runtime-inc: runtime-go.lo Makefile
-       rm -f runtime.inc.tmp2
-       grep -v "#define _" runtime.inc.tmp | grep -v "#define c0 " | grep -v "#define c1 " > runtime.inc.tmp2
-       for pattern in '_G[a-z]' '_P[a-z]' _Max _Lock _Sig _Trace _MHeap _Num; do \
-         grep "#define $$pattern" runtime.inc.tmp >> runtime.inc.tmp2; \
-       done
-       $(SHELL) $(srcdir)/mvifdiff.sh runtime.inc.tmp2 runtime.inc
-       $(STAMP) $@
+# Add generated files to the syscall package.
+extra_go_files_syscall = \
+       libcalls.go \
+       sysinfo.go \
+       syscall_arch.go \
+       $(syscall_epoll_file)
+syscall.lo.dep: $(extra_go_files_syscall)
+
+# Pass -fgo-compiling-runtime when compiling the runtime package.
+runtime_lo_GOCFLAGS = -fgo-c-header=runtime.inc.tmp -fgo-compiling-runtime
 runtime_check_GOCFLAGS = -fgo-compiling-runtime
-runtime/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: runtime/check
-
-@go_include@ sort.lo.dep
-sort.lo.dep: $(srcdir)/go/sort/*.go
-       $(BUILDDEPS)
-sort.lo:
-       $(BUILDPACKAGE)
-sort/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: sort/check
-
-@go_include@ strconv.lo.dep
-strconv.lo.dep: $(srcdir)/go/strconv/*.go
-       $(BUILDDEPS)
-strconv.lo:
-       $(BUILDPACKAGE)
-strconv/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: strconv/check
-
-@go_include@ strings.lo.dep
-strings.lo.dep: $(srcdir)/go/strings/*.go
-       $(BUILDDEPS)
-strings.lo:
-       $(BUILDPACKAGE)
-strings/index.lo: go/strings/indexbyte.c runtime.inc
-       @$(MKDIR_P) strings
-       $(LTCOMPILE) -c -o strings/index.lo $(srcdir)/go/strings/indexbyte.c
-strings/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: strings/check
-
-@go_include@ sync.lo.dep
-sync.lo.dep: $(srcdir)/go/sync/*.go
-       $(BUILDDEPS)
-sync.lo:
-       $(BUILDPACKAGE)
-sync/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: sync/check
-
-@go_include@ testing.lo.dep
-testing.lo.dep: $(srcdir)/go/testing/*.go
-       $(BUILDDEPS)
-testing.lo:
-       $(BUILDPACKAGE)
-testing/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: testing/check
-
-@go_include@ time-go.lo.dep
-time-go.lo.dep: $(srcdir)/go/time/*.go
-       $(BUILDDEPS)
-time-go.lo:
-       $(BUILDPACKAGE)
-time/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: time/check
-
-@go_include@ unicode.lo.dep
-unicode.lo.dep: $(srcdir)/go/unicode/*.go
-       $(BUILDDEPS)
-unicode.lo:
-       $(BUILDPACKAGE)
-unicode/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: unicode/check
-
-@go_include@ archive/tar.lo.dep
-archive/tar.lo.dep: $(srcdir)/go/archive/tar/*.go
-       $(BUILDDEPS)
-archive/tar.lo:
-       $(BUILDPACKAGE)
-archive/tar/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: archive/tar/check
-
-@go_include@ archive/zip.lo.dep
-archive/zip.lo.dep: $(srcdir)/go/archive/zip/*.go
-       $(BUILDDEPS)
-archive/zip.lo:
-       $(BUILDPACKAGE)
-archive/zip/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: archive/zip/check
-
-@go_include@ compress/bzip2.lo.dep
-compress/bzip2.lo.dep: $(srcdir)/go/compress/bzip2/*.go
-       $(BUILDDEPS)
-compress/bzip2.lo:
-       $(BUILDPACKAGE)
-compress/bzip2/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: compress/bzip2/check
-
-@go_include@ compress/flate.lo.dep
-compress/flate.lo.dep: $(srcdir)/go/compress/flate/*.go
-       $(BUILDDEPS)
-compress/flate.lo:
-       $(BUILDPACKAGE)
-compress/flate/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: compress/flate/check
-
-@go_include@ compress/gzip.lo.dep
-compress/gzip.lo.dep: $(srcdir)/go/compress/gzip/*.go
-       $(BUILDDEPS)
-compress/gzip.lo:
-       $(BUILDPACKAGE)
-compress/gzip/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: compress/gzip/check
-
-@go_include@ compress/lzw.lo.dep
-compress/lzw.lo.dep: $(srcdir)/go/compress/lzw/*.go
-       $(BUILDDEPS)
-compress/lzw.lo:
-       $(BUILDPACKAGE)
-compress/lzw/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: compress/lzw/check
-
-@go_include@ compress/zlib.lo.dep
-compress/zlib.lo.dep: $(srcdir)/go/compress/zlib/*.go
-       $(BUILDDEPS)
-compress/zlib.lo:
-       $(BUILDPACKAGE)
-compress/zlib/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: compress/zlib/check
-
-@go_include@ container/heap.lo.dep
-container/heap.lo.dep: $(srcdir)/go/container/heap/*.go
-       $(BUILDDEPS)
-container/heap.lo:
-       $(BUILDPACKAGE)
-container/heap/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: container/heap/check
-
-@go_include@ container/list.lo.dep
-container/list.lo.dep: $(srcdir)/go/container/list/*.go
-       $(BUILDDEPS)
-container/list.lo:
-       $(BUILDPACKAGE)
-container/list/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: container/list/check
-
-@go_include@ container/ring.lo.dep
-container/ring.lo.dep: $(srcdir)/go/container/ring/*.go
-       $(BUILDDEPS)
-container/ring.lo:
-       $(BUILDPACKAGE)
-container/ring/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: container/ring/check
-
-@go_include@ crypto/aes.lo.dep
-crypto/aes.lo.dep: $(srcdir)/go/crypto/aes/*.go
-       $(BUILDDEPS)
-crypto/aes.lo:
-       $(BUILDPACKAGE)
-crypto/aes/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/aes/check
-
-@go_include@ crypto/cipher.lo.dep
-crypto/cipher.lo.dep: $(srcdir)/go/crypto/cipher/*.go
-       $(BUILDDEPS)
-crypto/cipher.lo:
-       $(BUILDPACKAGE)
-crypto/cipher/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/cipher/check
-
-@go_include@ crypto/des.lo.dep
-crypto/des.lo.dep: $(srcdir)/go/crypto/des/*.go
-       $(BUILDDEPS)
-crypto/des.lo:
-       $(BUILDPACKAGE)
-crypto/des/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/des/check
-
-@go_include@ crypto/dsa.lo.dep
-crypto/dsa.lo.dep: $(srcdir)/go/crypto/dsa/*.go
-       $(BUILDDEPS)
-crypto/dsa.lo:
-       $(BUILDPACKAGE)
-crypto/dsa/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/dsa/check
-
-@go_include@ crypto/ecdsa.lo.dep
-crypto/ecdsa.lo.dep: $(srcdir)/go/crypto/ecdsa/*.go
-       $(BUILDDEPS)
-crypto/ecdsa.lo:
-       $(BUILDPACKAGE)
-crypto/ecdsa/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/ecdsa/check
-
-@go_include@ crypto/elliptic.lo.dep
-crypto/elliptic.lo.dep: $(srcdir)/go/crypto/elliptic/*.go
-       $(BUILDDEPS)
-crypto/elliptic.lo:
-       $(BUILDPACKAGE)
-crypto/elliptic/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/elliptic/check
-
-@go_include@ crypto/hmac.lo.dep
-crypto/hmac.lo.dep: $(srcdir)/go/crypto/hmac/*.go
-       $(BUILDDEPS)
-crypto/hmac.lo:
-       $(BUILDPACKAGE)
-crypto/hmac/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/hmac/check
-
-@go_include@ crypto/md5.lo.dep
-crypto/md5.lo.dep: $(srcdir)/go/crypto/md5/*.go
-       $(BUILDDEPS)
-crypto/md5.lo:
-       $(BUILDPACKAGE)
-crypto/md5/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/md5/check
-
-@go_include@ crypto/rand.lo.dep
-crypto/rand.lo.dep: $(srcdir)/go/crypto/rand/*.go
-       $(BUILDDEPS)
-crypto/rand.lo:
-       $(BUILDPACKAGE)
-crypto/rand/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/rand/check
-
-@go_include@ crypto/rc4.lo.dep
-crypto/rc4.lo.dep: $(srcdir)/go/crypto/rc4/*.go
-       $(BUILDDEPS)
-crypto/rc4.lo:
-       $(BUILDPACKAGE)
-crypto/rc4/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/rc4/check
-
-@go_include@ crypto/rsa.lo.dep
-crypto/rsa.lo.dep: $(srcdir)/go/crypto/rsa/*.go
-       $(BUILDDEPS)
-crypto/rsa.lo:
-       $(BUILDPACKAGE)
-crypto/rsa/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/rsa/check
-
-@go_include@ crypto/sha1.lo.dep
-crypto/sha1.lo.dep: $(srcdir)/go/crypto/sha1/*.go
-       $(BUILDDEPS)
-crypto/sha1.lo:
-       $(BUILDPACKAGE)
-crypto/sha1/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/sha1/check
-
-@go_include@ crypto/sha256.lo.dep
-crypto/sha256.lo.dep: $(srcdir)/go/crypto/sha256/*.go
-       $(BUILDDEPS)
-crypto/sha256.lo:
-       $(BUILDPACKAGE)
-crypto/sha256/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/sha256/check
-
-@go_include@ crypto/sha512.lo.dep
-crypto/sha512.lo.dep: $(srcdir)/go/crypto/sha512/*.go
-       $(BUILDDEPS)
-crypto/sha512.lo:
-       $(BUILDPACKAGE)
-crypto/sha512/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/sha512/check
-
-@go_include@ crypto/subtle.lo.dep
-crypto/subtle.lo.dep: $(srcdir)/go/crypto/subtle/*.go
-       $(BUILDDEPS)
-crypto/subtle.lo:
-       $(BUILDPACKAGE)
-crypto/subtle/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/subtle/check
-
-@go_include@ crypto/tls.lo.dep
-crypto/tls.lo.dep: $(srcdir)/go/crypto/tls/*.go
-       $(BUILDDEPS)
-crypto/tls.lo:
-       $(BUILDPACKAGE)
-crypto/tls/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/tls/check
-
-@go_include@ crypto/x509.lo.dep
-crypto/x509.lo.dep: $(srcdir)/go/crypto/x509/*.go
-       $(BUILDDEPS)
-crypto/x509.lo:
-       $(BUILDPACKAGE)
-crypto/x509/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/x509/check
-
-@go_include@ crypto/x509/pkix.lo.dep
-crypto/x509/pkix.lo.dep: $(srcdir)/go/crypto/x509/pkix/*.go
-       $(BUILDDEPS)
-crypto/x509/pkix.lo:
-       $(BUILDPACKAGE)
-crypto/x509/pkix/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/x509/pkix/check
-
-@go_include@ database/sql.lo.dep
-database/sql.lo.dep: $(srcdir)/go/database/sql/*.go
-       $(BUILDDEPS)
-database/sql.lo:
-       $(BUILDPACKAGE)
-database/sql/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: database/sql/check
-
-@go_include@ database/sql/driver.lo.dep
-database/sql/driver.lo.dep: $(srcdir)/go/database/sql/driver/*.go
-       $(BUILDDEPS)
-database/sql/driver.lo:
-       $(BUILDPACKAGE)
-database/sql/driver/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: database/sql/driver/check
-
-@go_include@ debug/dwarf.lo.dep
-debug/dwarf.lo.dep: $(srcdir)/go/debug/dwarf/*.go
-       $(BUILDDEPS)
-debug/dwarf.lo:
-       $(BUILDPACKAGE)
-debug/dwarf/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: debug/dwarf/check
-
-@go_include@ debug/elf.lo.dep
-debug/elf.lo.dep: $(srcdir)/go/debug/elf/*.go
-       $(BUILDDEPS)
-debug/elf.lo:
-       $(BUILDPACKAGE)
-debug/elf/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: debug/elf/check
-
-@go_include@ debug/gosym.lo.dep
-debug/gosym.lo.dep: $(srcdir)/go/debug/gosym/*.go
-       $(BUILDDEPS)
-debug/gosym.lo:
-       $(BUILDPACKAGE)
-debug/gosym/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: debug/gosym/check
-
-@go_include@ debug/macho.lo.dep
-debug/macho.lo.dep: $(srcdir)/go/debug/macho/*.go
-       $(BUILDDEPS)
-debug/macho.lo:
-       $(BUILDPACKAGE)
-debug/macho/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: debug/macho/check
-
-@go_include@ debug/pe.lo.dep
-debug/pe.lo.dep: $(srcdir)/go/debug/pe/*.go
-       $(BUILDDEPS)
-debug/pe.lo:
-       $(BUILDPACKAGE)
-debug/pe/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: debug/pe/check
-
-@go_include@ debug/plan9obj.lo.dep
-debug/plan9obj.lo.dep: $(srcdir)/go/debug/plan9obj/*.go
-       $(BUILDDEPS)
-debug/plan9obj.lo:
-       $(BUILDPACKAGE)
-debug/plan9obj/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: debug/plan9obj/check
-
-@go_include@ encoding/asn1.lo.dep
-encoding/asn1.lo.dep: $(srcdir)/go/encoding/asn1/*.go
-       $(BUILDDEPS)
-encoding/asn1.lo:
-       $(BUILDPACKAGE)
-encoding/asn1/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/asn1/check
-
-@go_include@ encoding/ascii85.lo.dep
-encoding/ascii85.lo.dep: $(srcdir)/go/encoding/ascii85/*.go
-       $(BUILDDEPS)
-encoding/ascii85.lo:
-       $(BUILDPACKAGE)
-encoding/ascii85/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/ascii85/check
-
-@go_include@ encoding/base32.lo.dep
-encoding/base32.lo.dep: $(srcdir)/go/encoding/base32/*.go
-       $(BUILDDEPS)
-encoding/base32.lo:
-       $(BUILDPACKAGE)
-encoding/base32/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/base32/check
-
-@go_include@ encoding/base64.lo.dep
-encoding/base64.lo.dep: $(srcdir)/go/encoding/base64/*.go
-       $(BUILDDEPS)
-encoding/base64.lo:
-       $(BUILDPACKAGE)
-encoding/base64/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/base64/check
-
-@go_include@ encoding/binary.lo.dep
-encoding/binary.lo.dep: $(srcdir)/go/encoding/binary/*.go
-       $(BUILDDEPS)
-encoding/binary.lo:
-       $(BUILDPACKAGE)
-encoding/binary/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/binary/check
-
-@go_include@ encoding/csv.lo.dep
-encoding/csv.lo.dep: $(srcdir)/go/encoding/csv/*.go
-       $(BUILDDEPS)
-encoding/csv.lo:
-       $(BUILDPACKAGE)
-encoding/csv/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/csv/check
-
-@go_include@ encoding/gob.lo.dep
-encoding/gob.lo.dep: $(srcdir)/go/encoding/gob/*.go
-       $(BUILDDEPS)
-encoding/gob.lo:
-       $(BUILDPACKAGE)
-encoding/gob/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/gob/check
-
-@go_include@ encoding/hex.lo.dep
-encoding/hex.lo.dep: $(srcdir)/go/encoding/hex/*.go
-       $(BUILDDEPS)
-encoding/hex.lo:
-       $(BUILDPACKAGE)
-encoding/hex/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/hex/check
-
-@go_include@ encoding/json.lo.dep
-encoding/json.lo.dep: $(srcdir)/go/encoding/json/*.go
-       $(BUILDDEPS)
-encoding/json.lo:
-       $(BUILDPACKAGE)
-encoding/json/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/json/check
-
-@go_include@ encoding/pem.lo.dep
-encoding/pem.lo.dep: $(srcdir)/go/encoding/pem/*.go
-       $(BUILDDEPS)
-encoding/pem.lo:
-       $(BUILDPACKAGE)
-encoding/pem/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/pem/check
-
-@go_include@ encoding/xml.lo.dep
-encoding/xml.lo.dep: $(srcdir)/go/encoding/xml/*.go
-       $(BUILDDEPS)
-encoding/xml.lo:
-       $(BUILDPACKAGE)
-encoding/xml/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/xml/check
-
-@go_include@ exp/proxy.lo.dep
-exp/proxy.lo.dep: $(srcdir)/go/exp/proxy/*.go
-       $(BUILDDEPS)
-exp/proxy.lo:
-       $(BUILDPACKAGE)
-exp/proxy/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: exp/proxy/check
-
-@go_include@ exp/terminal.lo.dep
-exp/terminal.lo.dep: $(srcdir)/go/exp/terminal/*.go
-       $(BUILDDEPS)
-exp/terminal.lo:
-       $(BUILDPACKAGE)
-exp/terminal/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: exp/terminal/check
-
-@go_include@ html/template.lo.dep
-html/template.lo.dep: $(srcdir)/go/html/template/*.go
-       $(BUILDDEPS)
-html/template.lo:
-       $(BUILDPACKAGE)
-html/template/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: html/template/check
-
-@go_include@ go/ast.lo.dep
-go/ast.lo.dep: $(srcdir)/go/go/ast/*.go
-       $(BUILDDEPS)
-go/ast.lo:
-       $(BUILDPACKAGE)
-go/ast/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/ast/check
-
-@go_include@ go/build.lo.dep
-go/build.lo.dep: $(srcdir)/go/go/build/*.go
-       $(BUILDDEPS)
-go/build.lo:
-       $(BUILDPACKAGE)
-go/build/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/build/check
-
-@go_include@ go/constant.lo.dep
-go/constant.lo.dep: $(srcdir)/go/go/constant/*.go
-       $(BUILDDEPS)
-go/constant.lo:
-       $(BUILDPACKAGE)
-go/constant/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/constant/check
-
-@go_include@ go/doc.lo.dep
-go/doc.lo.dep: $(srcdir)/go/go/doc/*.go
-       $(BUILDDEPS)
-go/doc.lo:
-       $(BUILDPACKAGE)
-go/doc/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/doc/check
-
-@go_include@ go/format.lo.dep
-go/format.lo.dep: $(srcdir)/go/go/format/*.go
-       $(BUILDDEPS)
-go/format.lo:
-       $(BUILDPACKAGE)
-go/format/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/format/check
-
-@go_include@ go/importer.lo.dep
-go/importer.lo.dep: $(srcdir)/go/go/importer/*.go
-       $(BUILDDEPS)
-go/importer.lo:
-       $(BUILDPACKAGE)
-go/importer/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/importer/check
-
-@go_include@ go/parser.lo.dep
-go/parser.lo.dep: $(srcdir)/go/go/parser/*.go
-       $(BUILDDEPS)
-go/parser.lo:
-       $(BUILDPACKAGE)
-go/parser/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/parser/check
-
-@go_include@ go/printer.lo.dep
-go/printer.lo.dep: $(srcdir)/go/go/printer/*.go
-       $(BUILDDEPS)
-go/printer.lo:
-       $(BUILDPACKAGE)
-go/printer/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/printer/check
-
-@go_include@ go/scanner.lo.dep
-go/scanner.lo.dep: $(srcdir)/go/go/scanner/*.go
-       $(BUILDDEPS)
-go/scanner.lo:
-       $(BUILDPACKAGE)
-go/scanner/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/scanner/check
-
-@go_include@ go/token.lo.dep
-go/token.lo.dep: $(srcdir)/go/go/token/*.go
-       $(BUILDDEPS)
-go/token.lo:
-       $(BUILDPACKAGE)
-go/token/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/token/check
-
-@go_include@ go/types.lo.dep
-go/types.lo.dep: $(srcdir)/go/go/types/*.go
-       $(BUILDDEPS)
-go/types.lo:
-       $(BUILDPACKAGE)
-go/types/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/types/check
-
-@go_include@ go/internal/gcimporter.lo.dep
-go/internal/gcimporter.lo.dep: $(srcdir)/go/go/internal/gcimporter/*.go
-       $(BUILDDEPS)
-go/internal/gcimporter.lo:
-       $(BUILDPACKAGE)
-go/internal/gcimporter/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/internal/gcimporter/check
-
-@go_include@ go/internal/gccgoimporter.lo.dep
-go/internal/gccgoimporter.lo.dep: $(srcdir)/go/go/internal/gccgoimporter/*.go
-       $(BUILDDEPS)
-go/internal/gccgoimporter.lo:
-       $(BUILDPACKAGE)
-go/internal/gccgoimporter/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/internal/gccgoimporter/check
-
-@go_include@ golang_org/x/net/http2/hpack.lo.dep
-golang_org/x/net/http2/hpack.lo.dep: $(srcdir)/go/golang_org/x/net/http2/hpack/*.go
-       $(BUILDDEPS)
-golang_org/x/net/http2/hpack.lo:
-       $(BUILDPACKAGE)
-golang_org/x/net/http2/hpack/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: golang_org/x/net/http2/hpack/check
-
-@go_include@ golang_org/x/net/lex/httplex.lo.dep
-golang_org/x/net/lex/httplex.lo.dep: $(srcdir)/go/golang_org/x/net/lex/httplex/*.go
-       $(BUILDDEPS)
-golang_org/x/net/lex/httplex.lo:
-       $(BUILDPACKAGE)
-golang_org/x/net/lex/httplex/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: golang_org/x/net/lex/httplex/check
+runtime_internal_atomic_lo_GOCFLAGS = -fgo-compiling-runtime
+runtime_internal_atomic_lo_check_GOCFLAGS = -fgo-compiling-runtime
+runtime_internal_sys_lo_GOCFLAGS = -fgo-compiling-runtime
+runtime_internal_sys_lo_check_GOCFLAGS = -fgo-compiling-runtime
 
-if LIBGO_IS_BSD
+# At least for now, we need -static-libgo for this test, because
+# otherwise we can't get the line numbers.
+# Also use -fno-inline to get better results from the memory profiler.
+runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline
 
-golang_org_x_net_route_lo = \
-       golang_org/x/net/route/route.lo
-golang_org_x_net_route_check = \
-       golang_org/x/net/route/check
+extra_go_files_runtime_internal_sys = version.go
+runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys)
 
-@go_include@ golang_org/x/net/route.lo.dep
-golang_org/x/net/route.lo.dep: $(srcdir)/go/golang_org/x/net/route/*.go
-       $(BUILDDEPS)
-golang_org/x/net/route.lo:
-       $(BUILDPACKAGE)
-golang_org/x/net/route/check: $(CHECK_DEPS)
-       @$(CHECK)
+# FIXME: The following C files may as well move to the runtime
+# directory and be treated like other C files.
 
-endif
+# Use C code to speed up {bytes,strings}.IndexByte and friends.
+bytes/index.lo: go/bytes/indexbyte.c runtime.inc
+       @$(MKDIR_P) bytes
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/bytes/indexbyte.c
+strings/index.lo: go/strings/indexbyte.c runtime.inc
+       @$(MKDIR_P) strings
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/strings/indexbyte.c
 
-.PHONY: golang_org/x/net/route/check
-
-@go_include@ hash/adler32.lo.dep
-hash/adler32.lo.dep: $(srcdir)/go/hash/adler32/*.go
-       $(BUILDDEPS)
-hash/adler32.lo:
-       $(BUILDPACKAGE)
-hash/adler32/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: hash/adler32/check
-
-@go_include@ hash/crc32.lo.dep
-hash/crc32.lo.dep: $(srcdir)/go/hash/crc32/*.go
-       $(BUILDDEPS)
-hash/crc32.lo:
-       $(BUILDPACKAGE)
-hash/crc32/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: hash/crc32/check
-
-@go_include@ hash/crc64.lo.dep
-hash/crc64.lo.dep: $(srcdir)/go/hash/crc64/*.go
-       $(BUILDDEPS)
-hash/crc64.lo:
-       $(BUILDPACKAGE)
-hash/crc64/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: hash/crc64/check
-
-@go_include@ hash/fnv.lo.dep
-hash/fnv.lo.dep: $(srcdir)/go/hash/fnv/*.go
-       $(BUILDDEPS)
-hash/fnv.lo:
-       $(BUILDPACKAGE)
-hash/fnv/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: hash/fnv/check
-
-@go_include@ image/color.lo.dep
-image/color.lo.dep: $(srcdir)/go/image/color/*.go
-       $(BUILDDEPS)
-image/color.lo:
-       $(BUILDPACKAGE)
-image/color/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/color/check
-
-@go_include@ image/color/palette.lo.dep
-image/color/palette.lo.dep: $(srcdir)/go/image/color/palette/*.go
-       $(BUILDDEPS)
-image/color/palette.lo:
-       $(BUILDPACKAGE)
-image/color/palette/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/color/palette/check
-
-@go_include@ image/draw.lo.dep
-image/draw.lo.dep: $(srcdir)/go/image/draw/*.go
-       $(BUILDDEPS)
-image/draw.lo:
-       $(BUILDPACKAGE)
-image/draw/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/draw/check
-
-@go_include@ image/gif.lo.dep
-image/gif.lo.dep: $(srcdir)/go/image/gif/*.go
-       $(BUILDDEPS)
-image/gif.lo:
-       $(BUILDPACKAGE)
-image/gif/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/gif/check
-
-@go_include@ image/internal/imageutil.lo.dep
-image/internal/imageutil.lo.dep: $(srcdir)/go/image/internal/imageutil/*.go
-       $(BUILDDEPS)
-image/internal/imageutil.lo:
-       $(BUILDPACKAGE)
-image/internal/imageutil/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/internal/imageutil/check
-
-@go_include@ image/jpeg.lo.dep
-image/jpeg.lo.dep: $(srcdir)/go/image/jpeg/*.go
-       $(BUILDDEPS)
-image/jpeg.lo:
-       $(BUILDPACKAGE)
-image/jpeg/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/jpeg/check
-
-@go_include@ image/png.lo.dep
-image/png.lo.dep: $(srcdir)/go/image/png/*.go
-       $(BUILDDEPS)
-image/png.lo:
-       $(BUILDPACKAGE)
-image/png/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/png/check
-
-@go_include@ index/suffixarray.lo.dep
-index/suffixarray.lo.dep: $(srcdir)/go/index/suffixarray/*.go
-       $(BUILDDEPS)
-index/suffixarray.lo:
-       $(BUILDPACKAGE)
-index/suffixarray/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: index/suffixarray/check
-
-@go_include@ internal/nettrace.lo.dep
-internal/nettrace.lo.dep: $(srcdir)/go/internal/nettrace/*.go
-       $(BUILDDEPS)
-internal/nettrace.lo:
-       $(BUILDPACKAGE)
-internal/nettrace/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: internal/nettrace/check
-
-@go_include@ internal/race.lo.dep
-internal/race.lo.dep: $(srcdir)/go/internal/race/*.go
-       $(BUILDDEPS)
-internal/race.lo:
-       $(BUILDPACKAGE)
-internal/race/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: internal/race/check
-
-@go_include@ internal/singleflight.lo.dep
-internal/singleflight.lo.dep: $(srcdir)/go/internal/singleflight/*.go
-       $(BUILDDEPS)
-internal/singleflight.lo:
-       $(BUILDPACKAGE)
-internal/singleflight/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: internal/singleflight/check
-
-@go_include@ internal/syscall/unix.lo.dep
-internal/syscall/unix.lo.dep: $(srcdir)/go/internal/syscall/unix/*.go
-       $(BUILDDEPS)
-internal/syscall/unix.lo:
-       $(BUILDPACKAGE)
-internal/syscall/unix/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: internal/syscall/unix/check
-
-@go_include@ internal/testenv.lo.dep
-internal/testenv.lo.dep: $(srcdir)/go/internal/testenv/*.go
-       $(BUILDDEPS)
-internal/testenv.lo:
-       $(BUILDPACKAGE)
-internal/testenv/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: internal/testenv/check
-
-@go_include@ internal/trace.lo.dep
-internal/trace.lo.dep: $(srcdir)/go/internal/trace/*.go
-       $(BUILDDEPS)
-internal/trace.lo:
-       $(BUILDPACKAGE)
-internal/trace/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: internal/trace/check
-
-@go_include@ io/ioutil.lo.dep
-io/ioutil.lo.dep: $(srcdir)/go/io/ioutil/*.go
-       $(BUILDDEPS)
-io/ioutil.lo:
-       $(BUILDPACKAGE)
-io/ioutil/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: io/ioutil/check
-
-@go_include@ log/syslog.lo.dep
-log/syslog.lo.dep: $(srcdir)/go/log/syslog/*.go
-       $(BUILDDEPS)
-log/syslog.lo:
-       $(BUILDPACKAGE)
-log/syslog/syslog_c.lo: go/log/syslog/syslog_c.c runtime.inc log/syslog.lo
+# Use a C function with a fixed number of arguments to call a C
+# varargs function.
+log/syslog/syslog_c.lo: go/log/syslog/syslog_c.c runtime.inc
        @$(MKDIR_P) log/syslog
        $(LTCOMPILE) -c -o $@ $(srcdir)/go/log/syslog/syslog_c.c
-log/syslog/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: log/syslog/check
-
-@go_include@ math/big.lo.dep
-math/big.lo.dep: $(srcdir)/go/math/big/*.go
-       $(BUILDDEPS)
-math/big.lo:
-       $(BUILDPACKAGE)
-math/big/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: math/big/check
-
-@go_include@ math/cmplx.lo.dep
-math/cmplx.lo.dep: $(srcdir)/go/math/cmplx/*.go
-       $(BUILDDEPS)
-math/cmplx.lo:
-       $(BUILDPACKAGE)
-math/cmplx/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: math/cmplx/check
-
-@go_include@ math/rand.lo.dep
-math/rand.lo.dep: $(srcdir)/go/math/rand/*.go
-       $(BUILDDEPS)
-math/rand.lo:
-       $(BUILDPACKAGE)
-math/rand/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: math/rand/check
-
-@go_include@ mime/multipart.lo.dep
-mime/multipart.lo.dep: $(srcdir)/go/mime/multipart/*.go
-       $(BUILDDEPS)
-mime/multipart.lo:
-       $(BUILDPACKAGE)
-mime/multipart/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: mime/multipart/check
-
-@go_include@ mime/quotedprintable.lo.dep
-mime/quotedprintable.lo.dep: $(srcdir)/go/mime/quotedprintable/*.go
-       $(BUILDDEPS)
-mime/quotedprintable.lo:
-       $(BUILDPACKAGE)
-mime/quotedprintable/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: mime/quotedprintable/check
-
-@go_include@ net/http.lo.dep
-net/http.lo.dep: $(srcdir)/go/net/http/*.go
-       $(BUILDDEPS)
-net/http.lo:
-       $(BUILDPACKAGE)
-net/http/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/http/check
-
-@go_include@ net/mail.lo.dep
-net/mail.lo.dep: $(srcdir)/go/net/mail/*.go
-       $(BUILDDEPS)
-net/mail.lo:
-       $(BUILDPACKAGE)
-net/mail/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/mail/check
-
-@go_include@ net/rpc.lo.dep
-net/rpc.lo.dep: $(srcdir)/go/net/rpc/*.go
-       $(BUILDDEPS)
-net/rpc.lo:
-       $(BUILDPACKAGE)
-net/rpc/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/rpc/check
-
-@go_include@ net/smtp.lo.dep
-net/smtp.lo.dep: $(srcdir)/go/net/smtp/*.go
-       $(BUILDDEPS)
-net/smtp.lo:
-       $(BUILDPACKAGE)
-net/smtp/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/smtp/check
-
-@go_include@ net/url.lo.dep
-net/url.lo.dep: $(srcdir)/go/net/url/*.go
-       $(BUILDDEPS)
-net/url.lo:
-       $(BUILDPACKAGE)
-net/url/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/url/check
-
-@go_include@ net/textproto.lo.dep
-net/textproto.lo.dep: $(srcdir)/go/net/textproto/*.go
-       $(BUILDDEPS)
-net/textproto.lo:
-       $(BUILDPACKAGE)
-net/textproto/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/textproto/check
-
-@go_include@ net/http/cgi.lo.dep
-net/http/cgi.lo.dep: $(srcdir)/go/net/http/cgi/*.go
-       $(BUILDDEPS)
-net/http/cgi.lo:
-       $(BUILDPACKAGE)
-net/http/cgi/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/http/cgi/check
-
-@go_include@ net/http/cookiejar.lo.dep
-net/http/cookiejar.lo.dep: $(srcdir)/go/net/http/cookiejar/*.go
-       $(BUILDDEPS)
-net/http/cookiejar.lo:
-       $(BUILDPACKAGE)
-net/http/cookiejar/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/http/cookiejar/check
-
-@go_include@ net/http/fcgi.lo.dep
-net/http/fcgi.lo.dep: $(srcdir)/go/net/http/fcgi/*.go
-       $(BUILDDEPS)
-net/http/fcgi.lo:
-       $(BUILDPACKAGE)
-net/http/fcgi/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/http/fcgi/check
-
-@go_include@ net/http/httptest.lo.dep
-net/http/httptest.lo.dep: $(srcdir)/go/net/http/httptest/*.go
-       $(BUILDDEPS)
-net/http/httptest.lo:
-       $(BUILDPACKAGE)
-net/http/httptest/check: $(check_deps)
-       @$(CHECK)
-.PHONY: net/http/httptest/check
-
-@go_include@ net/http/httptrace.lo.dep
-net/http/httptrace.lo.dep: $(srcdir)/go/net/http/httptrace/*.go
-       $(BUILDDEPS)
-net/http/httptrace.lo:
-       $(BUILDPACKAGE)
-net/http/httptrace/check: $(check_deps)
-       @$(CHECK)
-.PHONY: net/http/httptrace/check
-
-@go_include@ net/http/httputil.lo.dep
-net/http/httputil.lo.dep: $(srcdir)/go/net/http/httputil/*.go
-       $(BUILDDEPS)
-net/http/httputil.lo:
-       $(BUILDPACKAGE)
-net/http/httputil/check: $(check_deps)
-       @$(CHECK)
-.PHONY: net/http/httputil/check
-
-@go_include@ net/http/internal.lo.dep
-net/http/internal.lo.dep: $(srcdir)/go/net/http/internal/*.go
-       $(BUILDDEPS)
-net/http/internal.lo:
-       $(BUILDPACKAGE)
-net/http/internal/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/http/internal/check
-
-@go_include@ net/http/pprof.lo.dep
-net/http/pprof.lo.dep: $(srcdir)/go/net/http/pprof/*.go
-       $(BUILDDEPS)
-net/http/pprof.lo:
-       $(BUILDPACKAGE)
-net/http/pprof/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/http/pprof/check
-
-@go_include@ net/internal/socktest.lo.dep
-net/internal/socktest.lo.dep: $(srcdir)/go/net/internal/socktest/*.go
-       $(BUILDDEPS)
-net/internal/socktest.lo:
-       $(BUILDPACKAGE)
-net/internal/socktest/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/internal/socktest/check
-
-@go_include@ net/rpc/jsonrpc.lo.dep
-net/rpc/jsonrpc.lo.dep: $(srcdir)/go/net/rpc/jsonrpc/*.go
-       $(BUILDDEPS)
-net/rpc/jsonrpc.lo:
-       $(BUILDPACKAGE)
-net/rpc/jsonrpc/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/rpc/jsonrpc/check
-
-@go_include@ old/regexp.lo.dep
-old/regexp.lo.dep: $(srcdir)/go/old/regexp/*.go
-       $(BUILDDEPS)
-old/regexp.lo:
-       $(BUILDPACKAGE)
-old/regexp/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: old/regexp/check
-
-@go_include@ old/template.lo.dep
-old/template.lo.dep: $(srcdir)/go/old/template/*.go
-       $(BUILDDEPS)
-old/template.lo:
-       $(BUILDPACKAGE)
-old/template/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: old/template/check
-
-@go_include@ os/exec.lo.dep
-os/exec.lo.dep: $(srcdir)/go/os/exec/*.go
-       $(BUILDDEPS)
-os/exec.lo:
-       $(BUILDPACKAGE)
-os/exec/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: os/exec/check
-
-@go_include@ os/signal.lo.dep
-os/signal.lo.dep: $(srcdir)/go/os/signal/*.go
-       $(BUILDDEPS)
-os/signal.lo:
-       $(BUILDPACKAGE)
-os/signal/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: os/signal/check
-
-@go_include@ os/user.lo.dep
-os/user.lo.dep: $(srcdir)/go/os/user/*.go
-       $(BUILDDEPS)
-os/user.lo:
-       $(BUILDPACKAGE)
-os/user/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: os/user/check
-
-@go_include@ path/filepath.lo.dep
-path/filepath.lo.dep: $(srcdir)/go/path/filepath/*.go
-       $(BUILDDEPS)
-path/filepath.lo:
-       $(BUILDPACKAGE)
-path/filepath/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: path/filepath/check
-
-@go_include@ regexp/syntax.lo.dep
-regexp/syntax.lo.dep: $(srcdir)/go/regexp/syntax/*.go
-       $(BUILDDEPS)
-regexp/syntax.lo:
-       $(BUILDPACKAGE)
-regexp/syntax/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: regexp/syntax/check
-
-@go_include@ runtime/debug.lo.dep
-runtime/debug.lo.dep: $(srcdir)/go/runtime/debug/*.go
-       $(BUILDDEPS)
-runtime/debug.lo:
-       $(BUILDPACKAGE)
-runtime/debug/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: runtime/debug/check
-
-@go_include@ runtime/pprof.lo.dep
-runtime/pprof.lo.dep: $(srcdir)/go/runtime/pprof/*.go
-       $(BUILDDEPS)
-runtime/pprof.lo:
-       $(BUILDPACKAGE)
-runtime/pprof/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: runtime/pprof/check
-# At least for now, we need -static-libgo for this test, because
-# otherwise we can't get the line numbers.
-# Also use -fno-inline to get better results from the memory profiler.
-runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline
 
-@go_include@ runtime/internal/atomic.lo.dep
-runtime/internal/atomic.lo.dep: $(srcdir)/go/runtime/internal/atomic/*.go
-       $(BUILDDEPS)
-runtime_internal_atomic_lo_GOCFLAGS = -fgo-compiling-runtime
-runtime/internal/atomic.lo:
-       $(BUILDPACKAGE)
-runtime/internal/atomic_c.lo: go/runtime/internal/atomic/atomic.c runtime.inc runtime/internal/atomic.lo
-       $(LTCOMPILE) -c -o $@ $(srcdir)/go/runtime/internal/atomic/atomic.c
-runtime/internal/atomic/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: runtime/internal/atomic/check
-
-extra_go_files_runtime_internal_sys = version.go
+# The interface to libffi from the reflect package is written in C.
+reflect/makefunc_ffi_c.lo: go/reflect/makefunc_ffi_c.c runtime.inc
+       @$(MKDIR_P) reflect
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/reflect/makefunc_ffi_c.c
 
-@go_include@ runtime/internal/sys.lo.dep
-runtime/internal/sys.lo.dep: $(srcdir)/go/runtime/internal/sys/*.go
-       $(BUILDDEPS)
-runtime_internal_sys_lo_GOCFLAGS = -fgo-compiling-runtime
-runtime/internal/sys.lo:
-       $(BUILDPACKAGE)
-runtime/internal/sys/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: runtime/internal/sys/check
-
-@go_include@ sync/atomic.lo.dep
-sync/atomic.lo.dep: $(srcdir)/go/sync/atomic/*.go
-       $(BUILDDEPS)
-sync/atomic.lo:
-       $(BUILDPACKAGE)
-sync/atomic_c.lo: go/sync/atomic/atomic.c runtime.inc sync/atomic.lo
+# The atomic functions are written in C.
+runtime/internal/atomic_c.lo: go/runtime/internal/atomic/atomic.c runtime.inc
+       @$(MKDIR_P) runtime/internal
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/runtime/internal/atomic/atomic.c
+sync/atomic_c.lo: go/sync/atomic/atomic.c runtime.inc
+       @$(MKDIR_P) sync
        $(LTCOMPILE) -c -o $@ $(srcdir)/go/sync/atomic/atomic.c
-sync/atomic/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: sync/atomic/check
-
-@go_include@ text/scanner.lo.dep
-text/scanner.lo.dep: $(srcdir)/go/text/scanner/*.go
-       $(BUILDDEPS)
-text/scanner.lo:
-       $(BUILDPACKAGE)
-text/scanner/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: text/scanner/check
-
-@go_include@ text/tabwriter.lo.dep
-text/tabwriter.lo.dep: $(srcdir)/go/text/tabwriter/*.go
-       $(BUILDDEPS)
-text/tabwriter.lo:
-       $(BUILDPACKAGE)
-text/tabwriter/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: text/tabwriter/check
-
-@go_include@ text/template.lo.dep
-text/template.lo.dep: $(srcdir)/go/text/template/*.go
-       $(BUILDDEPS)
-text/template.lo:
-       $(BUILDPACKAGE)
-text/template/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: text/template/check
-
-@go_include@ text/template/parse.lo.dep
-text/template/parse.lo.dep: $(srcdir)/go/text/template/parse/*.go
-       $(BUILDDEPS)
-text/template/parse.lo:
-       $(BUILDPACKAGE)
-text/template/parse/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: text/template/parse/check
-
-@go_include@ testing/iotest.lo.dep
-testing/iotest.lo.dep: $(srcdir)/go/testing/iotest/*.go
-       $(BUILDDEPS)
-testing/iotest.lo:
-       $(BUILDPACKAGE)
-testing/iotest/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: testing/iotest/check
-
-@go_include@ testing/quick.lo.dep
-testing/quick.lo.dep: $(srcdir)/go/testing/quick/*.go
-       $(BUILDDEPS)
-testing/quick.lo:
-       $(BUILDPACKAGE)
-testing/quick/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: testing/quick/check
-
-@go_include@ unicode/utf16.lo.dep
-unicode/utf16.lo.dep: $(srcdir)/go/unicode/utf16/*.go
-       $(BUILDDEPS)
-unicode/utf16.lo:
-       $(BUILDPACKAGE)
-unicode/utf16/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: unicode/utf16/check
-
-@go_include@ unicode/utf8.lo.dep
-unicode/utf8.lo.dep: $(srcdir)/go/unicode/utf8/*.go
-       $(BUILDDEPS)
-unicode/utf8.lo:
-       $(BUILDPACKAGE)
-unicode/utf8/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: unicode/utf8/check
-
-@go_include@ syscall.lo.dep
-syscall.lo.dep: $(srcdir)/go/syscall/*.go $(extra_go_files_syscall)
-       $(BUILDDEPS)
-syscall.lo:
-       $(BUILDPACKAGE)
+
+# A few syscall functions are written in C.
 syscall/clone_linux.lo: go/syscall/clone_linux.c runtime.inc
        @$(MKDIR_P) syscall
-       $(LTCOMPILE) -c -o $@ $<
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/clone_linux.c
 syscall/errno.lo: go/syscall/errno.c runtime.inc
        @$(MKDIR_P) syscall
-       $(LTCOMPILE) -c -o $@ $<
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/errno.c
 syscall/signame.lo: go/syscall/signame.c runtime.inc
        @$(MKDIR_P) syscall
-       $(LTCOMPILE) -c -o $@ $<
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/signame.c
 syscall/wait.lo: go/syscall/wait.c runtime.inc
        @$(MKDIR_P) syscall
-       $(LTCOMPILE) -c -o $@ $<
-syscall/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: syscall/check
-
-# How to build a .gox file from a .lo file.
-BUILDGOX = \
-       f=`echo $< | sed -e 's/.lo$$/.o/'`; \
-       $(OBJCOPY) -j .go_export $$f $@.tmp && mv -f $@.tmp $@
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/wait.c
 
-bufio.gox: bufio.lo
-       $(BUILDGOX)
-bytes.gox: bytes.lo
-       $(BUILDGOX)
-context.gox: context.lo
-       $(BUILDGOX)
-crypto.gox: crypto.lo
-       $(BUILDGOX)
-encoding.gox: encoding.lo
-       $(BUILDGOX)
-errors.gox: errors.lo
-       $(BUILDGOX)
-expvar.gox: expvar.lo
-       $(BUILDGOX)
-flag.gox: flag.lo
-       $(BUILDGOX)
-fmt.gox: fmt.lo
-       $(BUILDGOX)
-hash.gox: hash.lo
-       $(BUILDGOX)
-html.gox: html.lo
-       $(BUILDGOX)
-image.gox: image.lo
-       $(BUILDGOX)
-io.gox: io.lo
-       $(BUILDGOX)
-log.gox: log.lo
-       $(BUILDGOX)
-math.gox: math.lo
-       $(BUILDGOX)
-mime.gox: mime.lo
-       $(BUILDGOX)
-net.gox: net.lo
-       $(BUILDGOX)
-os.gox: os.lo
-       $(BUILDGOX)
-path.gox: path.lo
-       $(BUILDGOX)
-reflect.gox: reflect-go.lo
-       $(BUILDGOX)
-regexp.gox: regexp.lo
-       $(BUILDGOX)
-runtime.gox: runtime-go.lo
-       $(BUILDGOX)
-sort.gox: sort.lo
-       $(BUILDGOX)
-strconv.gox: strconv.lo
-       $(BUILDGOX)
-strings.gox: strings.lo
-       $(BUILDGOX)
-sync.gox: sync.lo
-       $(BUILDGOX)
-syscall.gox: syscall.lo
-       $(BUILDGOX)
-testing.gox: testing.lo
-       $(BUILDGOX)
-time.gox: time-go.lo
-       $(BUILDGOX)
-unicode.gox: unicode.lo
-       $(BUILDGOX)
-
-archive/tar.gox: archive/tar.lo
-       $(BUILDGOX)
-archive/zip.gox: archive/zip.lo
-       $(BUILDGOX)
-
-compress/bzip2.gox: compress/bzip2.lo
-       $(BUILDGOX)
-compress/flate.gox: compress/flate.lo
-       $(BUILDGOX)
-compress/gzip.gox: compress/gzip.lo
-       $(BUILDGOX)
-compress/lzw.gox: compress/lzw.lo
-       $(BUILDGOX)
-compress/zlib.gox: compress/zlib.lo
-       $(BUILDGOX)
-
-container/heap.gox: container/heap.lo
-       $(BUILDGOX)
-container/list.gox: container/list.lo
-       $(BUILDGOX)
-container/ring.gox: container/ring.lo
-       $(BUILDGOX)
-
-crypto/aes.gox: crypto/aes.lo
-       $(BUILDGOX)
-crypto/cipher.gox: crypto/cipher.lo
-       $(BUILDGOX)
-crypto/des.gox: crypto/des.lo
-       $(BUILDGOX)
-crypto/dsa.gox: crypto/dsa.lo
-       $(BUILDGOX)
-crypto/ecdsa.gox: crypto/ecdsa.lo      
-       $(BUILDGOX)
-crypto/elliptic.gox: crypto/elliptic.lo
-       $(BUILDGOX)
-crypto/hmac.gox: crypto/hmac.lo
-       $(BUILDGOX)
-crypto/md5.gox: crypto/md5.lo
-       $(BUILDGOX)
-crypto/rand.gox: crypto/rand.lo
-       $(BUILDGOX)
-crypto/rc4.gox: crypto/rc4.lo
-       $(BUILDGOX)
-crypto/rsa.gox: crypto/rsa.lo
-       $(BUILDGOX)
-crypto/sha1.gox: crypto/sha1.lo
-       $(BUILDGOX)
-crypto/sha256.gox: crypto/sha256.lo
-       $(BUILDGOX)
-crypto/sha512.gox: crypto/sha512.lo
-       $(BUILDGOX)
-crypto/subtle.gox: crypto/subtle.lo
-       $(BUILDGOX)
-crypto/tls.gox: crypto/tls.lo
-       $(BUILDGOX)
-crypto/x509.gox: crypto/x509.lo
-       $(BUILDGOX)
-
-crypto/x509/pkix.gox: crypto/x509/pkix.lo
-       $(BUILDGOX)
-
-database/sql.gox: database/sql.lo
-       $(BUILDGOX)
-
-database/sql/driver.gox: database/sql/driver.lo
-       $(BUILDGOX)
-
-debug/dwarf.gox: debug/dwarf.lo
-       $(BUILDGOX)
-debug/elf.gox: debug/elf.lo
-       $(BUILDGOX)
-debug/gosym.gox: debug/gosym.lo
-       $(BUILDGOX)
-debug/macho.gox: debug/macho.lo
-       $(BUILDGOX)
-debug/pe.gox: debug/pe.lo
-       $(BUILDGOX)
-debug/plan9obj.gox: debug/plan9obj.lo
-       $(BUILDGOX)
-
-encoding/ascii85.gox: encoding/ascii85.lo
-       $(BUILDGOX)
-encoding/asn1.gox: encoding/asn1.lo
-       $(BUILDGOX)
-encoding/base32.gox: encoding/base32.lo
-       $(BUILDGOX)
-encoding/base64.gox: encoding/base64.lo
-       $(BUILDGOX)
-encoding/binary.gox: encoding/binary.lo
-       $(BUILDGOX)
-encoding/csv.gox: encoding/csv.lo
-       $(BUILDGOX)
-encoding/gob.gox: encoding/gob.lo
-       $(BUILDGOX)
-encoding/hex.gox: encoding/hex.lo
-       $(BUILDGOX)
-encoding/json.gox: encoding/json.lo
-       $(BUILDGOX)
-encoding/pem.gox: encoding/pem.lo
-       $(BUILDGOX)
-encoding/xml.gox: encoding/xml.lo
-       $(BUILDGOX)
-
-exp/proxy.gox: exp/proxy.lo
-       $(BUILDGOX)
-exp/terminal.gox: exp/terminal.lo
-       $(BUILDGOX)
-
-html/template.gox: html/template.lo
-       $(BUILDGOX)
-
-go/ast.gox: go/ast.lo
-       $(BUILDGOX)
-go/build.gox: go/build.lo
-       $(BUILDGOX)
-go/constant.gox: go/constant.lo
-       $(BUILDGOX)
-go/doc.gox: go/doc.lo
-       $(BUILDGOX)
-go/format.gox: go/format.lo
-       $(BUILDGOX)
-go/importer.gox: go/importer.lo
-       $(BUILDGOX)
-go/parser.gox: go/parser.lo
-       $(BUILDGOX)
-go/printer.gox: go/printer.lo
-       $(BUILDGOX)
-go/scanner.gox: go/scanner.lo
-       $(BUILDGOX)
-go/token.gox: go/token.lo
-       $(BUILDGOX)
-go/types.gox: go/types.lo
-       $(BUILDGOX)
-
-go/internal/gcimporter.gox: go/internal/gcimporter.lo
-       $(BUILDGOX)
-go/internal/gccgoimporter.gox: go/internal/gccgoimporter.lo
-       $(BUILDGOX)
-
-golang_org/x/net/http2/hpack.gox: golang_org/x/net/http2/hpack.lo
-       $(BUILDGOX)
-
-golang_org/x/net/lex/httplex.gox: golang_org/x/net/lex/httplex.lo
-       $(BUILDGOX)
+# Solaris 12 changed the type of fields in struct stat.
+# Use a build tag, based on a configure check, to cope.
+if LIBGO_IS_SOLARIS
+if HAVE_STAT_TIMESPEC
+matchargs_os = --tag=solaristag
+else
+matchargs_os =
+endif
+else
+matchargs_os =
+endif
 
 if LIBGO_IS_BSD
-golang_org/x/net/route.gox: golang_org/x/net/route.lo
-       $(BUILDGOX)
-endif
 
-hash/adler32.gox: hash/adler32.lo
-       $(BUILDGOX)
-hash/crc32.gox: hash/crc32.lo
-       $(BUILDGOX)
-hash/crc64.gox: hash/crc64.lo
-       $(BUILDGOX)
-hash/fnv.gox: hash/fnv.lo
-       $(BUILDGOX)
-
-image/color.gox: image/color.lo
-       $(BUILDGOX)
-image/draw.gox: image/draw.lo
-       $(BUILDGOX)
-image/gif.gox: image/gif.lo
-       $(BUILDGOX)
-image/internal/imageutil.gox: image/internal/imageutil.lo
-       $(BUILDGOX)
-image/jpeg.gox: image/jpeg.lo
-       $(BUILDGOX)
-image/png.gox: image/png.lo
-       $(BUILDGOX)
-
-image/color/palette.gox: image/color/palette.lo
-       $(BUILDGOX)
-
-index/suffixarray.gox: index/suffixarray.lo
-       $(BUILDGOX)
-
-internal/nettrace.gox: internal/nettrace.lo
-       $(BUILDGOX)
-internal/race.gox: internal/race.lo
-       $(BUILDGOX)
-internal/singleflight.gox: internal/singleflight.lo
-       $(BUILDGOX)
-internal/syscall/unix.gox: internal/syscall/unix.lo
-       $(BUILDGOX)
-internal/testenv.gox: internal/testenv.lo
-       $(BUILDGOX)
-internal/trace.gox: internal/trace.lo
-       $(BUILDGOX)
-
-io/ioutil.gox: io/ioutil.lo
-       $(BUILDGOX)
-
-log/syslog.gox: log/syslog.lo
-       $(BUILDGOX)
-
-math/big.gox: math/big.lo
-       $(BUILDGOX)
-math/cmplx.gox: math/cmplx.lo
-       $(BUILDGOX)
-math/rand.gox: math/rand.lo
-       $(BUILDGOX)
-
-mime/multipart.gox: mime/multipart.lo
-       $(BUILDGOX)
-mime/quotedprintable.gox: mime/quotedprintable.lo
-       $(BUILDGOX)
-
-net/http.gox: net/http.lo
-       $(BUILDGOX)
-net/mail.gox: net/mail.lo
-       $(BUILDGOX)
-net/rpc.gox: net/rpc.lo
-       $(BUILDGOX)
-net/smtp.gox: net/smtp.lo
-       $(BUILDGOX)
-net/textproto.gox: net/textproto.lo
-       $(BUILDGOX)
-net/url.gox: net/url.lo
-       $(BUILDGOX)
-
-net/http/cgi.gox: net/http/cgi.lo
-       $(BUILDGOX)
-net/http/cookiejar.gox: net/http/cookiejar.lo
-       $(BUILDGOX)
-net/http/fcgi.gox: net/http/fcgi.lo
-       $(BUILDGOX)
-net/http/httptest.gox: net/http/httptest.lo
-       $(BUILDGOX)
-net/http/httptrace.gox: net/http/httptrace.lo
-       $(BUILDGOX)
-net/http/httputil.gox: net/http/httputil.lo
-       $(BUILDGOX)
-net/http/pprof.gox: net/http/pprof.lo
-       $(BUILDGOX)
-
-net/http/internal.gox: net/http/internal.lo
-       $(BUILDGOX)
-
-net/internal/socktest.gox: net/internal/socktest.lo
-       $(BUILDGOX)
-
-net/rpc/jsonrpc.gox: net/rpc/jsonrpc.lo
-       $(BUILDGOX)
-
-old/regexp.gox: old/regexp.lo
-       $(BUILDGOX)
-old/template.gox: old/template.lo
-       $(BUILDGOX)
-
-os/exec.gox: os/exec.lo
-       $(BUILDGOX)
-os/signal.gox: os/signal.lo
-       $(BUILDGOX)
-os/user.gox: os/user.lo
-       $(BUILDGOX)
-
-path/filepath.gox: path/filepath.lo
-       $(BUILDGOX)
-
-regexp/syntax.gox: regexp/syntax.lo
-       $(BUILDGOX)
-
-runtime/debug.gox: runtime/debug.lo
-       $(BUILDGOX)
-runtime/pprof.gox: runtime/pprof.lo
-       $(BUILDGOX)
-runtime/internal/atomic.gox: runtime/internal/atomic.lo
-       $(BUILDGOX)
-runtime/internal/sys.gox: runtime/internal/sys.lo
-       $(BUILDGOX)
-
-sync/atomic.gox: sync/atomic.lo
-       $(BUILDGOX)
-
-text/scanner.gox: text/scanner.lo
-       $(BUILDGOX)
-text/tabwriter.gox: text/tabwriter.lo
-       $(BUILDGOX)
-text/template.gox: text/template.lo
-       $(BUILDGOX)
-text/template/parse.gox: text/template/parse.lo
-       $(BUILDGOX)
-
-testing/iotest.gox: testing/iotest.lo
-       $(BUILDGOX)
-testing/quick.gox: testing/quick.lo
-       $(BUILDGOX)
-
-unicode/utf16.gox: unicode/utf16.lo
-       $(BUILDGOX)
-unicode/utf8.gox: unicode/utf8.lo
-       $(BUILDGOX)
+# Build golang_org/x/net/route only on BSD systems.
+
+$(eval $(call PACKAGE_template,golang_org/x/net/route)
+
+golang_org_x_net_route_lo = \
+       golang_org/x/net/route/route.lo
+golang_org_x_net_route_check = \
+       golang_org/x/net/route/check
+
+endif
 
 TEST_PACKAGES = \
        bufio/check \
index 50fc3f63f3c7c20cfd7453416c699067b6c7c14b..ff5d9ff107b1ad5a9ea0c1df5b66749db12337d9 100644 (file)
@@ -163,61 +163,14 @@ libgolibbegin_a_AR = $(AR) $(ARFLAGS)
 libgolibbegin_a_LIBADD =
 am_libgolibbegin_a_OBJECTS = libgolibbegin_a-go-libmain.$(OBJEXT)
 libgolibbegin_a_OBJECTS = $(am_libgolibbegin_a_OBJECTS)
-libnetgo_a_AR = $(AR) $(ARFLAGS)
-libnetgo_a_DEPENDENCIES = netgo.o
-am_libnetgo_a_OBJECTS =
-libnetgo_a_OBJECTS = $(am_libnetgo_a_OBJECTS)
 LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
 @LIBGO_IS_LINUX_TRUE@am__DEPENDENCIES_1 = syscall/clone_linux.lo
-am__DEPENDENCIES_2 = bufio.lo bytes.lo bytes/index.lo context.lo \
-       crypto.lo encoding.lo errors.lo expvar.lo flag.lo fmt.lo \
-       hash.lo html.lo image.lo io.lo log.lo math.lo mime.lo net.lo \
-       os.lo path.lo reflect-go.lo reflect/makefunc_ffi_c.lo \
-       regexp.lo runtime-go.lo sort.lo strconv.lo strings.lo \
-       strings/index.lo sync.lo syscall.lo $(am__DEPENDENCIES_1) \
-       syscall/errno.lo syscall/signame.lo syscall/wait.lo testing.lo \
-       time-go.lo unicode.lo archive/tar.lo archive/zip.lo \
-       compress/bzip2.lo compress/flate.lo compress/gzip.lo \
-       compress/lzw.lo compress/zlib.lo container/heap.lo \
-       container/list.lo container/ring.lo crypto/aes.lo \
-       crypto/cipher.lo crypto/des.lo crypto/dsa.lo crypto/ecdsa.lo \
-       crypto/elliptic.lo crypto/hmac.lo crypto/md5.lo crypto/rand.lo \
-       crypto/rc4.lo crypto/rsa.lo crypto/sha1.lo crypto/sha256.lo \
-       crypto/sha512.lo crypto/subtle.lo crypto/tls.lo crypto/x509.lo \
-       crypto/x509/pkix.lo database/sql.lo database/sql/driver.lo \
-       debug/dwarf.lo debug/elf.lo debug/gosym.lo debug/macho.lo \
-       debug/pe.lo debug/plan9obj.lo encoding/ascii85.lo \
-       encoding/asn1.lo encoding/base32.lo encoding/base64.lo \
-       encoding/binary.lo encoding/csv.lo encoding/gob.lo \
-       encoding/hex.lo encoding/json.lo encoding/pem.lo \
-       encoding/xml.lo exp/proxy.lo exp/terminal.lo html/template.lo \
-       go/ast.lo go/build.lo go/constant.lo go/doc.lo go/format.lo \
-       go/importer.lo go/internal/gcimporter.lo \
-       go/internal/gccgoimporter.lo go/parser.lo go/printer.lo \
-       go/scanner.lo go/token.lo go/types.lo \
-       golang_org/x/net/http2/hpack.lo \
-       golang_org/x/net/lex/httplex.lo $(golang_org_x_net_route_lo) \
-       hash/adler32.lo hash/crc32.lo hash/crc64.lo hash/fnv.lo \
-       net/http/cgi.lo net/http/cookiejar.lo net/http/fcgi.lo \
-       net/http/httptest.lo net/http/httptrace.lo \
-       net/http/httputil.lo net/http/internal.lo net/http/pprof.lo \
-       image/color.lo image/color/palette.lo image/draw.lo \
-       image/gif.lo image/internal/imageutil.lo image/jpeg.lo \
-       image/png.lo index/suffixarray.lo internal/nettrace.lo \
-       internal/race.lo internal/singleflight.lo \
-       internal/syscall/unix.lo internal/testenv.lo internal/trace.lo \
-       io/ioutil.lo log/syslog.lo log/syslog/syslog_c.lo math/big.lo \
-       math/cmplx.lo math/rand.lo mime/multipart.lo \
-       mime/quotedprintable.lo net/http.lo net/internal/socktest.lo \
-       net/mail.lo net/rpc.lo net/smtp.lo net/textproto.lo net/url.lo \
-       old/regexp.lo old/template.lo os/exec.lo os/signal.lo \
-       os/user.lo path/filepath.lo regexp/syntax.lo \
-       net/rpc/jsonrpc.lo runtime/debug.lo runtime/pprof.lo \
-       runtime/internal/atomic.lo runtime/internal/atomic_c.lo \
-       runtime/internal/sys.lo sync/atomic.lo sync/atomic_c.lo \
-       text/scanner.lo text/tabwriter.lo text/template.lo \
-       text/template/parse.lo testing/iotest.lo testing/quick.lo \
-       unicode/utf16.lo unicode/utf8.lo
+am__DEPENDENCIES_2 = $(addsuffix .lo,$(PACKAGES)) bytes/index.lo \
+       reflect/makefunc_ffi_c.lo strings/index.lo \
+       $(am__DEPENDENCIES_1) syscall/errno.lo syscall/signame.lo \
+       syscall/wait.lo $(golang_org_x_net_route_lo) \
+       log/syslog/syslog_c.lo runtime/internal/atomic_c.lo \
+       sync/atomic_c.lo
 am__DEPENDENCIES_3 =
 am__DEPENDENCIES_4 = $(am__DEPENDENCIES_2) \
        ../libbacktrace/libbacktrace.la $(am__DEPENDENCIES_3) \
@@ -249,7 +202,7 @@ am__objects_5 = go-assert.lo go-breakpoint.lo go-caller.lo \
        go-unsafe-newarray.lo go-unsafe-pointer.lo go-unsetenv.lo \
        go-unwind.lo go-varargs.lo env_posix.lo heapdump.lo mcache.lo \
        mcentral.lo $(am__objects_1) mfixalloc.lo mgc0.lo mheap.lo \
-       msize.lo panic.lo parfor.lo print.lo proc.lo runtime.lo \
+       msize.lo panic.lo parfor.lo print.lo proc.lo runtime_c.lo \
        signal_unix.lo thread.lo $(am__objects_2) yield.lo \
        $(am__objects_3) malloc.lo runtime1.lo sigqueue.lo \
        $(am__objects_4)
@@ -280,8 +233,8 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
        $(LDFLAGS) -o $@
 SOURCES = $(libgobegin_llgo_a_SOURCES) $(libgobegin_a_SOURCES) \
-       $(libgolibbegin_a_SOURCES) $(libnetgo_a_SOURCES) \
-       $(libgo_llgo_la_SOURCES) $(libgo_la_SOURCES)
+       $(libgolibbegin_a_SOURCES) $(libgo_llgo_la_SOURCES) \
+       $(libgo_la_SOURCES)
 MULTISRCTOP = 
 MULTIBUILDTOP = 
 MULTIDIRS = 
@@ -565,7 +518,7 @@ AM_MAKEFLAGS = \
 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
 @GOC_IS_LLGO_FALSE@toolexeclib_LTLIBRARIES = libgo.la
 @GOC_IS_LLGO_TRUE@toolexeclib_LTLIBRARIES = libgo-llgo.la
-@GOC_IS_LLGO_FALSE@toolexeclib_LIBRARIES = libgobegin.a libgolibbegin.a libnetgo.a
+@GOC_IS_LLGO_FALSE@toolexeclib_LIBRARIES = libgobegin.a libgolibbegin.a
 @GOC_IS_LLGO_TRUE@toolexeclib_LIBRARIES = libgobegin-llgo.a
 toolexeclibgo_DATA = \
        bufio.gox \
@@ -874,7 +827,7 @@ runtime_files = \
        runtime/parfor.c \
        runtime/print.c \
        runtime/proc.c \
-       runtime/runtime.c \
+       runtime/runtime_c.c \
        runtime/signal_unix.c \
        runtime/thread.c \
        $(runtime_thread_files) \
@@ -888,187 +841,184 @@ runtime_files = \
 noinst_DATA = zstdpkglist.go
 @LIBGO_IS_LINUX_FALSE@syscall_epoll_file = 
 @LIBGO_IS_LINUX_TRUE@syscall_epoll_file = epoll.go
-extra_go_files_syscall = \
-       libcalls.go \
-       sysinfo.go \
-       syscall_arch.go \
-       $(syscall_epoll_file)
-
 SYSINFO_FLAGS = \
        $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(OSCFLAGS) -O
 
 @LIBGO_IS_LINUX_FALSE@syscall_lib_clone_lo = 
 @LIBGO_IS_LINUX_TRUE@syscall_lib_clone_lo = syscall/clone_linux.lo
+PACKAGES = \
+       archive/tar \
+       archive/zip \
+       bufio \
+       bytes \
+       compress/bzip2 \
+       compress/flate \
+       compress/gzip \
+       compress/lzw \
+       compress/zlib \
+       container/heap \
+       container/list \
+       container/ring \
+       context \
+       crypto \
+       crypto/aes \
+       crypto/cipher \
+       crypto/des \
+       crypto/dsa \
+       crypto/ecdsa \
+       crypto/elliptic \
+       crypto/hmac \
+       crypto/md5 \
+       crypto/rand \
+       crypto/rc4 \
+       crypto/rsa \
+       crypto/sha1 \
+       crypto/sha256 \
+       crypto/sha512 \
+       crypto/subtle \
+       crypto/tls \
+       crypto/x509 \
+       crypto/x509/pkix \
+       database/sql \
+       database/sql/driver \
+       debug/dwarf \
+       debug/elf \
+       debug/gosym \
+       debug/macho \
+       debug/pe \
+       debug/plan9obj \
+       encoding \
+       encoding/ascii85 \
+       encoding/asn1 \
+       encoding/base32 \
+       encoding/base64 \
+       encoding/binary \
+       encoding/csv \
+       encoding/gob \
+       encoding/hex \
+       encoding/json \
+       encoding/pem \
+       encoding/xml \
+       errors \
+       exp/proxy \
+       exp/terminal \
+       expvar \
+       flag \
+       fmt \
+       go/ast \
+       go/build \
+       go/constant \
+       go/doc \
+       go/format \
+       go/importer \
+       go/internal/gccgoimporter \
+       go/internal/gcimporter \
+       go/parser \
+       go/printer \
+       go/scanner \
+       go/token \
+       go/types \
+       golang_org/x/net/http2/hpack \
+       golang_org/x/net/lex/httplex \
+       hash \
+       hash/adler32 \
+       hash/crc32 \
+       hash/crc64 \
+       hash/fnv \
+       html \
+       html/template \
+       image \
+       image/color \
+       image/color/palette \
+       image/draw \
+       image/gif \
+       image/internal/imageutil \
+       image/jpeg \
+       image/png \
+       index/suffixarray \
+       internal/nettrace \
+       internal/race \
+       internal/singleflight \
+       internal/syscall/unix \
+       internal/testenv \
+       internal/trace \
+       io \
+       io/ioutil \
+       log \
+       log/syslog \
+       math \
+       math/big \
+       math/cmplx \
+       math/rand \
+       mime \
+       mime/multipart \
+       mime/quotedprintable \
+       net \
+       net/http \
+       net/http/cgi \
+       net/http/cookiejar \
+       net/http/fcgi \
+       net/http/httptest \
+       net/http/httptrace \
+       net/http/httputil \
+       net/http/internal \
+       net/http/pprof \
+       net/internal/socktest \
+       net/mail \
+       net/rpc \
+       net/rpc/jsonrpc \
+       net/smtp \
+       net/textproto \
+       net/url \
+       old/regexp \
+       old/template \
+       os \
+       os/exec \
+       os/signal \
+       os/user \
+       path \
+       path/filepath \
+       reflect \
+       regexp \
+       regexp/syntax \
+       runtime \
+       runtime/debug \
+       runtime/internal/atomic \
+       runtime/internal/sys \
+       runtime/pprof \
+       sort \
+       strconv \
+       strings \
+       sync \
+       sync/atomic \
+       syscall \
+       testing \
+       testing/iotest \
+       testing/quick \
+       text/scanner \
+       text/tabwriter \
+       text/template \
+       text/template/parse \
+       time \
+       unicode \
+       unicode/utf16 \
+       unicode/utf8
+
 libgo_go_objs = \
-       bufio.lo \
-       bytes.lo \
+       $(addsuffix .lo,$(PACKAGES)) \
        bytes/index.lo \
-       context.lo \
-       crypto.lo \
-       encoding.lo \
-       errors.lo \
-       expvar.lo \
-       flag.lo \
-       fmt.lo \
-       hash.lo \
-       html.lo \
-       image.lo \
-       io.lo \
-       log.lo \
-       math.lo \
-       mime.lo \
-       net.lo \
-       os.lo \
-       path.lo \
-       reflect-go.lo \
        reflect/makefunc_ffi_c.lo \
-       regexp.lo \
-       runtime-go.lo \
-       sort.lo \
-       strconv.lo \
-       strings.lo \
        strings/index.lo \
-       sync.lo \
-       syscall.lo \
        $(syscall_lib_clone_lo) \
        syscall/errno.lo \
        syscall/signame.lo \
        syscall/wait.lo \
-       testing.lo \
-       time-go.lo \
-       unicode.lo \
-       archive/tar.lo \
-       archive/zip.lo \
-       compress/bzip2.lo \
-       compress/flate.lo \
-       compress/gzip.lo \
-       compress/lzw.lo \
-       compress/zlib.lo \
-       container/heap.lo \
-       container/list.lo \
-       container/ring.lo \
-       crypto/aes.lo \
-       crypto/cipher.lo \
-       crypto/des.lo \
-       crypto/dsa.lo \
-       crypto/ecdsa.lo \
-       crypto/elliptic.lo \
-       crypto/hmac.lo \
-       crypto/md5.lo \
-       crypto/rand.lo \
-       crypto/rc4.lo \
-       crypto/rsa.lo \
-       crypto/sha1.lo \
-       crypto/sha256.lo \
-       crypto/sha512.lo \
-       crypto/subtle.lo \
-       crypto/tls.lo \
-       crypto/x509.lo \
-       crypto/x509/pkix.lo \
-       database/sql.lo \
-       database/sql/driver.lo \
-       debug/dwarf.lo \
-       debug/elf.lo \
-       debug/gosym.lo \
-       debug/macho.lo \
-       debug/pe.lo \
-       debug/plan9obj.lo \
-       encoding/ascii85.lo \
-       encoding/asn1.lo \
-       encoding/base32.lo \
-       encoding/base64.lo \
-       encoding/binary.lo \
-       encoding/csv.lo \
-       encoding/gob.lo \
-       encoding/hex.lo \
-       encoding/json.lo \
-       encoding/pem.lo \
-       encoding/xml.lo \
-       exp/proxy.lo \
-       exp/terminal.lo \
-       html/template.lo \
-       go/ast.lo \
-       go/build.lo \
-       go/constant.lo \
-       go/doc.lo \
-       go/format.lo \
-       go/importer.lo \
-       go/internal/gcimporter.lo \
-       go/internal/gccgoimporter.lo \
-       go/parser.lo \
-       go/printer.lo \
-       go/scanner.lo \
-       go/token.lo \
-       go/types.lo \
-       golang_org/x/net/http2/hpack.lo \
-       golang_org/x/net/lex/httplex.lo \
        $(golang_org_x_net_route_lo) \
-       hash/adler32.lo \
-       hash/crc32.lo \
-       hash/crc64.lo \
-       hash/fnv.lo \
-       net/http/cgi.lo \
-       net/http/cookiejar.lo \
-       net/http/fcgi.lo \
-       net/http/httptest.lo \
-       net/http/httptrace.lo \
-       net/http/httputil.lo \
-       net/http/internal.lo \
-       net/http/pprof.lo \
-       image/color.lo \
-       image/color/palette.lo \
-       image/draw.lo \
-       image/gif.lo \
-       image/internal/imageutil.lo \
-       image/jpeg.lo \
-       image/png.lo \
-       index/suffixarray.lo \
-       internal/nettrace.lo \
-       internal/race.lo \
-       internal/singleflight.lo \
-       internal/syscall/unix.lo \
-       internal/testenv.lo \
-       internal/trace.lo \
-       io/ioutil.lo \
-       log/syslog.lo \
        log/syslog/syslog_c.lo \
-       math/big.lo \
-       math/cmplx.lo \
-       math/rand.lo \
-       mime/multipart.lo \
-       mime/quotedprintable.lo \
-       net/http.lo \
-       net/internal/socktest.lo \
-       net/mail.lo \
-       net/rpc.lo \
-       net/smtp.lo \
-       net/textproto.lo \
-       net/url.lo \
-       old/regexp.lo \
-       old/template.lo \
-       os/exec.lo \
        $(os_lib_inotify_lo) \
-       os/signal.lo \
-       os/user.lo \
-       path/filepath.lo \
-       regexp/syntax.lo \
-       net/rpc/jsonrpc.lo \
-       runtime/debug.lo \
-       runtime/pprof.lo \
-       runtime/internal/atomic.lo \
        runtime/internal/atomic_c.lo \
-       runtime/internal/sys.lo \
-       sync/atomic.lo \
-       sync/atomic_c.lo \
-       text/scanner.lo \
-       text/tabwriter.lo \
-       text/template.lo \
-       text/template/parse.lo \
-       testing/iotest.lo \
-       testing/quick.lo \
-       unicode/utf16.lo \
-       unicode/utf8.lo
+       sync/atomic_c.lo
 
 libgo_ldflags = \
        -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
@@ -1097,8 +1047,6 @@ libgolibbegin_a_SOURCES = \
        runtime/go-libmain.c
 
 libgolibbegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
-libnetgo_a_SOURCES = 
-libnetgo_a_LIBADD = netgo.o
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
 AM_GOCFLAGS = $(STRINGOPS_FLAG) $(GO_SPLIT_STACK)
 GOCOMPILE = $(GOC) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_GOCFLAGS) $(GOCFLAGS)
@@ -1112,8 +1060,8 @@ GOLINK = $(LIBTOOL) --tag GO --mode-link $(GOC) \
 # Build the dependencies for a Go package.
 BUILDDEPS = \
        $(MKDIR_P) $(@D); \
-       dir=`echo $@ | sed -e 's/.lo.dep$$//' -e 's/-go//'`; \
-       files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$$dir --extrafiles="$(extra_go_files_$(subst /,_,$(subst -go,,$(subst .lo.dep,,$@))))" $(matchargs_$(subst /,_,$(subst -go,,$(subst .lo.dep,,$@))))`; \
+       dir=`echo $@ | sed -e 's/.lo.dep$$//'`; \
+       files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$$dir --extrafiles="$(extra_go_files_$(subst /,_,$(subst .lo.dep,,$@)))" $(matchargs_$(subst /,_,$(subst .lo.dep,,$@)))`; \
        $(SHELL) $(srcdir)/godeps.sh `echo $@ | sed -e 's/.dep$$//'` $$files > $@.tmp; \
        if ! cmp $@.tmp $@ >/dev/null 2>/dev/null; then \
          rm -f `echo $@ | sed -e 's/\.dep$$//'`; \
@@ -1125,22 +1073,13 @@ BUILDDEPS = \
 BUILDPACKAGE = \
        $(MKDIR_P) $(@D); \
        files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \
-       $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//' -e 's/-go$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
-
-
-# Build deps for netgo.o.
-BUILDNETGODEPS = \
-       $(MKDIR_P) $(@D); \
-       files=`$(SHELL) $(srcdir)/match.sh --nocgo --tag=netgo --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/net`; \
-       $(SHELL) $(srcdir)/godeps.sh netgo.o $$files > $@.tmp; \
-       mv -f $@.tmp $@
+       $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
 
 
-# Build netgo.o.
-BUILDNETGO = \
-       $(MKDIR_P) $(@D); \
-       files=`echo $^ | sed -e 's/[^ ]*\.gox//g' -e 's/[^ ]*\.dep//'`; \
-       $(GOCOMPILE) -I . -c -fPIC -fgo-pkgpath=net -o $@ $$files
+# How to build a .gox file from a .lo file.
+BUILDGOX = \
+       f=`echo $< | sed -e 's/.lo$$/.o/'`; \
+       $(OBJCOPY) -j .go_export $$f $@.tmp && mv -f $@.tmp $@
 
 GOTESTFLAGS = 
 GOBENCH = 
@@ -1195,30 +1134,46 @@ CHECK_DEPS = $(toolexeclibgo_DATA) $(toolexeclibgoarchive_DATA) \
        $(toolexeclibgosync_DATA) $(toolexeclibgotesting_DATA) \
        $(toolexeclibgotext_DATA) $(toolexeclibgotexttemplate_DATA) \
        $(toolexeclibgounicode_DATA) $(am__append_1) $(am__append_2)
-@HAVE_STAT_TIMESPEC_FALSE@@LIBGO_IS_SOLARIS_TRUE@matchargs_os = 
-@HAVE_STAT_TIMESPEC_TRUE@@LIBGO_IS_SOLARIS_TRUE@matchargs_os = --tag=solaristag
-@LIBGO_IS_SOLARIS_FALSE@matchargs_os = 
+
+# Pass -ffp-contract=off, or 386-specific options, when building the
+# math package.  MATH_FLAG is defined in configure.ac.
+math_lo_GOCFLAGS = $(MATH_FLAG)
+
+# Add the generated file runtime_sysinfo.go to the runtime package.
 extra_go_files_runtime = runtime_sysinfo.go
-runtime_go_lo_GOCFLAGS = -fgo-c-header=runtime.inc.tmp -fgo-compiling-runtime
-runtime_check_GOCFLAGS = -fgo-compiling-runtime
-@LIBGO_IS_BSD_TRUE@golang_org_x_net_route_lo = \
-@LIBGO_IS_BSD_TRUE@    golang_org/x/net/route/route.lo
 
-@LIBGO_IS_BSD_TRUE@golang_org_x_net_route_check = \
-@LIBGO_IS_BSD_TRUE@    golang_org/x/net/route/check
+# Add generated files to the syscall package.
+extra_go_files_syscall = \
+       libcalls.go \
+       sysinfo.go \
+       syscall_arch.go \
+       $(syscall_epoll_file)
+
+
+# Pass -fgo-compiling-runtime when compiling the runtime package.
+runtime_lo_GOCFLAGS = -fgo-c-header=runtime.inc.tmp -fgo-compiling-runtime
+runtime_check_GOCFLAGS = -fgo-compiling-runtime
+runtime_internal_atomic_lo_GOCFLAGS = -fgo-compiling-runtime
+runtime_internal_atomic_lo_check_GOCFLAGS = -fgo-compiling-runtime
+runtime_internal_sys_lo_GOCFLAGS = -fgo-compiling-runtime
+runtime_internal_sys_lo_check_GOCFLAGS = -fgo-compiling-runtime
 
 # At least for now, we need -static-libgo for this test, because
 # otherwise we can't get the line numbers.
 # Also use -fno-inline to get better results from the memory profiler.
 runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline
-runtime_internal_atomic_lo_GOCFLAGS = -fgo-compiling-runtime
 extra_go_files_runtime_internal_sys = version.go
-runtime_internal_sys_lo_GOCFLAGS = -fgo-compiling-runtime
+@HAVE_STAT_TIMESPEC_FALSE@@LIBGO_IS_SOLARIS_TRUE@matchargs_os = 
 
-# How to build a .gox file from a .lo file.
-BUILDGOX = \
-       f=`echo $< | sed -e 's/.lo$$/.o/'`; \
-       $(OBJCOPY) -j .go_export $$f $@.tmp && mv -f $@.tmp $@
+# Solaris 12 changed the type of fields in struct stat.
+# Use a build tag, based on a configure check, to cope.
+@HAVE_STAT_TIMESPEC_TRUE@@LIBGO_IS_SOLARIS_TRUE@matchargs_os = --tag=solaristag
+@LIBGO_IS_SOLARIS_FALSE@matchargs_os = 
+@LIBGO_IS_BSD_TRUE@golang_org_x_net_route_lo = \
+@LIBGO_IS_BSD_TRUE@    golang_org/x/net/route/route.lo
+
+@LIBGO_IS_BSD_TRUE@golang_org_x_net_route_check = \
+@LIBGO_IS_BSD_TRUE@    golang_org/x/net/route/check
 
 TEST_PACKAGES = \
        bufio/check \
@@ -1462,10 +1417,6 @@ libgolibbegin.a: $(libgolibbegin_a_OBJECTS) $(libgolibbegin_a_DEPENDENCIES) $(EX
        -rm -f libgolibbegin.a
        $(libgolibbegin_a_AR) libgolibbegin.a $(libgolibbegin_a_OBJECTS) $(libgolibbegin_a_LIBADD)
        $(RANLIB) libgolibbegin.a
-libnetgo.a: $(libnetgo_a_OBJECTS) $(libnetgo_a_DEPENDENCIES) $(EXTRA_libnetgo_a_DEPENDENCIES) 
-       -rm -f libnetgo.a
-       $(libnetgo_a_AR) libnetgo.a $(libnetgo_a_OBJECTS) $(libnetgo_a_LIBADD)
-       $(RANLIB) libnetgo.a
 install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
        @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
@@ -1571,8 +1522,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtems-task-variable-add.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtime.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtime1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtime_c.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal_unix.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigqueue.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread-linux.Plo@am__quote@
@@ -2007,12 +1958,12 @@ proc.lo: runtime/proc.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc.lo `test -f 'runtime/proc.c' || echo '$(srcdir)/'`runtime/proc.c
 
-runtime.lo: runtime/runtime.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT runtime.lo -MD -MP -MF $(DEPDIR)/runtime.Tpo -c -o runtime.lo `test -f 'runtime/runtime.c' || echo '$(srcdir)/'`runtime/runtime.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/runtime.Tpo $(DEPDIR)/runtime.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/runtime.c' object='runtime.lo' libtool=yes @AMDEPBACKSLASH@
+runtime_c.lo: runtime/runtime_c.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT runtime_c.lo -MD -MP -MF $(DEPDIR)/runtime_c.Tpo -c -o runtime_c.lo `test -f 'runtime/runtime_c.c' || echo '$(srcdir)/'`runtime/runtime_c.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/runtime_c.Tpo $(DEPDIR)/runtime_c.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/runtime_c.c' object='runtime_c.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o runtime.lo `test -f 'runtime/runtime.c' || echo '$(srcdir)/'`runtime/runtime.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o runtime_c.lo `test -f 'runtime/runtime_c.c' || echo '$(srcdir)/'`runtime/runtime_c.c
 
 signal_unix.lo: runtime/signal_unix.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signal_unix.lo -MD -MP -MF $(DEPDIR)/signal_unix.Tpo -c -o signal_unix.lo `test -f 'runtime/signal_unix.c' || echo '$(srcdir)/'`runtime/signal_unix.c
@@ -3293,6 +3244,16 @@ s-runtime_sysinfo: $(srcdir)/mkrsysinfo.sh gen-sysinfo.go
        $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime_sysinfo.go runtime_sysinfo.go
        $(STAMP) $@
 
+runtime.inc: s-runtime-inc; @true
+s-runtime-inc: runtime.lo Makefile
+       rm -f runtime.inc.tmp2
+       grep -v "#define _" runtime.inc.tmp | grep -v "#define c0 " | grep -v "#define c1 " > runtime.inc.tmp2
+       for pattern in '_G[a-z]' '_P[a-z]' _Max _Lock _Sig _Trace _MHeap _Num; do \
+         grep "#define $$pattern" runtime.inc.tmp >> runtime.inc.tmp2; \
+       done
+       $(SHELL) $(srcdir)/mvifdiff.sh runtime.inc.tmp2 runtime.inc
+       $(STAMP) $@
+
 # Generate the list of go std packages that were included in libgo
 zstdpkglist.go: s-zstdpkglist; @true
 s-zstdpkglist: Makefile
@@ -3300,7 +3261,7 @@ s-zstdpkglist: Makefile
        echo 'package main' > zstdpkglist.go.tmp
        echo "" >> zstdpkglist.go.tmp
        echo 'var stdpkg = map[string]bool{' >> zstdpkglist.go.tmp
-       echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's/\.lo /\": true,\n/g' | sed 's/\.lo/\": true,/' | sed 's/-go//' | grep -v _c | sed 's/^/\t\"/' | sort | uniq >> zstdpkglist.go.tmp
+       echo $(libgo_go_objs) 'unsafe.lo' 'runtime/cgo.lo' | sed 's/\.lo /\": true,\n/g' | sed 's/\.lo/\": true,/' | grep -v _c | sed 's/^/\t\"/' | sort | uniq >> zstdpkglist.go.tmp
        echo '}' >> zstdpkglist.go.tmp
        $(SHELL) $(srcdir)/mvifdiff.sh zstdpkglist.go.tmp zstdpkglist.go
        $(STAMP) $@
@@ -3382,1818 +3343,87 @@ $(libgobegin_a_OBJECTS): runtime.inc
 $(libgobegin_llgo_a_OBJECTS): runtime.inc
 $(libgolibbegin_a_OBJECTS): runtime.inc
 
-@go_include@ bufio.lo.dep
-bufio.lo.dep: $(srcdir)/go/bufio/*.go
-       $(BUILDDEPS)
-bufio.lo:
-       $(BUILDPACKAGE)
-bufio/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: bufio/check
-
-@go_include@ bytes.lo.dep
-bytes.lo.dep: $(srcdir)/go/bytes/*.go
-       $(BUILDDEPS)
-bytes.lo:
-       $(BUILDPACKAGE)
+# PACKAGE_template defines the rules for each package.
+# For example, for the package bufio, it produces:
+#
+# @go_include@ bufio.lo.dep
+# bufio.lo.dep: $(srcdir)/go/bufio/*.go
+#      $(BUILDDEPS)
+# bufio.lo:
+#      $(BUILDPACKAGE)
+# bufio/check: $(CHECK_DEPS)
+#      @$(CHECK)
+# .PHONY: bufio/check
+#
+# This is invoked with $(1) set to a package, which is a directory name,
+# such as "bufio" or "archive/tar".
+define PACKAGE_template
+@go_include@ $(1).lo.dep
+$(1).lo.dep: $(srcdir)/go/$(1)/*.go
+       $$(BUILDDEPS)
+$(1).lo:
+       $$(BUILDPACKAGE)
+$(1)/check: $$(CHECK_DEPS)
+       @$$(CHECK)
+.PHONY: $(1)/check
+$(1).gox: $(1).lo
+       $$(BUILDGOX)
+endef
+
+# This line expands PACKAGE_template once for each package name listed
+# in $(PACKAGES).
+$(foreach package,$(PACKAGES),$(eval $(call PACKAGE_template,$(package))))
+runtime.lo.dep: $(extra_go_files_runtime)
+syscall.lo.dep: $(extra_go_files_syscall)
+runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys)
+
+# FIXME: The following C files may as well move to the runtime
+# directory and be treated like other C files.
+
+# Use C code to speed up {bytes,strings}.IndexByte and friends.
 bytes/index.lo: go/bytes/indexbyte.c runtime.inc
        @$(MKDIR_P) bytes
-       $(LTCOMPILE) -c -o bytes/index.lo $(srcdir)/go/bytes/indexbyte.c
-bytes/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: bytes/check
-
-@go_include@ context.lo.dep
-context.lo.dep: $(srcdir)/go/context/*.go
-       $(BUILDDEPS)
-context.lo:
-       $(BUILDPACKAGE)
-context/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: context/check
-
-@go_include@ crypto.lo.dep
-crypto.lo.dep: $(srcdir)/go/crypto/*.go
-       $(BUILDDEPS)
-crypto.lo:
-       $(BUILDPACKAGE)
-crypto/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/check
-
-@go_include@ encoding.lo.dep
-encoding.lo.dep: $(srcdir)/go/encoding/*.go
-       $(BUILDDEPS)
-encoding.lo:
-       $(BUILDPACKAGE)
-encoding/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/check
-
-@go_include@ errors.lo.dep
-errors.lo.dep: $(srcdir)/go/errors/*.go
-       $(BUILDDEPS)
-errors.lo:
-       $(BUILDPACKAGE)
-errors/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: errors/check
-
-@go_include@ expvar.lo.dep
-expvar.lo.dep: $(srcdir)/go/expvar/*.go
-       $(BUILDDEPS)
-expvar.lo:
-       $(BUILDPACKAGE)
-expvar/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: expvar/check
-
-@go_include@ flag.lo.dep
-flag.lo.dep: $(srcdir)/go/flag/*.go
-       $(BUILDDEPS)
-flag.lo:
-       $(BUILDPACKAGE)
-flag/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: flag/check
-
-@go_include@ fmt.lo.dep
-fmt.lo.dep: $(srcdir)/go/fmt/*.go
-       $(BUILDDEPS)
-fmt.lo:
-       $(BUILDPACKAGE)
-fmt/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: fmt/check
-
-@go_include@ hash.lo.dep
-hash.lo.dep: $(srcdir)/go/hash/*.go
-       $(BUILDDEPS)
-hash.lo:
-       $(BUILDPACKAGE)
-hash/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: hash/check
-
-@go_include@ html.lo.dep
-html.lo.dep: $(srcdir)/go/html/*.go
-       $(BUILDDEPS)
-html.lo:
-       $(BUILDPACKAGE)
-html/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: html/check
-
-@go_include@ image.lo.dep
-image.lo.dep: $(srcdir)/go/image/*.go
-       $(BUILDDEPS)
-image.lo:
-       $(BUILDPACKAGE)
-image/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/check
-
-@go_include@ io.lo.dep
-io.lo.dep: $(srcdir)/go/io/*.go
-       $(BUILDDEPS)
-io.lo:
-       $(BUILDPACKAGE)
-io/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: io/check
-
-@go_include@ log.lo.dep
-log.lo.dep: $(srcdir)/go/log/*.go
-       $(BUILDDEPS)
-log.lo:
-       $(BUILDPACKAGE)
-log/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: log/check
-
-@go_include@ math.lo.dep
-math.lo.dep: $(srcdir)/go/math/*.go
-       $(BUILDDEPS)
-math.lo:
-       $(MKDIR_P) $(@D)
-       files=`echo $^ | sed -e 's/[^ ]*\.gox//g'`; \
-       $(LTGOCOMPILE) $(MATH_FLAG) -I . -c -fgo-pkgpath=math -o $@ $$files
-math/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: math/check
-
-@go_include@ mime.lo.dep
-mime.lo.dep: $(srcdir)/go/mime/*.go
-       $(BUILDDEPS)
-mime.lo:
-       $(BUILDPACKAGE)
-mime/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: mime/check
-
-@go_include@ net.lo.dep
-net.lo.dep: $(srcdir)/go/net/*.go
-       $(BUILDDEPS)
-net.lo:
-       $(BUILDPACKAGE)
-net/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/check
-
-@go_include@ netgo.o.dep
-netgo.o.dep: $(srcdir)/go/net/*.go
-       $(BUILDNETGODEPS)
-netgo.o: netgo.o.dep
-       $(BUILDNETGO)
-
-@go_include@ os.lo.dep
-os.lo.dep: $(srcdir)/go/os/*.go
-       $(BUILDDEPS)
-os.lo:
-       $(BUILDPACKAGE)
-os/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: os/check
-
-@go_include@ path.lo.dep
-path.lo.dep: $(srcdir)/go/path/*.go
-       $(BUILDDEPS)
-path.lo:
-       $(BUILDPACKAGE)
-path/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: path/check
-
-@go_include@ reflect-go.lo.dep
-reflect-go.lo.dep: $(srcdir)/go/reflect/*.go
-       $(BUILDDEPS)
-reflect-go.lo:
-       $(BUILDPACKAGE)
-reflect/check: $(CHECK_DEPS)
-       @$(CHECK)
-reflect/makefunc_ffi_c.lo: go/reflect/makefunc_ffi_c.c runtime.inc
-       @$(MKDIR_P) reflect
-       $(LTCOMPILE) -c -o $@ $<
-.PHONY: reflect/check
-
-@go_include@ regexp.lo.dep
-regexp.lo.dep: $(srcdir)/go/regexp/*.go
-       $(BUILDDEPS)
-regexp.lo:
-       $(BUILDPACKAGE)
-regexp/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: regexp/check
-
-@go_include@ runtime-go.lo.dep
-runtime-go.lo.dep: $(srcdir)/go/runtime/*.go $(extra_go_files_runtime)
-       $(BUILDDEPS)
-runtime-go.lo:
-       $(BUILDPACKAGE)
-runtime.inc: s-runtime-inc; @true
-s-runtime-inc: runtime-go.lo Makefile
-       rm -f runtime.inc.tmp2
-       grep -v "#define _" runtime.inc.tmp | grep -v "#define c0 " | grep -v "#define c1 " > runtime.inc.tmp2
-       for pattern in '_G[a-z]' '_P[a-z]' _Max _Lock _Sig _Trace _MHeap _Num; do \
-         grep "#define $$pattern" runtime.inc.tmp >> runtime.inc.tmp2; \
-       done
-       $(SHELL) $(srcdir)/mvifdiff.sh runtime.inc.tmp2 runtime.inc
-       $(STAMP) $@
-runtime/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: runtime/check
-
-@go_include@ sort.lo.dep
-sort.lo.dep: $(srcdir)/go/sort/*.go
-       $(BUILDDEPS)
-sort.lo:
-       $(BUILDPACKAGE)
-sort/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: sort/check
-
-@go_include@ strconv.lo.dep
-strconv.lo.dep: $(srcdir)/go/strconv/*.go
-       $(BUILDDEPS)
-strconv.lo:
-       $(BUILDPACKAGE)
-strconv/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: strconv/check
-
-@go_include@ strings.lo.dep
-strings.lo.dep: $(srcdir)/go/strings/*.go
-       $(BUILDDEPS)
-strings.lo:
-       $(BUILDPACKAGE)
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/bytes/indexbyte.c
 strings/index.lo: go/strings/indexbyte.c runtime.inc
        @$(MKDIR_P) strings
-       $(LTCOMPILE) -c -o strings/index.lo $(srcdir)/go/strings/indexbyte.c
-strings/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: strings/check
-
-@go_include@ sync.lo.dep
-sync.lo.dep: $(srcdir)/go/sync/*.go
-       $(BUILDDEPS)
-sync.lo:
-       $(BUILDPACKAGE)
-sync/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: sync/check
-
-@go_include@ testing.lo.dep
-testing.lo.dep: $(srcdir)/go/testing/*.go
-       $(BUILDDEPS)
-testing.lo:
-       $(BUILDPACKAGE)
-testing/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: testing/check
-
-@go_include@ time-go.lo.dep
-time-go.lo.dep: $(srcdir)/go/time/*.go
-       $(BUILDDEPS)
-time-go.lo:
-       $(BUILDPACKAGE)
-time/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: time/check
-
-@go_include@ unicode.lo.dep
-unicode.lo.dep: $(srcdir)/go/unicode/*.go
-       $(BUILDDEPS)
-unicode.lo:
-       $(BUILDPACKAGE)
-unicode/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: unicode/check
-
-@go_include@ archive/tar.lo.dep
-archive/tar.lo.dep: $(srcdir)/go/archive/tar/*.go
-       $(BUILDDEPS)
-archive/tar.lo:
-       $(BUILDPACKAGE)
-archive/tar/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: archive/tar/check
-
-@go_include@ archive/zip.lo.dep
-archive/zip.lo.dep: $(srcdir)/go/archive/zip/*.go
-       $(BUILDDEPS)
-archive/zip.lo:
-       $(BUILDPACKAGE)
-archive/zip/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: archive/zip/check
-
-@go_include@ compress/bzip2.lo.dep
-compress/bzip2.lo.dep: $(srcdir)/go/compress/bzip2/*.go
-       $(BUILDDEPS)
-compress/bzip2.lo:
-       $(BUILDPACKAGE)
-compress/bzip2/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: compress/bzip2/check
-
-@go_include@ compress/flate.lo.dep
-compress/flate.lo.dep: $(srcdir)/go/compress/flate/*.go
-       $(BUILDDEPS)
-compress/flate.lo:
-       $(BUILDPACKAGE)
-compress/flate/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: compress/flate/check
-
-@go_include@ compress/gzip.lo.dep
-compress/gzip.lo.dep: $(srcdir)/go/compress/gzip/*.go
-       $(BUILDDEPS)
-compress/gzip.lo:
-       $(BUILDPACKAGE)
-compress/gzip/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: compress/gzip/check
-
-@go_include@ compress/lzw.lo.dep
-compress/lzw.lo.dep: $(srcdir)/go/compress/lzw/*.go
-       $(BUILDDEPS)
-compress/lzw.lo:
-       $(BUILDPACKAGE)
-compress/lzw/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: compress/lzw/check
-
-@go_include@ compress/zlib.lo.dep
-compress/zlib.lo.dep: $(srcdir)/go/compress/zlib/*.go
-       $(BUILDDEPS)
-compress/zlib.lo:
-       $(BUILDPACKAGE)
-compress/zlib/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: compress/zlib/check
-
-@go_include@ container/heap.lo.dep
-container/heap.lo.dep: $(srcdir)/go/container/heap/*.go
-       $(BUILDDEPS)
-container/heap.lo:
-       $(BUILDPACKAGE)
-container/heap/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: container/heap/check
-
-@go_include@ container/list.lo.dep
-container/list.lo.dep: $(srcdir)/go/container/list/*.go
-       $(BUILDDEPS)
-container/list.lo:
-       $(BUILDPACKAGE)
-container/list/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: container/list/check
-
-@go_include@ container/ring.lo.dep
-container/ring.lo.dep: $(srcdir)/go/container/ring/*.go
-       $(BUILDDEPS)
-container/ring.lo:
-       $(BUILDPACKAGE)
-container/ring/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: container/ring/check
-
-@go_include@ crypto/aes.lo.dep
-crypto/aes.lo.dep: $(srcdir)/go/crypto/aes/*.go
-       $(BUILDDEPS)
-crypto/aes.lo:
-       $(BUILDPACKAGE)
-crypto/aes/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/aes/check
-
-@go_include@ crypto/cipher.lo.dep
-crypto/cipher.lo.dep: $(srcdir)/go/crypto/cipher/*.go
-       $(BUILDDEPS)
-crypto/cipher.lo:
-       $(BUILDPACKAGE)
-crypto/cipher/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/cipher/check
-
-@go_include@ crypto/des.lo.dep
-crypto/des.lo.dep: $(srcdir)/go/crypto/des/*.go
-       $(BUILDDEPS)
-crypto/des.lo:
-       $(BUILDPACKAGE)
-crypto/des/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/des/check
-
-@go_include@ crypto/dsa.lo.dep
-crypto/dsa.lo.dep: $(srcdir)/go/crypto/dsa/*.go
-       $(BUILDDEPS)
-crypto/dsa.lo:
-       $(BUILDPACKAGE)
-crypto/dsa/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/dsa/check
-
-@go_include@ crypto/ecdsa.lo.dep
-crypto/ecdsa.lo.dep: $(srcdir)/go/crypto/ecdsa/*.go
-       $(BUILDDEPS)
-crypto/ecdsa.lo:
-       $(BUILDPACKAGE)
-crypto/ecdsa/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/ecdsa/check
-
-@go_include@ crypto/elliptic.lo.dep
-crypto/elliptic.lo.dep: $(srcdir)/go/crypto/elliptic/*.go
-       $(BUILDDEPS)
-crypto/elliptic.lo:
-       $(BUILDPACKAGE)
-crypto/elliptic/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/elliptic/check
-
-@go_include@ crypto/hmac.lo.dep
-crypto/hmac.lo.dep: $(srcdir)/go/crypto/hmac/*.go
-       $(BUILDDEPS)
-crypto/hmac.lo:
-       $(BUILDPACKAGE)
-crypto/hmac/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/hmac/check
-
-@go_include@ crypto/md5.lo.dep
-crypto/md5.lo.dep: $(srcdir)/go/crypto/md5/*.go
-       $(BUILDDEPS)
-crypto/md5.lo:
-       $(BUILDPACKAGE)
-crypto/md5/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/md5/check
-
-@go_include@ crypto/rand.lo.dep
-crypto/rand.lo.dep: $(srcdir)/go/crypto/rand/*.go
-       $(BUILDDEPS)
-crypto/rand.lo:
-       $(BUILDPACKAGE)
-crypto/rand/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/rand/check
-
-@go_include@ crypto/rc4.lo.dep
-crypto/rc4.lo.dep: $(srcdir)/go/crypto/rc4/*.go
-       $(BUILDDEPS)
-crypto/rc4.lo:
-       $(BUILDPACKAGE)
-crypto/rc4/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/rc4/check
-
-@go_include@ crypto/rsa.lo.dep
-crypto/rsa.lo.dep: $(srcdir)/go/crypto/rsa/*.go
-       $(BUILDDEPS)
-crypto/rsa.lo:
-       $(BUILDPACKAGE)
-crypto/rsa/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/rsa/check
-
-@go_include@ crypto/sha1.lo.dep
-crypto/sha1.lo.dep: $(srcdir)/go/crypto/sha1/*.go
-       $(BUILDDEPS)
-crypto/sha1.lo:
-       $(BUILDPACKAGE)
-crypto/sha1/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/sha1/check
-
-@go_include@ crypto/sha256.lo.dep
-crypto/sha256.lo.dep: $(srcdir)/go/crypto/sha256/*.go
-       $(BUILDDEPS)
-crypto/sha256.lo:
-       $(BUILDPACKAGE)
-crypto/sha256/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/sha256/check
-
-@go_include@ crypto/sha512.lo.dep
-crypto/sha512.lo.dep: $(srcdir)/go/crypto/sha512/*.go
-       $(BUILDDEPS)
-crypto/sha512.lo:
-       $(BUILDPACKAGE)
-crypto/sha512/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/sha512/check
-
-@go_include@ crypto/subtle.lo.dep
-crypto/subtle.lo.dep: $(srcdir)/go/crypto/subtle/*.go
-       $(BUILDDEPS)
-crypto/subtle.lo:
-       $(BUILDPACKAGE)
-crypto/subtle/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/subtle/check
-
-@go_include@ crypto/tls.lo.dep
-crypto/tls.lo.dep: $(srcdir)/go/crypto/tls/*.go
-       $(BUILDDEPS)
-crypto/tls.lo:
-       $(BUILDPACKAGE)
-crypto/tls/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/tls/check
-
-@go_include@ crypto/x509.lo.dep
-crypto/x509.lo.dep: $(srcdir)/go/crypto/x509/*.go
-       $(BUILDDEPS)
-crypto/x509.lo:
-       $(BUILDPACKAGE)
-crypto/x509/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/x509/check
-
-@go_include@ crypto/x509/pkix.lo.dep
-crypto/x509/pkix.lo.dep: $(srcdir)/go/crypto/x509/pkix/*.go
-       $(BUILDDEPS)
-crypto/x509/pkix.lo:
-       $(BUILDPACKAGE)
-crypto/x509/pkix/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: crypto/x509/pkix/check
-
-@go_include@ database/sql.lo.dep
-database/sql.lo.dep: $(srcdir)/go/database/sql/*.go
-       $(BUILDDEPS)
-database/sql.lo:
-       $(BUILDPACKAGE)
-database/sql/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: database/sql/check
-
-@go_include@ database/sql/driver.lo.dep
-database/sql/driver.lo.dep: $(srcdir)/go/database/sql/driver/*.go
-       $(BUILDDEPS)
-database/sql/driver.lo:
-       $(BUILDPACKAGE)
-database/sql/driver/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: database/sql/driver/check
-
-@go_include@ debug/dwarf.lo.dep
-debug/dwarf.lo.dep: $(srcdir)/go/debug/dwarf/*.go
-       $(BUILDDEPS)
-debug/dwarf.lo:
-       $(BUILDPACKAGE)
-debug/dwarf/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: debug/dwarf/check
-
-@go_include@ debug/elf.lo.dep
-debug/elf.lo.dep: $(srcdir)/go/debug/elf/*.go
-       $(BUILDDEPS)
-debug/elf.lo:
-       $(BUILDPACKAGE)
-debug/elf/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: debug/elf/check
-
-@go_include@ debug/gosym.lo.dep
-debug/gosym.lo.dep: $(srcdir)/go/debug/gosym/*.go
-       $(BUILDDEPS)
-debug/gosym.lo:
-       $(BUILDPACKAGE)
-debug/gosym/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: debug/gosym/check
-
-@go_include@ debug/macho.lo.dep
-debug/macho.lo.dep: $(srcdir)/go/debug/macho/*.go
-       $(BUILDDEPS)
-debug/macho.lo:
-       $(BUILDPACKAGE)
-debug/macho/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: debug/macho/check
-
-@go_include@ debug/pe.lo.dep
-debug/pe.lo.dep: $(srcdir)/go/debug/pe/*.go
-       $(BUILDDEPS)
-debug/pe.lo:
-       $(BUILDPACKAGE)
-debug/pe/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: debug/pe/check
-
-@go_include@ debug/plan9obj.lo.dep
-debug/plan9obj.lo.dep: $(srcdir)/go/debug/plan9obj/*.go
-       $(BUILDDEPS)
-debug/plan9obj.lo:
-       $(BUILDPACKAGE)
-debug/plan9obj/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: debug/plan9obj/check
-
-@go_include@ encoding/asn1.lo.dep
-encoding/asn1.lo.dep: $(srcdir)/go/encoding/asn1/*.go
-       $(BUILDDEPS)
-encoding/asn1.lo:
-       $(BUILDPACKAGE)
-encoding/asn1/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/asn1/check
-
-@go_include@ encoding/ascii85.lo.dep
-encoding/ascii85.lo.dep: $(srcdir)/go/encoding/ascii85/*.go
-       $(BUILDDEPS)
-encoding/ascii85.lo:
-       $(BUILDPACKAGE)
-encoding/ascii85/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/ascii85/check
-
-@go_include@ encoding/base32.lo.dep
-encoding/base32.lo.dep: $(srcdir)/go/encoding/base32/*.go
-       $(BUILDDEPS)
-encoding/base32.lo:
-       $(BUILDPACKAGE)
-encoding/base32/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/base32/check
-
-@go_include@ encoding/base64.lo.dep
-encoding/base64.lo.dep: $(srcdir)/go/encoding/base64/*.go
-       $(BUILDDEPS)
-encoding/base64.lo:
-       $(BUILDPACKAGE)
-encoding/base64/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/base64/check
-
-@go_include@ encoding/binary.lo.dep
-encoding/binary.lo.dep: $(srcdir)/go/encoding/binary/*.go
-       $(BUILDDEPS)
-encoding/binary.lo:
-       $(BUILDPACKAGE)
-encoding/binary/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/binary/check
-
-@go_include@ encoding/csv.lo.dep
-encoding/csv.lo.dep: $(srcdir)/go/encoding/csv/*.go
-       $(BUILDDEPS)
-encoding/csv.lo:
-       $(BUILDPACKAGE)
-encoding/csv/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/csv/check
-
-@go_include@ encoding/gob.lo.dep
-encoding/gob.lo.dep: $(srcdir)/go/encoding/gob/*.go
-       $(BUILDDEPS)
-encoding/gob.lo:
-       $(BUILDPACKAGE)
-encoding/gob/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/gob/check
-
-@go_include@ encoding/hex.lo.dep
-encoding/hex.lo.dep: $(srcdir)/go/encoding/hex/*.go
-       $(BUILDDEPS)
-encoding/hex.lo:
-       $(BUILDPACKAGE)
-encoding/hex/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/hex/check
-
-@go_include@ encoding/json.lo.dep
-encoding/json.lo.dep: $(srcdir)/go/encoding/json/*.go
-       $(BUILDDEPS)
-encoding/json.lo:
-       $(BUILDPACKAGE)
-encoding/json/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/json/check
-
-@go_include@ encoding/pem.lo.dep
-encoding/pem.lo.dep: $(srcdir)/go/encoding/pem/*.go
-       $(BUILDDEPS)
-encoding/pem.lo:
-       $(BUILDPACKAGE)
-encoding/pem/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/pem/check
-
-@go_include@ encoding/xml.lo.dep
-encoding/xml.lo.dep: $(srcdir)/go/encoding/xml/*.go
-       $(BUILDDEPS)
-encoding/xml.lo:
-       $(BUILDPACKAGE)
-encoding/xml/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: encoding/xml/check
-
-@go_include@ exp/proxy.lo.dep
-exp/proxy.lo.dep: $(srcdir)/go/exp/proxy/*.go
-       $(BUILDDEPS)
-exp/proxy.lo:
-       $(BUILDPACKAGE)
-exp/proxy/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: exp/proxy/check
-
-@go_include@ exp/terminal.lo.dep
-exp/terminal.lo.dep: $(srcdir)/go/exp/terminal/*.go
-       $(BUILDDEPS)
-exp/terminal.lo:
-       $(BUILDPACKAGE)
-exp/terminal/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: exp/terminal/check
-
-@go_include@ html/template.lo.dep
-html/template.lo.dep: $(srcdir)/go/html/template/*.go
-       $(BUILDDEPS)
-html/template.lo:
-       $(BUILDPACKAGE)
-html/template/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: html/template/check
-
-@go_include@ go/ast.lo.dep
-go/ast.lo.dep: $(srcdir)/go/go/ast/*.go
-       $(BUILDDEPS)
-go/ast.lo:
-       $(BUILDPACKAGE)
-go/ast/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/ast/check
-
-@go_include@ go/build.lo.dep
-go/build.lo.dep: $(srcdir)/go/go/build/*.go
-       $(BUILDDEPS)
-go/build.lo:
-       $(BUILDPACKAGE)
-go/build/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/build/check
-
-@go_include@ go/constant.lo.dep
-go/constant.lo.dep: $(srcdir)/go/go/constant/*.go
-       $(BUILDDEPS)
-go/constant.lo:
-       $(BUILDPACKAGE)
-go/constant/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/constant/check
-
-@go_include@ go/doc.lo.dep
-go/doc.lo.dep: $(srcdir)/go/go/doc/*.go
-       $(BUILDDEPS)
-go/doc.lo:
-       $(BUILDPACKAGE)
-go/doc/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/doc/check
-
-@go_include@ go/format.lo.dep
-go/format.lo.dep: $(srcdir)/go/go/format/*.go
-       $(BUILDDEPS)
-go/format.lo:
-       $(BUILDPACKAGE)
-go/format/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/format/check
-
-@go_include@ go/importer.lo.dep
-go/importer.lo.dep: $(srcdir)/go/go/importer/*.go
-       $(BUILDDEPS)
-go/importer.lo:
-       $(BUILDPACKAGE)
-go/importer/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/importer/check
-
-@go_include@ go/parser.lo.dep
-go/parser.lo.dep: $(srcdir)/go/go/parser/*.go
-       $(BUILDDEPS)
-go/parser.lo:
-       $(BUILDPACKAGE)
-go/parser/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/parser/check
-
-@go_include@ go/printer.lo.dep
-go/printer.lo.dep: $(srcdir)/go/go/printer/*.go
-       $(BUILDDEPS)
-go/printer.lo:
-       $(BUILDPACKAGE)
-go/printer/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/printer/check
-
-@go_include@ go/scanner.lo.dep
-go/scanner.lo.dep: $(srcdir)/go/go/scanner/*.go
-       $(BUILDDEPS)
-go/scanner.lo:
-       $(BUILDPACKAGE)
-go/scanner/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/scanner/check
-
-@go_include@ go/token.lo.dep
-go/token.lo.dep: $(srcdir)/go/go/token/*.go
-       $(BUILDDEPS)
-go/token.lo:
-       $(BUILDPACKAGE)
-go/token/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/token/check
-
-@go_include@ go/types.lo.dep
-go/types.lo.dep: $(srcdir)/go/go/types/*.go
-       $(BUILDDEPS)
-go/types.lo:
-       $(BUILDPACKAGE)
-go/types/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/types/check
-
-@go_include@ go/internal/gcimporter.lo.dep
-go/internal/gcimporter.lo.dep: $(srcdir)/go/go/internal/gcimporter/*.go
-       $(BUILDDEPS)
-go/internal/gcimporter.lo:
-       $(BUILDPACKAGE)
-go/internal/gcimporter/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/internal/gcimporter/check
-
-@go_include@ go/internal/gccgoimporter.lo.dep
-go/internal/gccgoimporter.lo.dep: $(srcdir)/go/go/internal/gccgoimporter/*.go
-       $(BUILDDEPS)
-go/internal/gccgoimporter.lo:
-       $(BUILDPACKAGE)
-go/internal/gccgoimporter/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: go/internal/gccgoimporter/check
-
-@go_include@ golang_org/x/net/http2/hpack.lo.dep
-golang_org/x/net/http2/hpack.lo.dep: $(srcdir)/go/golang_org/x/net/http2/hpack/*.go
-       $(BUILDDEPS)
-golang_org/x/net/http2/hpack.lo:
-       $(BUILDPACKAGE)
-golang_org/x/net/http2/hpack/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: golang_org/x/net/http2/hpack/check
-
-@go_include@ golang_org/x/net/lex/httplex.lo.dep
-golang_org/x/net/lex/httplex.lo.dep: $(srcdir)/go/golang_org/x/net/lex/httplex/*.go
-       $(BUILDDEPS)
-golang_org/x/net/lex/httplex.lo:
-       $(BUILDPACKAGE)
-golang_org/x/net/lex/httplex/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: golang_org/x/net/lex/httplex/check
-
-@LIBGO_IS_BSD_TRUE@@go_include@ golang_org/x/net/route.lo.dep
-@LIBGO_IS_BSD_TRUE@golang_org/x/net/route.lo.dep: $(srcdir)/go/golang_org/x/net/route/*.go
-@LIBGO_IS_BSD_TRUE@    $(BUILDDEPS)
-@LIBGO_IS_BSD_TRUE@golang_org/x/net/route.lo:
-@LIBGO_IS_BSD_TRUE@    $(BUILDPACKAGE)
-@LIBGO_IS_BSD_TRUE@golang_org/x/net/route/check: $(CHECK_DEPS)
-@LIBGO_IS_BSD_TRUE@    @$(CHECK)
-
-.PHONY: golang_org/x/net/route/check
-
-@go_include@ hash/adler32.lo.dep
-hash/adler32.lo.dep: $(srcdir)/go/hash/adler32/*.go
-       $(BUILDDEPS)
-hash/adler32.lo:
-       $(BUILDPACKAGE)
-hash/adler32/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: hash/adler32/check
-
-@go_include@ hash/crc32.lo.dep
-hash/crc32.lo.dep: $(srcdir)/go/hash/crc32/*.go
-       $(BUILDDEPS)
-hash/crc32.lo:
-       $(BUILDPACKAGE)
-hash/crc32/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: hash/crc32/check
-
-@go_include@ hash/crc64.lo.dep
-hash/crc64.lo.dep: $(srcdir)/go/hash/crc64/*.go
-       $(BUILDDEPS)
-hash/crc64.lo:
-       $(BUILDPACKAGE)
-hash/crc64/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: hash/crc64/check
-
-@go_include@ hash/fnv.lo.dep
-hash/fnv.lo.dep: $(srcdir)/go/hash/fnv/*.go
-       $(BUILDDEPS)
-hash/fnv.lo:
-       $(BUILDPACKAGE)
-hash/fnv/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: hash/fnv/check
-
-@go_include@ image/color.lo.dep
-image/color.lo.dep: $(srcdir)/go/image/color/*.go
-       $(BUILDDEPS)
-image/color.lo:
-       $(BUILDPACKAGE)
-image/color/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/color/check
-
-@go_include@ image/color/palette.lo.dep
-image/color/palette.lo.dep: $(srcdir)/go/image/color/palette/*.go
-       $(BUILDDEPS)
-image/color/palette.lo:
-       $(BUILDPACKAGE)
-image/color/palette/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/color/palette/check
-
-@go_include@ image/draw.lo.dep
-image/draw.lo.dep: $(srcdir)/go/image/draw/*.go
-       $(BUILDDEPS)
-image/draw.lo:
-       $(BUILDPACKAGE)
-image/draw/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/draw/check
-
-@go_include@ image/gif.lo.dep
-image/gif.lo.dep: $(srcdir)/go/image/gif/*.go
-       $(BUILDDEPS)
-image/gif.lo:
-       $(BUILDPACKAGE)
-image/gif/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/gif/check
-
-@go_include@ image/internal/imageutil.lo.dep
-image/internal/imageutil.lo.dep: $(srcdir)/go/image/internal/imageutil/*.go
-       $(BUILDDEPS)
-image/internal/imageutil.lo:
-       $(BUILDPACKAGE)
-image/internal/imageutil/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/internal/imageutil/check
-
-@go_include@ image/jpeg.lo.dep
-image/jpeg.lo.dep: $(srcdir)/go/image/jpeg/*.go
-       $(BUILDDEPS)
-image/jpeg.lo:
-       $(BUILDPACKAGE)
-image/jpeg/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/jpeg/check
-
-@go_include@ image/png.lo.dep
-image/png.lo.dep: $(srcdir)/go/image/png/*.go
-       $(BUILDDEPS)
-image/png.lo:
-       $(BUILDPACKAGE)
-image/png/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: image/png/check
-
-@go_include@ index/suffixarray.lo.dep
-index/suffixarray.lo.dep: $(srcdir)/go/index/suffixarray/*.go
-       $(BUILDDEPS)
-index/suffixarray.lo:
-       $(BUILDPACKAGE)
-index/suffixarray/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: index/suffixarray/check
-
-@go_include@ internal/nettrace.lo.dep
-internal/nettrace.lo.dep: $(srcdir)/go/internal/nettrace/*.go
-       $(BUILDDEPS)
-internal/nettrace.lo:
-       $(BUILDPACKAGE)
-internal/nettrace/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: internal/nettrace/check
-
-@go_include@ internal/race.lo.dep
-internal/race.lo.dep: $(srcdir)/go/internal/race/*.go
-       $(BUILDDEPS)
-internal/race.lo:
-       $(BUILDPACKAGE)
-internal/race/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: internal/race/check
-
-@go_include@ internal/singleflight.lo.dep
-internal/singleflight.lo.dep: $(srcdir)/go/internal/singleflight/*.go
-       $(BUILDDEPS)
-internal/singleflight.lo:
-       $(BUILDPACKAGE)
-internal/singleflight/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: internal/singleflight/check
-
-@go_include@ internal/syscall/unix.lo.dep
-internal/syscall/unix.lo.dep: $(srcdir)/go/internal/syscall/unix/*.go
-       $(BUILDDEPS)
-internal/syscall/unix.lo:
-       $(BUILDPACKAGE)
-internal/syscall/unix/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: internal/syscall/unix/check
-
-@go_include@ internal/testenv.lo.dep
-internal/testenv.lo.dep: $(srcdir)/go/internal/testenv/*.go
-       $(BUILDDEPS)
-internal/testenv.lo:
-       $(BUILDPACKAGE)
-internal/testenv/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: internal/testenv/check
-
-@go_include@ internal/trace.lo.dep
-internal/trace.lo.dep: $(srcdir)/go/internal/trace/*.go
-       $(BUILDDEPS)
-internal/trace.lo:
-       $(BUILDPACKAGE)
-internal/trace/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: internal/trace/check
-
-@go_include@ io/ioutil.lo.dep
-io/ioutil.lo.dep: $(srcdir)/go/io/ioutil/*.go
-       $(BUILDDEPS)
-io/ioutil.lo:
-       $(BUILDPACKAGE)
-io/ioutil/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: io/ioutil/check
-
-@go_include@ log/syslog.lo.dep
-log/syslog.lo.dep: $(srcdir)/go/log/syslog/*.go
-       $(BUILDDEPS)
-log/syslog.lo:
-       $(BUILDPACKAGE)
-log/syslog/syslog_c.lo: go/log/syslog/syslog_c.c runtime.inc log/syslog.lo
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/strings/indexbyte.c
+
+# Use a C function with a fixed number of arguments to call a C
+# varargs function.
+log/syslog/syslog_c.lo: go/log/syslog/syslog_c.c runtime.inc
        @$(MKDIR_P) log/syslog
        $(LTCOMPILE) -c -o $@ $(srcdir)/go/log/syslog/syslog_c.c
-log/syslog/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: log/syslog/check
-
-@go_include@ math/big.lo.dep
-math/big.lo.dep: $(srcdir)/go/math/big/*.go
-       $(BUILDDEPS)
-math/big.lo:
-       $(BUILDPACKAGE)
-math/big/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: math/big/check
-
-@go_include@ math/cmplx.lo.dep
-math/cmplx.lo.dep: $(srcdir)/go/math/cmplx/*.go
-       $(BUILDDEPS)
-math/cmplx.lo:
-       $(BUILDPACKAGE)
-math/cmplx/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: math/cmplx/check
-
-@go_include@ math/rand.lo.dep
-math/rand.lo.dep: $(srcdir)/go/math/rand/*.go
-       $(BUILDDEPS)
-math/rand.lo:
-       $(BUILDPACKAGE)
-math/rand/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: math/rand/check
-
-@go_include@ mime/multipart.lo.dep
-mime/multipart.lo.dep: $(srcdir)/go/mime/multipart/*.go
-       $(BUILDDEPS)
-mime/multipart.lo:
-       $(BUILDPACKAGE)
-mime/multipart/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: mime/multipart/check
-
-@go_include@ mime/quotedprintable.lo.dep
-mime/quotedprintable.lo.dep: $(srcdir)/go/mime/quotedprintable/*.go
-       $(BUILDDEPS)
-mime/quotedprintable.lo:
-       $(BUILDPACKAGE)
-mime/quotedprintable/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: mime/quotedprintable/check
-
-@go_include@ net/http.lo.dep
-net/http.lo.dep: $(srcdir)/go/net/http/*.go
-       $(BUILDDEPS)
-net/http.lo:
-       $(BUILDPACKAGE)
-net/http/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/http/check
-
-@go_include@ net/mail.lo.dep
-net/mail.lo.dep: $(srcdir)/go/net/mail/*.go
-       $(BUILDDEPS)
-net/mail.lo:
-       $(BUILDPACKAGE)
-net/mail/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/mail/check
-
-@go_include@ net/rpc.lo.dep
-net/rpc.lo.dep: $(srcdir)/go/net/rpc/*.go
-       $(BUILDDEPS)
-net/rpc.lo:
-       $(BUILDPACKAGE)
-net/rpc/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/rpc/check
-
-@go_include@ net/smtp.lo.dep
-net/smtp.lo.dep: $(srcdir)/go/net/smtp/*.go
-       $(BUILDDEPS)
-net/smtp.lo:
-       $(BUILDPACKAGE)
-net/smtp/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/smtp/check
-
-@go_include@ net/url.lo.dep
-net/url.lo.dep: $(srcdir)/go/net/url/*.go
-       $(BUILDDEPS)
-net/url.lo:
-       $(BUILDPACKAGE)
-net/url/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/url/check
-
-@go_include@ net/textproto.lo.dep
-net/textproto.lo.dep: $(srcdir)/go/net/textproto/*.go
-       $(BUILDDEPS)
-net/textproto.lo:
-       $(BUILDPACKAGE)
-net/textproto/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/textproto/check
-
-@go_include@ net/http/cgi.lo.dep
-net/http/cgi.lo.dep: $(srcdir)/go/net/http/cgi/*.go
-       $(BUILDDEPS)
-net/http/cgi.lo:
-       $(BUILDPACKAGE)
-net/http/cgi/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/http/cgi/check
-
-@go_include@ net/http/cookiejar.lo.dep
-net/http/cookiejar.lo.dep: $(srcdir)/go/net/http/cookiejar/*.go
-       $(BUILDDEPS)
-net/http/cookiejar.lo:
-       $(BUILDPACKAGE)
-net/http/cookiejar/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/http/cookiejar/check
-
-@go_include@ net/http/fcgi.lo.dep
-net/http/fcgi.lo.dep: $(srcdir)/go/net/http/fcgi/*.go
-       $(BUILDDEPS)
-net/http/fcgi.lo:
-       $(BUILDPACKAGE)
-net/http/fcgi/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/http/fcgi/check
-
-@go_include@ net/http/httptest.lo.dep
-net/http/httptest.lo.dep: $(srcdir)/go/net/http/httptest/*.go
-       $(BUILDDEPS)
-net/http/httptest.lo:
-       $(BUILDPACKAGE)
-net/http/httptest/check: $(check_deps)
-       @$(CHECK)
-.PHONY: net/http/httptest/check
-
-@go_include@ net/http/httptrace.lo.dep
-net/http/httptrace.lo.dep: $(srcdir)/go/net/http/httptrace/*.go
-       $(BUILDDEPS)
-net/http/httptrace.lo:
-       $(BUILDPACKAGE)
-net/http/httptrace/check: $(check_deps)
-       @$(CHECK)
-.PHONY: net/http/httptrace/check
-
-@go_include@ net/http/httputil.lo.dep
-net/http/httputil.lo.dep: $(srcdir)/go/net/http/httputil/*.go
-       $(BUILDDEPS)
-net/http/httputil.lo:
-       $(BUILDPACKAGE)
-net/http/httputil/check: $(check_deps)
-       @$(CHECK)
-.PHONY: net/http/httputil/check
-
-@go_include@ net/http/internal.lo.dep
-net/http/internal.lo.dep: $(srcdir)/go/net/http/internal/*.go
-       $(BUILDDEPS)
-net/http/internal.lo:
-       $(BUILDPACKAGE)
-net/http/internal/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/http/internal/check
-
-@go_include@ net/http/pprof.lo.dep
-net/http/pprof.lo.dep: $(srcdir)/go/net/http/pprof/*.go
-       $(BUILDDEPS)
-net/http/pprof.lo:
-       $(BUILDPACKAGE)
-net/http/pprof/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/http/pprof/check
-
-@go_include@ net/internal/socktest.lo.dep
-net/internal/socktest.lo.dep: $(srcdir)/go/net/internal/socktest/*.go
-       $(BUILDDEPS)
-net/internal/socktest.lo:
-       $(BUILDPACKAGE)
-net/internal/socktest/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/internal/socktest/check
-
-@go_include@ net/rpc/jsonrpc.lo.dep
-net/rpc/jsonrpc.lo.dep: $(srcdir)/go/net/rpc/jsonrpc/*.go
-       $(BUILDDEPS)
-net/rpc/jsonrpc.lo:
-       $(BUILDPACKAGE)
-net/rpc/jsonrpc/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: net/rpc/jsonrpc/check
-
-@go_include@ old/regexp.lo.dep
-old/regexp.lo.dep: $(srcdir)/go/old/regexp/*.go
-       $(BUILDDEPS)
-old/regexp.lo:
-       $(BUILDPACKAGE)
-old/regexp/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: old/regexp/check
-
-@go_include@ old/template.lo.dep
-old/template.lo.dep: $(srcdir)/go/old/template/*.go
-       $(BUILDDEPS)
-old/template.lo:
-       $(BUILDPACKAGE)
-old/template/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: old/template/check
-
-@go_include@ os/exec.lo.dep
-os/exec.lo.dep: $(srcdir)/go/os/exec/*.go
-       $(BUILDDEPS)
-os/exec.lo:
-       $(BUILDPACKAGE)
-os/exec/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: os/exec/check
-
-@go_include@ os/signal.lo.dep
-os/signal.lo.dep: $(srcdir)/go/os/signal/*.go
-       $(BUILDDEPS)
-os/signal.lo:
-       $(BUILDPACKAGE)
-os/signal/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: os/signal/check
-
-@go_include@ os/user.lo.dep
-os/user.lo.dep: $(srcdir)/go/os/user/*.go
-       $(BUILDDEPS)
-os/user.lo:
-       $(BUILDPACKAGE)
-os/user/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: os/user/check
-
-@go_include@ path/filepath.lo.dep
-path/filepath.lo.dep: $(srcdir)/go/path/filepath/*.go
-       $(BUILDDEPS)
-path/filepath.lo:
-       $(BUILDPACKAGE)
-path/filepath/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: path/filepath/check
-
-@go_include@ regexp/syntax.lo.dep
-regexp/syntax.lo.dep: $(srcdir)/go/regexp/syntax/*.go
-       $(BUILDDEPS)
-regexp/syntax.lo:
-       $(BUILDPACKAGE)
-regexp/syntax/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: regexp/syntax/check
-
-@go_include@ runtime/debug.lo.dep
-runtime/debug.lo.dep: $(srcdir)/go/runtime/debug/*.go
-       $(BUILDDEPS)
-runtime/debug.lo:
-       $(BUILDPACKAGE)
-runtime/debug/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: runtime/debug/check
-
-@go_include@ runtime/pprof.lo.dep
-runtime/pprof.lo.dep: $(srcdir)/go/runtime/pprof/*.go
-       $(BUILDDEPS)
-runtime/pprof.lo:
-       $(BUILDPACKAGE)
-runtime/pprof/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: runtime/pprof/check
-
-@go_include@ runtime/internal/atomic.lo.dep
-runtime/internal/atomic.lo.dep: $(srcdir)/go/runtime/internal/atomic/*.go
-       $(BUILDDEPS)
-runtime/internal/atomic.lo:
-       $(BUILDPACKAGE)
-runtime/internal/atomic_c.lo: go/runtime/internal/atomic/atomic.c runtime.inc runtime/internal/atomic.lo
+
+# The interface to libffi from the reflect package is written in C.
+reflect/makefunc_ffi_c.lo: go/reflect/makefunc_ffi_c.c runtime.inc
+       @$(MKDIR_P) reflect
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/reflect/makefunc_ffi_c.c
+
+# The atomic functions are written in C.
+runtime/internal/atomic_c.lo: go/runtime/internal/atomic/atomic.c runtime.inc
+       @$(MKDIR_P) runtime/internal
        $(LTCOMPILE) -c -o $@ $(srcdir)/go/runtime/internal/atomic/atomic.c
-runtime/internal/atomic/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: runtime/internal/atomic/check
-
-@go_include@ runtime/internal/sys.lo.dep
-runtime/internal/sys.lo.dep: $(srcdir)/go/runtime/internal/sys/*.go
-       $(BUILDDEPS)
-runtime/internal/sys.lo:
-       $(BUILDPACKAGE)
-runtime/internal/sys/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: runtime/internal/sys/check
-
-@go_include@ sync/atomic.lo.dep
-sync/atomic.lo.dep: $(srcdir)/go/sync/atomic/*.go
-       $(BUILDDEPS)
-sync/atomic.lo:
-       $(BUILDPACKAGE)
-sync/atomic_c.lo: go/sync/atomic/atomic.c runtime.inc sync/atomic.lo
+sync/atomic_c.lo: go/sync/atomic/atomic.c runtime.inc
+       @$(MKDIR_P) sync
        $(LTCOMPILE) -c -o $@ $(srcdir)/go/sync/atomic/atomic.c
-sync/atomic/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: sync/atomic/check
-
-@go_include@ text/scanner.lo.dep
-text/scanner.lo.dep: $(srcdir)/go/text/scanner/*.go
-       $(BUILDDEPS)
-text/scanner.lo:
-       $(BUILDPACKAGE)
-text/scanner/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: text/scanner/check
-
-@go_include@ text/tabwriter.lo.dep
-text/tabwriter.lo.dep: $(srcdir)/go/text/tabwriter/*.go
-       $(BUILDDEPS)
-text/tabwriter.lo:
-       $(BUILDPACKAGE)
-text/tabwriter/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: text/tabwriter/check
-
-@go_include@ text/template.lo.dep
-text/template.lo.dep: $(srcdir)/go/text/template/*.go
-       $(BUILDDEPS)
-text/template.lo:
-       $(BUILDPACKAGE)
-text/template/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: text/template/check
-
-@go_include@ text/template/parse.lo.dep
-text/template/parse.lo.dep: $(srcdir)/go/text/template/parse/*.go
-       $(BUILDDEPS)
-text/template/parse.lo:
-       $(BUILDPACKAGE)
-text/template/parse/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: text/template/parse/check
-
-@go_include@ testing/iotest.lo.dep
-testing/iotest.lo.dep: $(srcdir)/go/testing/iotest/*.go
-       $(BUILDDEPS)
-testing/iotest.lo:
-       $(BUILDPACKAGE)
-testing/iotest/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: testing/iotest/check
-
-@go_include@ testing/quick.lo.dep
-testing/quick.lo.dep: $(srcdir)/go/testing/quick/*.go
-       $(BUILDDEPS)
-testing/quick.lo:
-       $(BUILDPACKAGE)
-testing/quick/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: testing/quick/check
-
-@go_include@ unicode/utf16.lo.dep
-unicode/utf16.lo.dep: $(srcdir)/go/unicode/utf16/*.go
-       $(BUILDDEPS)
-unicode/utf16.lo:
-       $(BUILDPACKAGE)
-unicode/utf16/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: unicode/utf16/check
-
-@go_include@ unicode/utf8.lo.dep
-unicode/utf8.lo.dep: $(srcdir)/go/unicode/utf8/*.go
-       $(BUILDDEPS)
-unicode/utf8.lo:
-       $(BUILDPACKAGE)
-unicode/utf8/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: unicode/utf8/check
-
-@go_include@ syscall.lo.dep
-syscall.lo.dep: $(srcdir)/go/syscall/*.go $(extra_go_files_syscall)
-       $(BUILDDEPS)
-syscall.lo:
-       $(BUILDPACKAGE)
+
+# A few syscall functions are written in C.
 syscall/clone_linux.lo: go/syscall/clone_linux.c runtime.inc
        @$(MKDIR_P) syscall
-       $(LTCOMPILE) -c -o $@ $<
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/clone_linux.c
 syscall/errno.lo: go/syscall/errno.c runtime.inc
        @$(MKDIR_P) syscall
-       $(LTCOMPILE) -c -o $@ $<
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/errno.c
 syscall/signame.lo: go/syscall/signame.c runtime.inc
        @$(MKDIR_P) syscall
-       $(LTCOMPILE) -c -o $@ $<
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/signame.c
 syscall/wait.lo: go/syscall/wait.c runtime.inc
        @$(MKDIR_P) syscall
-       $(LTCOMPILE) -c -o $@ $<
-syscall/check: $(CHECK_DEPS)
-       @$(CHECK)
-.PHONY: syscall/check
-
-bufio.gox: bufio.lo
-       $(BUILDGOX)
-bytes.gox: bytes.lo
-       $(BUILDGOX)
-context.gox: context.lo
-       $(BUILDGOX)
-crypto.gox: crypto.lo
-       $(BUILDGOX)
-encoding.gox: encoding.lo
-       $(BUILDGOX)
-errors.gox: errors.lo
-       $(BUILDGOX)
-expvar.gox: expvar.lo
-       $(BUILDGOX)
-flag.gox: flag.lo
-       $(BUILDGOX)
-fmt.gox: fmt.lo
-       $(BUILDGOX)
-hash.gox: hash.lo
-       $(BUILDGOX)
-html.gox: html.lo
-       $(BUILDGOX)
-image.gox: image.lo
-       $(BUILDGOX)
-io.gox: io.lo
-       $(BUILDGOX)
-log.gox: log.lo
-       $(BUILDGOX)
-math.gox: math.lo
-       $(BUILDGOX)
-mime.gox: mime.lo
-       $(BUILDGOX)
-net.gox: net.lo
-       $(BUILDGOX)
-os.gox: os.lo
-       $(BUILDGOX)
-path.gox: path.lo
-       $(BUILDGOX)
-reflect.gox: reflect-go.lo
-       $(BUILDGOX)
-regexp.gox: regexp.lo
-       $(BUILDGOX)
-runtime.gox: runtime-go.lo
-       $(BUILDGOX)
-sort.gox: sort.lo
-       $(BUILDGOX)
-strconv.gox: strconv.lo
-       $(BUILDGOX)
-strings.gox: strings.lo
-       $(BUILDGOX)
-sync.gox: sync.lo
-       $(BUILDGOX)
-syscall.gox: syscall.lo
-       $(BUILDGOX)
-testing.gox: testing.lo
-       $(BUILDGOX)
-time.gox: time-go.lo
-       $(BUILDGOX)
-unicode.gox: unicode.lo
-       $(BUILDGOX)
-
-archive/tar.gox: archive/tar.lo
-       $(BUILDGOX)
-archive/zip.gox: archive/zip.lo
-       $(BUILDGOX)
-
-compress/bzip2.gox: compress/bzip2.lo
-       $(BUILDGOX)
-compress/flate.gox: compress/flate.lo
-       $(BUILDGOX)
-compress/gzip.gox: compress/gzip.lo
-       $(BUILDGOX)
-compress/lzw.gox: compress/lzw.lo
-       $(BUILDGOX)
-compress/zlib.gox: compress/zlib.lo
-       $(BUILDGOX)
-
-container/heap.gox: container/heap.lo
-       $(BUILDGOX)
-container/list.gox: container/list.lo
-       $(BUILDGOX)
-container/ring.gox: container/ring.lo
-       $(BUILDGOX)
-
-crypto/aes.gox: crypto/aes.lo
-       $(BUILDGOX)
-crypto/cipher.gox: crypto/cipher.lo
-       $(BUILDGOX)
-crypto/des.gox: crypto/des.lo
-       $(BUILDGOX)
-crypto/dsa.gox: crypto/dsa.lo
-       $(BUILDGOX)
-crypto/ecdsa.gox: crypto/ecdsa.lo      
-       $(BUILDGOX)
-crypto/elliptic.gox: crypto/elliptic.lo
-       $(BUILDGOX)
-crypto/hmac.gox: crypto/hmac.lo
-       $(BUILDGOX)
-crypto/md5.gox: crypto/md5.lo
-       $(BUILDGOX)
-crypto/rand.gox: crypto/rand.lo
-       $(BUILDGOX)
-crypto/rc4.gox: crypto/rc4.lo
-       $(BUILDGOX)
-crypto/rsa.gox: crypto/rsa.lo
-       $(BUILDGOX)
-crypto/sha1.gox: crypto/sha1.lo
-       $(BUILDGOX)
-crypto/sha256.gox: crypto/sha256.lo
-       $(BUILDGOX)
-crypto/sha512.gox: crypto/sha512.lo
-       $(BUILDGOX)
-crypto/subtle.gox: crypto/subtle.lo
-       $(BUILDGOX)
-crypto/tls.gox: crypto/tls.lo
-       $(BUILDGOX)
-crypto/x509.gox: crypto/x509.lo
-       $(BUILDGOX)
-
-crypto/x509/pkix.gox: crypto/x509/pkix.lo
-       $(BUILDGOX)
-
-database/sql.gox: database/sql.lo
-       $(BUILDGOX)
-
-database/sql/driver.gox: database/sql/driver.lo
-       $(BUILDGOX)
-
-debug/dwarf.gox: debug/dwarf.lo
-       $(BUILDGOX)
-debug/elf.gox: debug/elf.lo
-       $(BUILDGOX)
-debug/gosym.gox: debug/gosym.lo
-       $(BUILDGOX)
-debug/macho.gox: debug/macho.lo
-       $(BUILDGOX)
-debug/pe.gox: debug/pe.lo
-       $(BUILDGOX)
-debug/plan9obj.gox: debug/plan9obj.lo
-       $(BUILDGOX)
-
-encoding/ascii85.gox: encoding/ascii85.lo
-       $(BUILDGOX)
-encoding/asn1.gox: encoding/asn1.lo
-       $(BUILDGOX)
-encoding/base32.gox: encoding/base32.lo
-       $(BUILDGOX)
-encoding/base64.gox: encoding/base64.lo
-       $(BUILDGOX)
-encoding/binary.gox: encoding/binary.lo
-       $(BUILDGOX)
-encoding/csv.gox: encoding/csv.lo
-       $(BUILDGOX)
-encoding/gob.gox: encoding/gob.lo
-       $(BUILDGOX)
-encoding/hex.gox: encoding/hex.lo
-       $(BUILDGOX)
-encoding/json.gox: encoding/json.lo
-       $(BUILDGOX)
-encoding/pem.gox: encoding/pem.lo
-       $(BUILDGOX)
-encoding/xml.gox: encoding/xml.lo
-       $(BUILDGOX)
-
-exp/proxy.gox: exp/proxy.lo
-       $(BUILDGOX)
-exp/terminal.gox: exp/terminal.lo
-       $(BUILDGOX)
-
-html/template.gox: html/template.lo
-       $(BUILDGOX)
-
-go/ast.gox: go/ast.lo
-       $(BUILDGOX)
-go/build.gox: go/build.lo
-       $(BUILDGOX)
-go/constant.gox: go/constant.lo
-       $(BUILDGOX)
-go/doc.gox: go/doc.lo
-       $(BUILDGOX)
-go/format.gox: go/format.lo
-       $(BUILDGOX)
-go/importer.gox: go/importer.lo
-       $(BUILDGOX)
-go/parser.gox: go/parser.lo
-       $(BUILDGOX)
-go/printer.gox: go/printer.lo
-       $(BUILDGOX)
-go/scanner.gox: go/scanner.lo
-       $(BUILDGOX)
-go/token.gox: go/token.lo
-       $(BUILDGOX)
-go/types.gox: go/types.lo
-       $(BUILDGOX)
-
-go/internal/gcimporter.gox: go/internal/gcimporter.lo
-       $(BUILDGOX)
-go/internal/gccgoimporter.gox: go/internal/gccgoimporter.lo
-       $(BUILDGOX)
-
-golang_org/x/net/http2/hpack.gox: golang_org/x/net/http2/hpack.lo
-       $(BUILDGOX)
-
-golang_org/x/net/lex/httplex.gox: golang_org/x/net/lex/httplex.lo
-       $(BUILDGOX)
-
-@LIBGO_IS_BSD_TRUE@golang_org/x/net/route.gox: golang_org/x/net/route.lo
-@LIBGO_IS_BSD_TRUE@    $(BUILDGOX)
-
-hash/adler32.gox: hash/adler32.lo
-       $(BUILDGOX)
-hash/crc32.gox: hash/crc32.lo
-       $(BUILDGOX)
-hash/crc64.gox: hash/crc64.lo
-       $(BUILDGOX)
-hash/fnv.gox: hash/fnv.lo
-       $(BUILDGOX)
-
-image/color.gox: image/color.lo
-       $(BUILDGOX)
-image/draw.gox: image/draw.lo
-       $(BUILDGOX)
-image/gif.gox: image/gif.lo
-       $(BUILDGOX)
-image/internal/imageutil.gox: image/internal/imageutil.lo
-       $(BUILDGOX)
-image/jpeg.gox: image/jpeg.lo
-       $(BUILDGOX)
-image/png.gox: image/png.lo
-       $(BUILDGOX)
-
-image/color/palette.gox: image/color/palette.lo
-       $(BUILDGOX)
-
-index/suffixarray.gox: index/suffixarray.lo
-       $(BUILDGOX)
-
-internal/nettrace.gox: internal/nettrace.lo
-       $(BUILDGOX)
-internal/race.gox: internal/race.lo
-       $(BUILDGOX)
-internal/singleflight.gox: internal/singleflight.lo
-       $(BUILDGOX)
-internal/syscall/unix.gox: internal/syscall/unix.lo
-       $(BUILDGOX)
-internal/testenv.gox: internal/testenv.lo
-       $(BUILDGOX)
-internal/trace.gox: internal/trace.lo
-       $(BUILDGOX)
-
-io/ioutil.gox: io/ioutil.lo
-       $(BUILDGOX)
-
-log/syslog.gox: log/syslog.lo
-       $(BUILDGOX)
-
-math/big.gox: math/big.lo
-       $(BUILDGOX)
-math/cmplx.gox: math/cmplx.lo
-       $(BUILDGOX)
-math/rand.gox: math/rand.lo
-       $(BUILDGOX)
-
-mime/multipart.gox: mime/multipart.lo
-       $(BUILDGOX)
-mime/quotedprintable.gox: mime/quotedprintable.lo
-       $(BUILDGOX)
-
-net/http.gox: net/http.lo
-       $(BUILDGOX)
-net/mail.gox: net/mail.lo
-       $(BUILDGOX)
-net/rpc.gox: net/rpc.lo
-       $(BUILDGOX)
-net/smtp.gox: net/smtp.lo
-       $(BUILDGOX)
-net/textproto.gox: net/textproto.lo
-       $(BUILDGOX)
-net/url.gox: net/url.lo
-       $(BUILDGOX)
-
-net/http/cgi.gox: net/http/cgi.lo
-       $(BUILDGOX)
-net/http/cookiejar.gox: net/http/cookiejar.lo
-       $(BUILDGOX)
-net/http/fcgi.gox: net/http/fcgi.lo
-       $(BUILDGOX)
-net/http/httptest.gox: net/http/httptest.lo
-       $(BUILDGOX)
-net/http/httptrace.gox: net/http/httptrace.lo
-       $(BUILDGOX)
-net/http/httputil.gox: net/http/httputil.lo
-       $(BUILDGOX)
-net/http/pprof.gox: net/http/pprof.lo
-       $(BUILDGOX)
-
-net/http/internal.gox: net/http/internal.lo
-       $(BUILDGOX)
-
-net/internal/socktest.gox: net/internal/socktest.lo
-       $(BUILDGOX)
-
-net/rpc/jsonrpc.gox: net/rpc/jsonrpc.lo
-       $(BUILDGOX)
-
-old/regexp.gox: old/regexp.lo
-       $(BUILDGOX)
-old/template.gox: old/template.lo
-       $(BUILDGOX)
-
-os/exec.gox: os/exec.lo
-       $(BUILDGOX)
-os/signal.gox: os/signal.lo
-       $(BUILDGOX)
-os/user.gox: os/user.lo
-       $(BUILDGOX)
-
-path/filepath.gox: path/filepath.lo
-       $(BUILDGOX)
-
-regexp/syntax.gox: regexp/syntax.lo
-       $(BUILDGOX)
-
-runtime/debug.gox: runtime/debug.lo
-       $(BUILDGOX)
-runtime/pprof.gox: runtime/pprof.lo
-       $(BUILDGOX)
-runtime/internal/atomic.gox: runtime/internal/atomic.lo
-       $(BUILDGOX)
-runtime/internal/sys.gox: runtime/internal/sys.lo
-       $(BUILDGOX)
-
-sync/atomic.gox: sync/atomic.lo
-       $(BUILDGOX)
-
-text/scanner.gox: text/scanner.lo
-       $(BUILDGOX)
-text/tabwriter.gox: text/tabwriter.lo
-       $(BUILDGOX)
-text/template.gox: text/template.lo
-       $(BUILDGOX)
-text/template/parse.gox: text/template/parse.lo
-       $(BUILDGOX)
-
-testing/iotest.gox: testing/iotest.lo
-       $(BUILDGOX)
-testing/quick.gox: testing/quick.lo
-       $(BUILDGOX)
-
-unicode/utf16.gox: unicode/utf16.lo
-       $(BUILDGOX)
-unicode/utf8.gox: unicode/utf8.lo
-       $(BUILDGOX)
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/wait.c
+
+# Build golang_org/x/net/route only on BSD systems.
+
+@LIBGO_IS_BSD_TRUE@$(eval $(call PACKAGE_template,golang_org/x/net/route)
 
 check: check-tail
 check-recursive: check-head
diff --git a/libgo/runtime/runtime.c b/libgo/runtime/runtime.c
deleted file mode 100644 (file)
index 16be089..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-// 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.
-
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include "config.h"
-
-#include "runtime.h"
-#include "arch.h"
-#include "array.h"
-
-enum {
-       maxround = sizeof(uintptr),
-};
-
-extern volatile intgo runtime_MemProfileRate
-  __asm__ (GOSYM_PREFIX "runtime.MemProfileRate");
-
-struct gotraceback_ret {
-       int32 level;
-       bool crash;
-};
-
-extern struct gotraceback_ret gotraceback(void)
-  __asm__ (GOSYM_PREFIX "runtime.gotraceback");
-
-// runtime_gotraceback is the C interface to runtime.gotraceback.
-int32
-runtime_gotraceback(bool *crash)
-{
-       struct gotraceback_ret r;
-
-       r = gotraceback();
-       if(crash != nil)
-               *crash = r.crash;
-       return r.level;
-}
-
-int32
-runtime_atoi(const byte *p, intgo len)
-{
-       int32 n;
-
-       n = 0;
-       while(len > 0 && '0' <= *p && *p <= '9') {
-               n = n*10 + *p++ - '0';
-               len--;
-       }
-       return n;
-}
-
-uint32
-runtime_fastrand1(void)
-{
-       M *m;
-       uint32 x;
-
-       m = runtime_m();
-       x = m->fastrand;
-       x += x;
-       if(x & 0x80000000L)
-               x ^= 0x88888eefUL;
-       m->fastrand = x;
-       return x;
-}
-
-int64
-runtime_cputicks(void)
-{
-#if defined(__386__) || defined(__x86_64__)
-  uint32 low, high;
-  asm("rdtsc" : "=a" (low), "=d" (high));
-  return (int64)(((uint64)high << 32) | (uint64)low);
-#elif defined (__s390__) || defined (__s390x__)
-  uint64 clock = 0;
-  /* stckf may not write the return variable in case of a clock error, so make
-     it read-write to prevent that the initialisation is optimised out.
-     Note: Targets below z9-109 will crash when executing store clock fast, i.e.
-     we don't support Go for machines older than that.  */
-  asm volatile(".insn s,0xb27c0000,%0" /* stckf */ : "+Q" (clock) : : "cc" );
-  return (int64)clock;
-#else
-  // Currently cputicks() is used in blocking profiler and to seed runtime·fastrand1().
-  // runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
-  // TODO: need more entropy to better seed fastrand1.
-  return runtime_nanotime();
-#endif
-}
-
-// Called to initialize a new m (including the bootstrap m).
-// Called on the parent thread (main thread in case of bootstrap), can allocate memory.
-void
-runtime_mpreinit(M *mp)
-{
-       int32 stacksize = 32 * 1024;    // OS X wants >=8K, Linux >=2K
-
-#ifdef SIGSTKSZ
-       if(stacksize < SIGSTKSZ)
-               stacksize = SIGSTKSZ;
-#endif
-
-       mp->gsignal = runtime_malg(stacksize, (byte**)&mp->gsignalstack, &mp->gsignalstacksize);
-       mp->gsignal->m = mp;
-}
-
-// Called to initialize a new m (including the bootstrap m).
-// Called on the new thread, can not allocate memory.
-void
-runtime_minit(void)
-{
-       M* m;
-       sigset_t sigs;
-
-       // Initialize signal handling.
-       m = runtime_m();
-       runtime_signalstack(m->gsignalstack, m->gsignalstacksize);
-       if (sigemptyset(&sigs) != 0)
-               runtime_throw("sigemptyset");
-       pthread_sigmask(SIG_SETMASK, &sigs, nil);
-}
-
-// Called from dropm to undo the effect of an minit.
-void
-runtime_unminit(void)
-{
-       runtime_signalstack(nil, 0);
-}
-
-
-void
-runtime_signalstack(byte *p, int32 n)
-{
-       stack_t st;
-
-       st.ss_sp = p;
-       st.ss_size = n;
-       st.ss_flags = 0;
-       if(p == nil)
-               st.ss_flags = SS_DISABLE;
-       if(sigaltstack(&st, nil) < 0)
-               *(int *)0xf1 = 0xf1;
-}
-
-struct debugVars       runtime_debug;
-
-void
-runtime_setdebug(struct debugVars* d) {
-  runtime_debug = *d;
-}
-
-void memclrBytes(Slice)
-     __asm__ (GOSYM_PREFIX "runtime.memclrBytes");
-
-void
-memclrBytes(Slice s)
-{
-       runtime_memclr(s.__values, s.__count);
-}
-
-int32 go_open(char *, int32, int32)
-  __asm__ (GOSYM_PREFIX "runtime.open");
-
-int32
-go_open(char *name, int32 mode, int32 perm)
-{
-  return runtime_open(name, mode, perm);
-}
-
-int32 go_read(int32, void *, int32)
-  __asm__ (GOSYM_PREFIX "runtime.read");
-
-int32
-go_read(int32 fd, void *p, int32 n)
-{
-  return runtime_read(fd, p, n);
-}
-
-int32 go_write(uintptr, void *, int32)
-  __asm__ (GOSYM_PREFIX "runtime.write");
-
-int32
-go_write(uintptr fd, void *p, int32 n)
-{
-  return runtime_write(fd, p, n);
-}
-
-int32 go_closefd(int32)
-  __asm__ (GOSYM_PREFIX "runtime.closefd");
-
-int32
-go_closefd(int32 fd)
-{
-  return runtime_close(fd);
-}
-
-intgo go_errno(void)
-  __asm__ (GOSYM_PREFIX "runtime.errno");
-
-intgo
-go_errno()
-{
-  return (intgo)errno;
-}
diff --git a/libgo/runtime/runtime_c.c b/libgo/runtime/runtime_c.c
new file mode 100644 (file)
index 0000000..16be089
--- /dev/null
@@ -0,0 +1,206 @@
+// 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.
+
+#include <errno.h>
+#include <signal.h>
+#include <unistd.h>
+
+#include "config.h"
+
+#include "runtime.h"
+#include "arch.h"
+#include "array.h"
+
+enum {
+       maxround = sizeof(uintptr),
+};
+
+extern volatile intgo runtime_MemProfileRate
+  __asm__ (GOSYM_PREFIX "runtime.MemProfileRate");
+
+struct gotraceback_ret {
+       int32 level;
+       bool crash;
+};
+
+extern struct gotraceback_ret gotraceback(void)
+  __asm__ (GOSYM_PREFIX "runtime.gotraceback");
+
+// runtime_gotraceback is the C interface to runtime.gotraceback.
+int32
+runtime_gotraceback(bool *crash)
+{
+       struct gotraceback_ret r;
+
+       r = gotraceback();
+       if(crash != nil)
+               *crash = r.crash;
+       return r.level;
+}
+
+int32
+runtime_atoi(const byte *p, intgo len)
+{
+       int32 n;
+
+       n = 0;
+       while(len > 0 && '0' <= *p && *p <= '9') {
+               n = n*10 + *p++ - '0';
+               len--;
+       }
+       return n;
+}
+
+uint32
+runtime_fastrand1(void)
+{
+       M *m;
+       uint32 x;
+
+       m = runtime_m();
+       x = m->fastrand;
+       x += x;
+       if(x & 0x80000000L)
+               x ^= 0x88888eefUL;
+       m->fastrand = x;
+       return x;
+}
+
+int64
+runtime_cputicks(void)
+{
+#if defined(__386__) || defined(__x86_64__)
+  uint32 low, high;
+  asm("rdtsc" : "=a" (low), "=d" (high));
+  return (int64)(((uint64)high << 32) | (uint64)low);
+#elif defined (__s390__) || defined (__s390x__)
+  uint64 clock = 0;
+  /* stckf may not write the return variable in case of a clock error, so make
+     it read-write to prevent that the initialisation is optimised out.
+     Note: Targets below z9-109 will crash when executing store clock fast, i.e.
+     we don't support Go for machines older than that.  */
+  asm volatile(".insn s,0xb27c0000,%0" /* stckf */ : "+Q" (clock) : : "cc" );
+  return (int64)clock;
+#else
+  // Currently cputicks() is used in blocking profiler and to seed runtime·fastrand1().
+  // runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
+  // TODO: need more entropy to better seed fastrand1.
+  return runtime_nanotime();
+#endif
+}
+
+// Called to initialize a new m (including the bootstrap m).
+// Called on the parent thread (main thread in case of bootstrap), can allocate memory.
+void
+runtime_mpreinit(M *mp)
+{
+       int32 stacksize = 32 * 1024;    // OS X wants >=8K, Linux >=2K
+
+#ifdef SIGSTKSZ
+       if(stacksize < SIGSTKSZ)
+               stacksize = SIGSTKSZ;
+#endif
+
+       mp->gsignal = runtime_malg(stacksize, (byte**)&mp->gsignalstack, &mp->gsignalstacksize);
+       mp->gsignal->m = mp;
+}
+
+// Called to initialize a new m (including the bootstrap m).
+// Called on the new thread, can not allocate memory.
+void
+runtime_minit(void)
+{
+       M* m;
+       sigset_t sigs;
+
+       // Initialize signal handling.
+       m = runtime_m();
+       runtime_signalstack(m->gsignalstack, m->gsignalstacksize);
+       if (sigemptyset(&sigs) != 0)
+               runtime_throw("sigemptyset");
+       pthread_sigmask(SIG_SETMASK, &sigs, nil);
+}
+
+// Called from dropm to undo the effect of an minit.
+void
+runtime_unminit(void)
+{
+       runtime_signalstack(nil, 0);
+}
+
+
+void
+runtime_signalstack(byte *p, int32 n)
+{
+       stack_t st;
+
+       st.ss_sp = p;
+       st.ss_size = n;
+       st.ss_flags = 0;
+       if(p == nil)
+               st.ss_flags = SS_DISABLE;
+       if(sigaltstack(&st, nil) < 0)
+               *(int *)0xf1 = 0xf1;
+}
+
+struct debugVars       runtime_debug;
+
+void
+runtime_setdebug(struct debugVars* d) {
+  runtime_debug = *d;
+}
+
+void memclrBytes(Slice)
+     __asm__ (GOSYM_PREFIX "runtime.memclrBytes");
+
+void
+memclrBytes(Slice s)
+{
+       runtime_memclr(s.__values, s.__count);
+}
+
+int32 go_open(char *, int32, int32)
+  __asm__ (GOSYM_PREFIX "runtime.open");
+
+int32
+go_open(char *name, int32 mode, int32 perm)
+{
+  return runtime_open(name, mode, perm);
+}
+
+int32 go_read(int32, void *, int32)
+  __asm__ (GOSYM_PREFIX "runtime.read");
+
+int32
+go_read(int32 fd, void *p, int32 n)
+{
+  return runtime_read(fd, p, n);
+}
+
+int32 go_write(uintptr, void *, int32)
+  __asm__ (GOSYM_PREFIX "runtime.write");
+
+int32
+go_write(uintptr fd, void *p, int32 n)
+{
+  return runtime_write(fd, p, n);
+}
+
+int32 go_closefd(int32)
+  __asm__ (GOSYM_PREFIX "runtime.closefd");
+
+int32
+go_closefd(int32 fd)
+{
+  return runtime_close(fd);
+}
+
+intgo go_errno(void)
+  __asm__ (GOSYM_PREFIX "runtime.errno");
+
+intgo
+go_errno()
+{
+  return (intgo)errno;
+}