runtime: enable precise GC checks when using stack maps
[gcc.git] / libgo / Makefile.am
index 7558aab8b9360d5a7479c718e61adcb9a023fd4f..1201cf59633a172e203d684def7af64ec03539e1 100644 (file)
@@ -13,6 +13,12 @@ if LIBGO_IS_RTEMS
 subdirs = testsuite
 endif
 
+if LIBGO_IS_DARWIN
+GO_EXPORT_SECTION_NAME = __GNU_GO.__go_export
+else
+GO_EXPORT_SECTION_NAME = .go_export
+endif
+
 SUBDIRS = ${subdirs}
 
 gcc_version := $(shell $(GOC) -dumpversion)
@@ -217,8 +223,7 @@ toolexeclibgodebug_DATA = \
        debug/gosym.gox \
        debug/macho.gox \
        debug/pe.gox \
-       debug/plan9obj.gox \
-       debug/xcoff.gox
+       debug/plan9obj.gox
 
 toolexeclibgoencodingdir = $(toolexeclibgodir)/encoding
 
@@ -394,8 +399,8 @@ toolexeclibgounicode_DATA = \
 # internal packages nothing will explicitly depend on them.
 # Force them to be built.
 noinst_DATA = \
-       golang_org/x/net/internal/nettest.gox \
-       golang_org/x/net/nettest.gox \
+       internal/x/net/internal/nettest.gox \
+       internal/x/net/nettest.gox \
        internal/testenv.gox \
        internal/trace.gox \
        net/internal/socktest.gox \
@@ -429,6 +434,9 @@ else
 if LIBGO_IS_AIX
 runtime_getncpu_file = runtime/getncpu-aix.c
 else
+if LIBGO_IS_HURD
+runtime_getncpu_file = runtime/getncpu-hurd.c
+else
 runtime_getncpu_file = runtime/getncpu-none.c
 endif
 endif
@@ -437,6 +445,7 @@ endif
 endif
 endif
 endif
+endif
 
 runtime_files = \
        runtime/aeshash.c \
@@ -472,7 +481,6 @@ runtime_files = \
        runtime/proc.c \
        runtime/runtime_c.c \
        runtime/stack.c \
-       runtime/thread.c \
        runtime/yield.c \
        $(rtems_task_variable_add_file) \
        $(runtime_getncpu_file)
@@ -532,6 +540,15 @@ s-version: Makefile
        $(SHELL) $(srcdir)/mvifdiff.sh version.go.tmp version.go
        $(STAMP) $@
 
+cpugen.go: s-cpu; @true
+s-cpu: Makefile
+       rm -f cpugen.go.tmp
+       echo "package cpu" > cpugen.go.tmp
+       echo "const CacheLinePadSize = `$(SHELL) $(srcdir)/goarch.sh $(GOARCH) cachelinesize`" >> cpugen.go.tmp
+       echo "const FunctionDescriptors = $(FUNCTION_DESCRIPTORS)" >> cpugen.go.tmp
+       $(SHELL) $(srcdir)/mvifdiff.sh cpugen.go.tmp cpugen.go
+       $(STAMP) $@
+
 objabi.go: s-objabi; @true
 s-objabi: Makefile
        rm -f objabi.go.tmp
@@ -541,11 +558,12 @@ s-objabi: Makefile
        echo 'const defaultGO386 = `sse2`' >> objabi.go.tmp
        echo 'const defaultGOARM = `5`' >> objabi.go.tmp
        echo 'const defaultGOMIPS = `hardfloat`' >> objabi.go.tmp
+       echo 'const defaultGOMIPS64 = `hardfloat`' >> objabi.go.tmp
        echo 'const defaultGOOS = runtime.GOOS' >> objabi.go.tmp
        echo 'const defaultGOARCH = runtime.GOARCH' >> objabi.go.tmp
        echo 'const defaultGO_EXTLINK_ENABLED = ``' >> objabi.go.tmp
        echo 'const version = `'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'`' >> objabi.go.tmp
-       echo 'const stackGuardMultiplier = 1' >> objabi.go.tmp
+       echo 'const stackGuardMultiplierDefault = 1' >> objabi.go.tmp
        echo 'const goexperiment = ``' >> objabi.go.tmp
        $(SHELL) $(srcdir)/mvifdiff.sh objabi.go.tmp objabi.go
        $(STAMP) $@
@@ -593,34 +611,22 @@ s-zdefaultcc: Makefile
        $(SHELL) $(srcdir)/../move-if-change zdefaultcc.go.tmp zdefaultcc.go
        $(STAMP) $@ 
 
-# _Complex_lock and _Reader_lock are Go translations of some AIX system
-# types and should not be exported back to C
-# semt is a Go translation of the C type sem_t; it fails to convert on
-# some systems and need not be exported back to C.
-# sigset conflicts with system type sigset on AIX, so we need to rename it
+# Post-process runtime.inc.raw (raw output of -fgo-c-header option when
+# compiling runtime) to prune out certain types that should not be
+# exported back to C. See comments in mkruntimeinc.sh for more details.
 runtime.inc: s-runtime-inc; @true
 s-runtime-inc: runtime.lo Makefile
-       rm -f runtime.inc.tmp2 runtime.inc.tmp3
-       grep -v "#define _" runtime.inc.tmp | grep -v "#define [cm][01234] " | grep -v "#define empty " > runtime.inc.tmp2
-       for pattern in '_[GP][a-z]' _Max _Lock _Sig _Trace _MHeap _Num; do \
-         grep "#define $$pattern" runtime.inc.tmp >> runtime.inc.tmp2; \
-       done
-       for TYPE in _Complex_lock _Reader_lock semt; do \
-         sed -e '/struct '$${TYPE}' {/,/^}/s/^.*$$//' runtime.inc.tmp2 > runtime.inc.tmp3; \
-         mv runtime.inc.tmp3 runtime.inc.tmp2; \
-       done
-       sed -e 's/sigset/sigset_go/' runtime.inc.tmp2 > runtime.inc.tmp3
-       $(SHELL) $(srcdir)/mvifdiff.sh runtime.inc.tmp3 runtime.inc
-       rm -f runtime.inc.tmp2 runtime.inc.tmp3
+       $(SHELL) $(srcdir)/mkruntimeinc.sh
+       $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime.inc runtime.inc
        $(STAMP) $@
 
-noinst_DATA += zstdpkglist.go zdefaultcc.go
+noinst_DATA += zdefaultcc.go
 
 # Generate the list of go std packages that were included in libgo
 zstdpkglist.go: s-zstdpkglist; @true
 s-zstdpkglist: Makefile
        rm -f zstdpkglist.go.tmp
-       echo 'package load' > zstdpkglist.go.tmp
+       echo 'package goroot' > 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|[a-z0-9_/]*_c\.lo||g' | sed 's|\([a-z0-9_/]*\)\.lo|"\1": true,|g' >> zstdpkglist.go.tmp
@@ -714,200 +720,23 @@ 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/internal/cipherhw \
-       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 \
-       debug/xcoff \
-       encoding \
-       encoding/ascii85 \
-       encoding/asn1 \
-       encoding/base32 \
-       encoding/base64 \
-       encoding/binary \
-       encoding/csv \
-       encoding/gob \
-       encoding/hex \
-       encoding/json \
-       encoding/pem \
-       encoding/xml \
-       errors \
-       expvar \
-       flag \
-       fmt \
-       go/ast \
-       go/build \
-       go/constant \
-       go/doc \
-       go/format \
-       go/importer \
-       go/internal/gccgoimporter \
-       go/internal/gcimporter \
-       go/internal/srcimporter \
-       go/parser \
-       go/printer \
-       go/scanner \
-       go/token \
-       go/types \
-       golang_org/x/crypto/chacha20poly1305 \
-       golang_org/x/crypto/chacha20poly1305/internal/chacha20 \
-       golang_org/x/crypto/cryptobyte \
-       golang_org/x/crypto/cryptobyte/asn1 \
-       golang_org/x/crypto/curve25519 \
-       golang_org/x/crypto/poly1305 \
-       golang_org/x/net/http2/hpack \
-       golang_org/x/net/idna \
-       golang_org/x/net/internal/nettest \
-       golang_org/x/net/lex/httplex \
-       golang_org/x/net/nettest \
-       golang_org/x/net/proxy \
-       golang_org/x/text/secure/bidirule \
-       golang_org/x/text/transform \
-       golang_org/x/text/unicode/bidi \
-       golang_org/x/text/unicode/norm \
-       golang_org/x/text/width \
-       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/poll \
-       internal/race \
-       internal/singleflight \
-       internal/syscall/unix \
-       internal/testenv \
-       internal/testlog \
-       internal/trace \
-       io \
-       io/ioutil \
-       log \
-       log/syslog \
-       math \
-       math/big \
-       math/bits \
-       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 \
-       os \
-       os/exec \
-       os/signal \
-       os/signal/internal/pty \
-       os/user \
-       path \
-       path/filepath \
-       reflect \
-       regexp \
-       regexp/syntax \
-       runtime \
-       runtime/debug \
-       runtime/internal/atomic \
-       runtime/internal/sys \
-       runtime/pprof \
-       runtime/pprof/internal/profile \
-       runtime/trace \
-       sort \
-       strconv \
-       strings \
-       sync \
-       sync/atomic \
-       syscall \
-       testing \
-       testing/internal/testdeps \
-       testing/iotest \
-       testing/quick \
-       text/scanner \
-       text/tabwriter \
-       text/template \
-       text/template/parse \
-       time \
-       unicode \
-       unicode/utf16 \
-       unicode/utf8
+PACKAGES = $(shell cat $(srcdir)/libgo-packages.txt)
 
 libgo_go_objs = \
        $(addsuffix .lo,$(PACKAGES)) \
-       bytes/index.lo \
+       internal/bytealg/bytealg.lo \
        reflect/makefunc_ffi_c.lo \
-       strings/index.lo \
        $(syscall_lib_clone_lo) \
        syscall/errno.lo \
        syscall/signame.lo \
        syscall/wait.lo \
-       $(golang_org_x_net_lif_lo) \
-       $(golang_org_x_net_route_lo) \
+       $(internal_x_net_lif_lo) \
+       $(internal_x_net_route_lo) \
        log/syslog/syslog_c.lo \
        $(os_lib_inotify_lo) \
        runtime/internal/atomic_c.lo \
-       sync/atomic_c.lo
+       sync/atomic_c.lo \
+       internal/cpu/cpu_gccgo.lo
 
 libgo_ldflags = \
        -version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
@@ -939,37 +768,7 @@ libgolibbegin_a_SOURCES = \
 
 libgolibbegin_a_CFLAGS = $(AM_CFLAGS) -fPIC
 
-GOTOOL_PACKAGES = \
-       cmd/go/internal/base \
-       cmd/go/internal/bug \
-       cmd/go/internal/cache \
-       cmd/go/internal/cfg \
-       cmd/go/internal/clean \
-       cmd/go/internal/cmdflag \
-       cmd/go/internal/doc \
-       cmd/go/internal/envcmd \
-       cmd/go/internal/fix \
-       cmd/go/internal/fmtcmd \
-       cmd/go/internal/generate \
-       cmd/go/internal/get \
-       cmd/go/internal/help \
-       cmd/go/internal/list \
-       cmd/go/internal/load \
-       cmd/go/internal/run \
-       cmd/go/internal/str \
-       cmd/go/internal/test \
-       cmd/go/internal/tool \
-       cmd/go/internal/version \
-       cmd/go/internal/vet \
-       cmd/go/internal/web \
-       cmd/go/internal/work \
-       cmd/internal/browser \
-       cmd/internal/buildid \
-       cmd/internal/edit \
-       cmd/internal/objabi \
-       cmd/internal/test2json \
-       cmd/vet/internal/cfg \
-       cmd/vet/internal/whitelist
+GOTOOL_PACKAGES = $(shell cat $(srcdir)/gotool-packages.txt)
 
 libgotool_a_SOURCES =
 libgotool_a_DEPENDENCIES = $(addsuffix .lo,$(GOTOOL_PACKAGES))
@@ -1015,7 +814,7 @@ 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|golang_org|vendor/golang_org|'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
+       $(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//'` $($(subst -,_,$(subst .,_,$(subst /,_,$@)))_GOCFLAGS) -o $@ $$files
 
 # How to build a .gox file from a .lo file.
 # Matching .o file can either be in the same directory as the .lo (non-PIC
@@ -1025,7 +824,7 @@ BUILDGOX = \
        if test ! -f $$f; then \
          f="$(basename $(<D)/.libs/$(<F)).o"; \
        fi; \
-       $(OBJCOPY) -j .go_export $$f $@.tmp; \
+       $(OBJCOPY) -j $(GO_EXPORT_SECTION_NAME) $$f $@.tmp; \
        $(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
 
 GOTESTFLAGS =
@@ -1156,7 +955,7 @@ extra_go_files_syscall = \
 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_lo_GOCFLAGS = -fgo-c-header=runtime.inc.raw -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
@@ -1179,6 +978,12 @@ runtime_pprof_check_GOCFLAGS = -static-libgo -fno-inline
 extra_go_files_runtime_internal_sys = version.go
 runtime/internal/sys.lo.dep: $(extra_go_files_runtime_internal_sys)
 
+extra_go_files_internal_cpu = cpugen.go
+internal/cpu.lo.dep: $(extra_go_files_internal_cpu)
+
+extra_go_files_internal_goroot = zstdpkglist.go
+internal/goroot.lo.dep: $(extra_go_files_internal_goroot)
+
 extra_go_files_go_types = gccgosizes.go
 go/types.lo.dep: $(extra_go_files_go_types)
 
@@ -1188,13 +993,21 @@ cmd/internal/objabi.lo.dep: $(extra_go_files_cmd_internal_objabi)
 extra_go_files_cmd_go_internal_cfg = zdefaultcc.go
 cmd/go/internal/cfg.lo.dep: $(extra_go_files_cmd_go_internal_cfg)
 
-extra_go_files_cmd_go_internal_load = zstdpkglist.go
-cmd/go/internal/load.lo.dep: $(extra_go_files_cmd_go_internal_load)
-
 extra_check_libs_cmd_go_internal_cache = $(abs_builddir)/libgotool.a
 extra_check_libs_cmd_go_internal_generate = $(abs_builddir)/libgotool.a
 extra_check_libs_cmd_go_internal_get = $(abs_builddir)/libgotool.a
 extra_check_libs_cmd_go_internal_load = $(abs_builddir)/libgotool.a
+extra_check_libs_cmd_go_internal_lockedfile = $(abs_builddir)/libgotool.a
+extra_check_libs_cmd_go_internal_imports = $(abs_builddir)/libgotool.a
+extra_check_libs_cmd_go_internal_modconv = $(abs_builddir)/libgotool.a
+extra_check_libs_cmd_go_internal_modfetch = $(abs_builddir)/libgotool.a
+extra_check_libs_cmd_go_internal_modfetch_codehost = $(abs_builddir)/libgotool.a
+extra_check_libs_cmd_go_internal_modfile = $(abs_builddir)/libgotool.a
+extra_check_libs_cmd_go_internal_modload = $(abs_builddir)/libgotool.a
+extra_check_libs_cmd_go_internal_module = $(abs_builddir)/libgotool.a
+extra_check_libs_cmd_go_internal_mvs = $(abs_builddir)/libgotool.a
+extra_check_libs_cmd_go_internal_search = $(abs_builddir)/libgotool.a
+extra_check_libs_cmd_go_internal_web2 = $(abs_builddir)/libgotool.a
 extra_check_libs_cmd_go_internal_work = $(abs_builddir)/libgotool.a
 
 extra_check_libs_cmd_vet_internal_cfg = $(abs_builddir)/libgotool.a
@@ -1202,13 +1015,10 @@ extra_check_libs_cmd_vet_internal_cfg = $(abs_builddir)/libgotool.a
 # 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 $@ $(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
+# Use C code to speed up internal/bytealg.IndexByte and friends.
+internal/bytealg/bytealg.lo: go/internal/bytealg/bytealg.c runtime.inc
+       @$(MKDIR_P) internal/bytealg
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/bytealg/bytealg.c
 
 # Use a C function with a fixed number of arguments to call a C
 # varargs function.
@@ -1243,6 +1053,11 @@ syscall/wait.lo: go/syscall/wait.c runtime.inc
        @$(MKDIR_P) syscall
        $(LTCOMPILE) -c -o $@ $(srcdir)/go/syscall/wait.c
 
+# internal/cpu needs some C code.
+internal/cpu/cpu_gccgo.lo: go/internal/cpu/cpu_gccgo.c runtime.inc
+       @$(MKDIR_P) internal/cpu
+       $(LTCOMPILE) -c -o $@ $(srcdir)/go/internal/cpu/cpu_gccgo.c
+
 # Solaris 11.4 changed the type of fields in struct stat.
 # Use a build tag, based on a configure check, to cope.
 if LIBGO_IS_SOLARIS
@@ -1257,195 +1072,34 @@ endif
 
 if LIBGO_IS_BSD
 
-# Build golang_org/x/net/route only on BSD systems.
+# Build internal/x/net/route only on BSD systems.
 
-$(eval $(call PACKAGE_template,golang_org/x/net/route))
+$(eval $(call PACKAGE_template,internal/x/net/route))
 
-golang_org_x_net_route_lo = \
-       golang_org/x/net/route.lo
-golang_org_x_net_route_check = \
-       golang_org/x/net/route/check
+internal_x_net_route_lo = \
+       internal/x/net/route.lo
+internal_x_net_route_check = \
+       internal/x/net/route/check
 
 endif
 
 if LIBGO_IS_SOLARIS
 
-# Build golang_org/x/net/lif only on Solaris systems.
+# Build internal/x/net/lif only on Solaris systems.
 
-$(eval $(call PACKAGE_template,golang_org/x/net/lif))
+$(eval $(call PACKAGE_template,internal/x/net/lif))
 
-golang_org_x_net_lif_lo = \
-       golang_org/x/net/lif.lo
-golang_org_x_net_lif_check = \
-       golang_org/x/net/lif/check
+internal_x_net_lif_lo = \
+       internal/x/net/lif.lo
+internal_x_net_lif_check = \
+       internal/x/net/lif/check
 
 endif
 
-TEST_PACKAGES = \
-       bufio/check \
-       bytes/check \
-       context/check \
-       crypto/check \
-       errors/check \
-       expvar/check \
-       flag/check \
-       fmt/check \
-       hash/check \
-       html/check \
-       image/check \
-       io/check \
-       log/check \
-       math/check \
-       mime/check \
-       net/check \
-       os/check \
-       path/check \
-       reflect/check \
-       regexp/check \
-       runtime/check \
-       sort/check \
-       strconv/check \
-       strings/check \
-       sync/check \
-       syscall/check \
-       time/check \
-       unicode/check \
-       archive/tar/check \
-       archive/zip/check \
-       cmd/go/internal/cache/check \
-       cmd/go/internal/generate/check \
-       cmd/go/internal/get/check \
-       cmd/go/internal/load/check \
-       cmd/go/internal/work/check \
-       cmd/internal/buildid/check \
-       cmd/internal/edit/check \
-       cmd/internal/objabi/check \
-       cmd/internal/test2json/check \
-       cmd/vet/internal/cfg/check \
-       compress/bzip2/check \
-       compress/flate/check \
-       compress/gzip/check \
-       compress/lzw/check \
-       compress/zlib/check \
-       container/heap/check \
-       container/list/check \
-       container/ring/check \
-       crypto/aes/check \
-       crypto/cipher/check \
-       crypto/des/check \
-       crypto/dsa/check \
-       crypto/ecdsa/check \
-       crypto/elliptic/check \
-       crypto/hmac/check \
-       crypto/md5/check \
-       crypto/rand/check \
-       crypto/rc4/check \
-       crypto/rsa/check \
-       crypto/sha1/check \
-       crypto/sha256/check \
-       crypto/sha512/check \
-       crypto/subtle/check \
-       crypto/tls/check \
-       crypto/x509/check \
-       database/sql/check \
-       database/sql/driver/check \
-       debug/dwarf/check \
-       debug/elf/check \
-       debug/macho/check \
-       debug/pe/check \
-       debug/plan9obj/check \
-       debug/xcoff/check \
-       encoding/ascii85/check \
-       encoding/asn1/check \
-       encoding/base32/check \
-       encoding/base64/check \
-       encoding/binary/check \
-       encoding/csv/check \
-       encoding/gob/check \
-       encoding/hex/check \
-       encoding/json/check \
-       encoding/pem/check \
-       encoding/xml/check \
-       html/template/check \
-       go/ast/check \
-       go/build/check \
-       go/constant/check \
-       go/doc/check \
-       go/format/check \
-       go/importer/check \
-       go/internal/gcimporter/check \
-       go/internal/gccgoimporter/check \
-       go/internal/srcimporter/check \
-       go/parser/check \
-       go/printer/check \
-       go/scanner/check \
-       go/token/check \
-       go/types/check \
-       golang_org/x/crypto/chacha20poly1305/check \
-       golang_org/x/crypto/chacha20poly1305/internal/chacha20/check \
-       golang_org/x/crypto/cryptobyte/check \
-       golang_org/x/crypto/curve25519/check \
-       golang_org/x/crypto/poly1305/check \
-       golang_org/x/net/http2/hpack/check \
-       golang_org/x/net/idna/check \
-       golang_org/x/net/lex/httplex/check \
-       $(golang_org_x_net_lif_check) \
-       golang_org/x/net/proxy/check \
-       $(golang_org_x_net_route_check) \
-       hash/adler32/check \
-       hash/crc32/check \
-       hash/crc64/check \
-       hash/fnv/check \
-       image/color/check \
-       image/draw/check \
-       image/jpeg/check \
-       image/png/check \
-       index/suffixarray/check \
-       internal/poll/check \
-       internal/singleflight/check \
-       internal/trace/check \
-       io/ioutil/check \
-       log/syslog/check \
-       math/big/check \
-       math/bits/check \
-       math/cmplx/check \
-       math/rand/check \
-       mime/multipart/check \
-       mime/quotedprintable/check \
-       net/http/check \
-       net/http/cgi/check \
-       net/http/cookiejar/check \
-       net/http/fcgi/check \
-       net/http/httptest/check \
-       net/http/httptrace/check \
-       net/http/httputil/check \
-       net/http/internal/check \
-       net/internal/socktest/check \
-       net/mail/check \
-       net/rpc/check \
-       net/smtp/check \
-       net/textproto/check \
-       net/url/check \
-       net/rpc/jsonrpc/check \
-       os/exec/check \
-       os/signal/check \
-       os/user/check \
-       path/filepath/check \
-       regexp/syntax/check \
-       runtime/debug/check \
-       runtime/internal/atomic/check \
-       runtime/internal/sys/check \
-       runtime/pprof/check \
-       runtime/pprof/internal/profile/check \
-       runtime/trace/check \
-       sync/atomic/check \
-       text/scanner/check \
-       text/tabwriter/check \
-       text/template/check \
-       text/template/parse/check \
-       testing/quick/check \
-       unicode/utf16/check \
-       unicode/utf8/check
+TPACKAGES = $(shell cat $(srcdir)/check-packages.txt)
+TEST_PACKAGES = $(addsuffix /check,$(TPACKAGES)) \
+       $(internal_x_net_lif_check) \
+       $(internal_x_net_route_check)
 
 check: check-tail
 check-recursive: check-head
@@ -1572,3 +1226,5 @@ clean-local:
 
 distclean-local:
        find . -name '*.lo.dep' -print | xargs rm -f
+
+include $(top_srcdir)/../multilib.am