]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] internal/goarch,internal/goos: explode runtime/internal/sys into...
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 16 Jun 2021 20:14:22 +0000 (20:14 +0000)
committerMichael Knyszek <mknyszek@google.com>
Thu, 17 Jun 2021 18:54:38 +0000 (18:54 +0000)
This change extracts the GOOS and GOARCH specific constants from
runtime/internal/sys into packages that are available to the entire
standard library.

This change does not yet update the runtime and associated packages to
use them, and instead adds constants to runtime/internal/sys to forward
the constants defined by these new packages.

Change-Id: I14d574b8d7bfe599ad25da29dc1b39716e35a734
Reviewed-on: https://go-review.googlesource.com/c/go/+/328336
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

59 files changed:
src/cmd/go/internal/work/gc.go
src/go/build/deps_test.go
src/internal/goarch/gengoarch.go [new file with mode: 0644]
src/internal/goarch/goarch.go [moved from src/runtime/internal/sys/arch.go with 79% similarity]
src/internal/goarch/goarch_386.go [moved from src/runtime/internal/sys/arch_386.go with 95% similarity]
src/internal/goarch/goarch_amd64.go [moved from src/runtime/internal/sys/arch_amd64.go with 95% similarity]
src/internal/goarch/goarch_arm.go [moved from src/runtime/internal/sys/arch_arm.go with 95% similarity]
src/internal/goarch/goarch_arm64.go [moved from src/runtime/internal/sys/arch_arm64.go with 95% similarity]
src/internal/goarch/goarch_mips.go [moved from src/runtime/internal/sys/arch_mips.go with 95% similarity]
src/internal/goarch/goarch_mips64.go [moved from src/runtime/internal/sys/arch_mips64le.go with 95% similarity]
src/internal/goarch/goarch_mips64le.go [moved from src/runtime/internal/sys/arch_mips64.go with 95% similarity]
src/internal/goarch/goarch_mipsle.go [moved from src/runtime/internal/sys/arch_mipsle.go with 95% similarity]
src/internal/goarch/goarch_ppc64.go [moved from src/runtime/internal/sys/arch_ppc64.go with 95% similarity]
src/internal/goarch/goarch_ppc64le.go [moved from src/runtime/internal/sys/arch_ppc64le.go with 95% similarity]
src/internal/goarch/goarch_riscv64.go [moved from src/runtime/internal/sys/arch_riscv64.go with 95% similarity]
src/internal/goarch/goarch_s390x.go [moved from src/runtime/internal/sys/arch_s390x.go with 95% similarity]
src/internal/goarch/goarch_wasm.go [moved from src/runtime/internal/sys/arch_wasm.go with 95% similarity]
src/internal/goarch/zgoarch_386.go [moved from src/runtime/internal/sys/zgoarch_386.go with 87% similarity]
src/internal/goarch/zgoarch_amd64.go [moved from src/runtime/internal/sys/zgoarch_amd64.go with 87% similarity]
src/internal/goarch/zgoarch_arm.go [moved from src/runtime/internal/sys/zgoarch_arm.go with 87% similarity]
src/internal/goarch/zgoarch_arm64.go [moved from src/runtime/internal/sys/zgoarch_arm64.go with 87% similarity]
src/internal/goarch/zgoarch_arm64be.go [moved from src/runtime/internal/sys/zgoarch_arm64be.go with 87% similarity]
src/internal/goarch/zgoarch_armbe.go [moved from src/runtime/internal/sys/zgoarch_armbe.go with 87% similarity]
src/internal/goarch/zgoarch_mips.go [moved from src/runtime/internal/sys/zgoarch_mips.go with 87% similarity]
src/internal/goarch/zgoarch_mips64.go [moved from src/runtime/internal/sys/zgoarch_mips64.go with 87% similarity]
src/internal/goarch/zgoarch_mips64le.go [moved from src/runtime/internal/sys/zgoarch_mips64le.go with 87% similarity]
src/internal/goarch/zgoarch_mips64p32.go [moved from src/runtime/internal/sys/zgoarch_mips64p32.go with 87% similarity]
src/internal/goarch/zgoarch_mips64p32le.go [moved from src/runtime/internal/sys/zgoarch_mips64p32le.go with 87% similarity]
src/internal/goarch/zgoarch_mipsle.go [moved from src/runtime/internal/sys/zgoarch_mipsle.go with 87% similarity]
src/internal/goarch/zgoarch_ppc.go [moved from src/runtime/internal/sys/zgoarch_ppc.go with 87% similarity]
src/internal/goarch/zgoarch_ppc64.go [moved from src/runtime/internal/sys/zgoarch_ppc64.go with 87% similarity]
src/internal/goarch/zgoarch_ppc64le.go [moved from src/runtime/internal/sys/zgoarch_ppc64le.go with 87% similarity]
src/internal/goarch/zgoarch_riscv.go [moved from src/runtime/internal/sys/zgoarch_riscv.go with 87% similarity]
src/internal/goarch/zgoarch_riscv64.go [moved from src/runtime/internal/sys/zgoarch_riscv64.go with 87% similarity]
src/internal/goarch/zgoarch_s390.go [moved from src/runtime/internal/sys/zgoarch_s390.go with 87% similarity]
src/internal/goarch/zgoarch_s390x.go [moved from src/runtime/internal/sys/zgoarch_s390x.go with 87% similarity]
src/internal/goarch/zgoarch_sparc.go [moved from src/runtime/internal/sys/zgoarch_sparc.go with 87% similarity]
src/internal/goarch/zgoarch_sparc64.go [moved from src/runtime/internal/sys/zgoarch_sparc64.go with 87% similarity]
src/internal/goarch/zgoarch_wasm.go [moved from src/runtime/internal/sys/zgoarch_wasm.go with 87% similarity]
src/internal/goos/gengoos.go [moved from src/runtime/internal/sys/gengoos.go with 59% similarity]
src/internal/goos/goos.go [new file with mode: 0644]
src/internal/goos/zgoos_aix.go [moved from src/runtime/internal/sys/zgoos_aix.go with 97% similarity]
src/internal/goos/zgoos_android.go [moved from src/runtime/internal/sys/zgoos_android.go with 97% similarity]
src/internal/goos/zgoos_darwin.go [moved from src/runtime/internal/sys/zgoos_darwin.go with 97% similarity]
src/internal/goos/zgoos_dragonfly.go [moved from src/runtime/internal/sys/zgoos_dragonfly.go with 97% similarity]
src/internal/goos/zgoos_freebsd.go [moved from src/runtime/internal/sys/zgoos_freebsd.go with 97% similarity]
src/internal/goos/zgoos_hurd.go [moved from src/runtime/internal/sys/zgoos_hurd.go with 97% similarity]
src/internal/goos/zgoos_illumos.go [moved from src/runtime/internal/sys/zgoos_illumos.go with 97% similarity]
src/internal/goos/zgoos_ios.go [moved from src/runtime/internal/sys/zgoos_ios.go with 97% similarity]
src/internal/goos/zgoos_js.go [moved from src/runtime/internal/sys/zgoos_js.go with 97% similarity]
src/internal/goos/zgoos_linux.go [moved from src/runtime/internal/sys/zgoos_linux.go with 97% similarity]
src/internal/goos/zgoos_netbsd.go [moved from src/runtime/internal/sys/zgoos_netbsd.go with 97% similarity]
src/internal/goos/zgoos_openbsd.go [moved from src/runtime/internal/sys/zgoos_openbsd.go with 97% similarity]
src/internal/goos/zgoos_plan9.go [moved from src/runtime/internal/sys/zgoos_plan9.go with 97% similarity]
src/internal/goos/zgoos_solaris.go [moved from src/runtime/internal/sys/zgoos_solaris.go with 97% similarity]
src/internal/goos/zgoos_windows.go [moved from src/runtime/internal/sys/zgoos_windows.go with 97% similarity]
src/internal/goos/zgoos_zos.go [moved from src/runtime/internal/sys/zgoos_zos.go with 97% similarity]
src/runtime/internal/sys/consts.go [new file with mode: 0644]
src/runtime/internal/sys/sys.go

index 85da4f89f991f48e4ad9a3aad4b145f622363cb1..2ae908bc8fda3a7cee2806e040759885109fd722 100644 (file)
@@ -29,6 +29,18 @@ import (
 // The 'path' used for GOROOT_FINAL when -trimpath is specified
 const trimPathGoRootFinal = "go"
 
+var runtimePackages = map[string]struct{}{
+       "internal/abi":            struct{}{},
+       "internal/bytealg":        struct{}{},
+       "internal/cpu":            struct{}{},
+       "internal/goarch":         struct{}{},
+       "internal/goos":           struct{}{},
+       "runtime":                 struct{}{},
+       "runtime/internal/atomic": struct{}{},
+       "runtime/internal/math":   struct{}{},
+       "runtime/internal/sys":    struct{}{},
+}
+
 // The Go toolchain.
 
 type gcToolchain struct{}
@@ -88,11 +100,8 @@ func (gcToolchain) gc(b *Builder, a *Action, archive string, importcfg, embedcfg
        if p.Standard {
                gcargs = append(gcargs, "-std")
        }
-       compilingRuntime := p.Standard && (p.ImportPath == "runtime" || strings.HasPrefix(p.ImportPath, "runtime/internal"))
-       // The runtime package imports a couple of general internal packages.
-       if p.Standard && (p.ImportPath == "internal/cpu" || p.ImportPath == "internal/bytealg" || p.ImportPath == "internal/abi") {
-               compilingRuntime = true
-       }
+       _, compilingRuntime := runtimePackages[p.ImportPath]
+       compilingRuntime = compilingRuntime && p.Standard
        if compilingRuntime {
                // runtime compiles with a special gc flag to check for
                // memory allocations that are invalid in the runtime package,
index 45e2f25df74da3444f3256f52ea8ab6cdf23b616..b440f7d235180696ff20358fd60605bf1ece6fe2 100644 (file)
@@ -71,7 +71,8 @@ var depsRules = `
        # No dependencies allowed for any of these packages.
        NONE
        < container/list, container/ring,
-         internal/cfg, internal/cpu, internal/goexperiment,
+         internal/cfg, internal/cpu, internal/goarch,
+         internal/goexperiment, internal/goos,
          internal/goversion, internal/nettrace,
          unicode/utf8, unicode/utf16, unicode,
          unsafe;
@@ -81,7 +82,8 @@ var depsRules = `
        < internal/abi;
 
        # RUNTIME is the core runtime group of packages, all of them very light-weight.
-       internal/abi, internal/cpu, internal/goexperiment, unsafe
+       internal/abi, internal/cpu, internal/goarch,
+       internal/goexperiment, internal/goos, unsafe
        < internal/bytealg
        < internal/itoa
        < internal/unsafeheader
diff --git a/src/internal/goarch/gengoarch.go b/src/internal/goarch/gengoarch.go
new file mode 100644 (file)
index 0000000..58c3b11
--- /dev/null
@@ -0,0 +1,59 @@
+// Copyright 2014 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.
+
+//go:build ignore
+// +build ignore
+
+package main
+
+import (
+       "bytes"
+       "fmt"
+       "log"
+       "os"
+       "strconv"
+       "strings"
+)
+
+var goarches []string
+
+func main() {
+       data, err := os.ReadFile("../../go/build/syslist.go")
+       if err != nil {
+               log.Fatal(err)
+       }
+       const goarchPrefix = `const goarchList = `
+       for _, line := range strings.Split(string(data), "\n") {
+               if strings.HasPrefix(line, goarchPrefix) {
+                       text, err := strconv.Unquote(strings.TrimPrefix(line, goarchPrefix))
+                       if err != nil {
+                               log.Fatalf("parsing goarchList: %v", err)
+                       }
+                       goarches = strings.Fields(text)
+               }
+       }
+
+       for _, target := range goarches {
+               if target == "amd64p32" {
+                       continue
+               }
+               var buf bytes.Buffer
+               fmt.Fprintf(&buf, "// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.\n\n")
+               fmt.Fprintf(&buf, "//go:build %s\n", target)
+               fmt.Fprintf(&buf, "// +build %s\n\n", target) // must explicitly include target for bootstrapping purposes
+               fmt.Fprintf(&buf, "package goarch\n\n")
+               fmt.Fprintf(&buf, "const GOARCH = `%s`\n\n", target)
+               for _, goarch := range goarches {
+                       value := 0
+                       if goarch == target {
+                               value = 1
+                       }
+                       fmt.Fprintf(&buf, "const Goarch%s = %d\n", strings.Title(goarch), value)
+               }
+               err := os.WriteFile("zgoarch_"+target+".go", buf.Bytes(), 0666)
+               if err != nil {
+                       log.Fatal(err)
+               }
+       }
+}
similarity index 79%
rename from src/runtime/internal/sys/arch.go
rename to src/internal/goarch/goarch.go
index 3c99a2f7da0831048e2aa5ae24cb8914e5d83785..8e240295b339c029a8c3aebdec4d6f70e5200ba6 100644 (file)
@@ -1,8 +1,15 @@
-// Copyright 2014 The Go Authors. All rights reserved.
+// Copyright 2021 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.
 
-package sys
+// package goarch contains GOARCH-specific constants.
+package goarch
+
+// The next line makes 'go generate' write the zgoarch*.go files with
+// per-arch information, including constants named Goarch$GOARCH for every
+// GOARCH. The constant is 1 on the current system, 0 otherwise; multiplying
+// by them is useful for defining GOARCH-specific constants.
+//go:generate go run gengoarch.go
 
 type ArchFamilyType int
 
@@ -23,9 +30,6 @@ const (
 // It is also the size of the machine's native word size (that is, 4 on 32-bit systems, 8 on 64-bit).
 const PtrSize = 4 << (^uintptr(0) >> 63)
 
-// AIX requires a larger stack for syscalls.
-const StackGuardMultiplier = StackGuardMultiplierDefault*(1-GoosAix) + 2*GoosAix
-
 // ArchFamily is the architecture family (AMD64, ARM, ...)
 const ArchFamily ArchFamilyType = _ArchFamily
 
similarity index 95%
rename from src/runtime/internal/sys/arch_386.go
rename to src/internal/goarch/goarch_386.go
index 1ebce3435e4be374308d59601ab52d4d572d5eb1..c6214217fcf339a5eb279c0bf80e15441acfd9b1 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package sys
+package goarch
 
 const (
        _ArchFamily          = I386
similarity index 95%
rename from src/runtime/internal/sys/arch_amd64.go
rename to src/internal/goarch/goarch_amd64.go
index 7f003d0f1d503431452dca3003f47c6c1d080621..911e3e72421720f95412579c50917d54e781bc7b 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package sys
+package goarch
 
 const (
        _ArchFamily          = AMD64
similarity index 95%
rename from src/runtime/internal/sys/arch_arm.go
rename to src/internal/goarch/goarch_arm.go
index ef2048bb71a5dd837c2c6e03ccb312ade0baf48f..a6591713c8204006a3d9cff45f56f345092b3b01 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package sys
+package goarch
 
 const (
        _ArchFamily          = ARM
similarity index 95%
rename from src/runtime/internal/sys/arch_arm64.go
rename to src/internal/goarch/goarch_arm64.go
index b9f2f7b1fe226abd96e5907e34b04be368fa6ea3..85d0b4763913212bb2be2e81d0c6880bfa0b88d4 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package sys
+package goarch
 
 const (
        _ArchFamily          = ARM64
similarity index 95%
rename from src/runtime/internal/sys/arch_mips.go
rename to src/internal/goarch/goarch_mips.go
index 4cb0eebea7bb5c0fbaafe59ff2b9bfe8a7448e2a..59f3995e2a54fda0d1df6bfdbc883840fbfef0d6 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package sys
+package goarch
 
 const (
        _ArchFamily          = MIPS
similarity index 95%
rename from src/runtime/internal/sys/arch_mips64le.go
rename to src/internal/goarch/goarch_mips64.go
index 57636ac4a4e0ebe933066ca9a6fb1722e12436a5..9e4f82797d410ae88a5bd6a7c8e6260c170b8da5 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package sys
+package goarch
 
 const (
        _ArchFamily          = MIPS64
similarity index 95%
rename from src/runtime/internal/sys/arch_mips64.go
rename to src/internal/goarch/goarch_mips64le.go
index 57636ac4a4e0ebe933066ca9a6fb1722e12436a5..9e4f82797d410ae88a5bd6a7c8e6260c170b8da5 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package sys
+package goarch
 
 const (
        _ArchFamily          = MIPS64
similarity index 95%
rename from src/runtime/internal/sys/arch_mipsle.go
rename to src/internal/goarch/goarch_mipsle.go
index 4240f5ce47bb7f8abfaffc75f2f3c5ffed838aa1..3e6642bb86399ba7b01378d53111460a4a30ef21 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package sys
+package goarch
 
 const (
        _ArchFamily          = MIPS
similarity index 95%
rename from src/runtime/internal/sys/arch_ppc64.go
rename to src/internal/goarch/goarch_ppc64.go
index 1869213ce241ee5f6da403b2714652756dc956dc..60cc846e6a380aae4cf1574739661e8a06efb392 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package sys
+package goarch
 
 const (
        _ArchFamily          = PPC64
similarity index 95%
rename from src/runtime/internal/sys/arch_ppc64le.go
rename to src/internal/goarch/goarch_ppc64le.go
index 1869213ce241ee5f6da403b2714652756dc956dc..60cc846e6a380aae4cf1574739661e8a06efb392 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package sys
+package goarch
 
 const (
        _ArchFamily          = PPC64
similarity index 95%
rename from src/runtime/internal/sys/arch_riscv64.go
rename to src/internal/goarch/goarch_riscv64.go
index 360d236e32072ac431f19ed75095b406cb6b4beb..3b6da1e02fe9b8c04dc10d7a16e4f0afd472b859 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package sys
+package goarch
 
 const (
        _ArchFamily          = RISCV64
similarity index 95%
rename from src/runtime/internal/sys/arch_s390x.go
rename to src/internal/goarch/goarch_s390x.go
index e33e0b7f2b890b416ac5e70c2cbdcff6a5ad2eb5..20c5705581e79ce5c897c3b6c6e442a3c92c8a02 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package sys
+package goarch
 
 const (
        _ArchFamily          = S390X
similarity index 95%
rename from src/runtime/internal/sys/arch_wasm.go
rename to src/internal/goarch/goarch_wasm.go
index ee919ff9e634996eeb54bd40e7a9c73e0509a5ec..98618d6980edd7e0ae4329c7f0575e62d64023e8 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package sys
+package goarch
 
 const (
        _ArchFamily          = WASM
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_386.go
rename to src/internal/goarch/zgoarch_386.go
index 98a2401bfe9a8798c474573b82d263db8fe8dbd1..f424b5a6b97fd2f54c514652658b0a6d50506ca9 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build 386
 // +build 386
 
-package sys
+package goarch
 
 const GOARCH = `386`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_amd64.go
rename to src/internal/goarch/zgoarch_amd64.go
index d8faa5c786085161c92d31127155cef5f08c250e..728896c367ea3e8cf4340d901fa3b1dee9b814d4 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build amd64
 // +build amd64
 
-package sys
+package goarch
 
 const GOARCH = `amd64`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_arm.go
rename to src/internal/goarch/zgoarch_arm.go
index b64a69c9b44eec0f4b35e7906b87560005be7121..9d388b0554d71f1fd9d9b3b448e8d036170444fe 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build arm
 // +build arm
 
-package sys
+package goarch
 
 const GOARCH = `arm`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_arm64.go
rename to src/internal/goarch/zgoarch_arm64.go
index de6f85347b1d609778dcb3396639abb463e675f1..a375ac8076271cf8be87d6834d7d19f11b25f52f 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build arm64
 // +build arm64
 
-package sys
+package goarch
 
 const GOARCH = `arm64`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_arm64be.go
rename to src/internal/goarch/zgoarch_arm64be.go
index b762bb069f8c1bc3b5852295b77ff6a8fdd3c487..6fcc4f6bfa7493338c5a3fb7aedf1a1c1bb61554 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build arm64be
 // +build arm64be
 
-package sys
+package goarch
 
 const GOARCH = `arm64be`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_armbe.go
rename to src/internal/goarch/zgoarch_armbe.go
index e5297e4b169d936edcc7ac03b7d26ff99246acb0..a3ac487d80ca2e5d961f143ac8cd8e1bfe8476bb 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build armbe
 // +build armbe
 
-package sys
+package goarch
 
 const GOARCH = `armbe`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_mips.go
rename to src/internal/goarch/zgoarch_mips.go
index b5f4ed390c6ba32309187ce7d7a2273381253928..00cfd90c3b7103c600343bf2b58cdefda4bb1afc 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build mips
 // +build mips
 
-package sys
+package goarch
 
 const GOARCH = `mips`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_mips64.go
rename to src/internal/goarch/zgoarch_mips64.go
index 73777cceb21096f9180addf525c154c5504601be..947db612eb0511e9be059e6079145f49a5ca6ae4 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build mips64
 // +build mips64
 
-package sys
+package goarch
 
 const GOARCH = `mips64`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_mips64le.go
rename to src/internal/goarch/zgoarch_mips64le.go
index 0c81c36c09741d3d40c551bf35c6b070b02dc926..35ffbe2d3f3ec8a976c3e85d7d7ea49b4f49521f 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build mips64le
 // +build mips64le
 
-package sys
+package goarch
 
 const GOARCH = `mips64le`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_mips64p32.go
rename to src/internal/goarch/zgoarch_mips64p32.go
index d63ce27d24d8bbca7551c4472b683d29fc2ca61d..c7c712032beda0f602c597941083df9868c9f8ab 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build mips64p32
 // +build mips64p32
 
-package sys
+package goarch
 
 const GOARCH = `mips64p32`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_mips64p32le.go
rename to src/internal/goarch/zgoarch_mips64p32le.go
index 2d577890b2e671667bc5b57cfe7a0febe0fb3302..f605a6ff783008423fbf843033250e09edcfb010 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build mips64p32le
 // +build mips64p32le
 
-package sys
+package goarch
 
 const GOARCH = `mips64p32le`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_mipsle.go
rename to src/internal/goarch/zgoarch_mipsle.go
index 8af919d03a35f429bd79167c7d826d4a1d79865a..56e24dc7b3d0276613d978fa7f0d639ef1e761bf 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build mipsle
 // +build mipsle
 
-package sys
+package goarch
 
 const GOARCH = `mipsle`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_ppc.go
rename to src/internal/goarch/zgoarch_ppc.go
index f6f12a5ddcecad74dded8441a93230a519202119..4617d12792794b36cc7dbc9cdcbc456a90ff6019 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build ppc
 // +build ppc
 
-package sys
+package goarch
 
 const GOARCH = `ppc`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_ppc64.go
rename to src/internal/goarch/zgoarch_ppc64.go
index a8379601f47e652baa8bb2f89014317866e8dc90..f3cb16e9b64e7bba9e1a42a7185725a4c7e53539 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build ppc64
 // +build ppc64
 
-package sys
+package goarch
 
 const GOARCH = `ppc64`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_ppc64le.go
rename to src/internal/goarch/zgoarch_ppc64le.go
index f2ec5dcba7291a5ef1fdcd5094d5c32bef366d8f..b70abfb953e030127da0611392b793d638b0d698 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build ppc64le
 // +build ppc64le
 
-package sys
+package goarch
 
 const GOARCH = `ppc64le`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_riscv.go
rename to src/internal/goarch/zgoarch_riscv.go
index 83a3312f5f3171d94159f829be00d3592ddd6643..f72973fbc5984a56a0dfef14398a3e1f6fa3e7df 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build riscv
 // +build riscv
 
-package sys
+package goarch
 
 const GOARCH = `riscv`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_riscv64.go
rename to src/internal/goarch/zgoarch_riscv64.go
index 1dfcc84997b870b125474a9865b5177c0a96969f..5d09b63a03156a9ccc4df7d1a6dd13e249c9c4f1 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build riscv64
 // +build riscv64
 
-package sys
+package goarch
 
 const GOARCH = `riscv64`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_s390.go
rename to src/internal/goarch/zgoarch_s390.go
index 91aba5a0f6cfaec578bb71273aea1c3dce301bf4..0ceffe6c2ec425fdff3befed46189a24338cce5f 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build s390
 // +build s390
 
-package sys
+package goarch
 
 const GOARCH = `s390`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_s390x.go
rename to src/internal/goarch/zgoarch_s390x.go
index edce50234e56a7e6b89e88935352bc5f0016546d..142bc0f1e386387a5d72033f03a852726a945c36 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build s390x
 // +build s390x
 
-package sys
+package goarch
 
 const GOARCH = `s390x`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_sparc.go
rename to src/internal/goarch/zgoarch_sparc.go
index 5ae9560ab0154e8c3c602c8f59788605e98a5eaf..62452b9d38d842b1f26cfa6b87c0a7a1c315dcfa 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build sparc
 // +build sparc
 
-package sys
+package goarch
 
 const GOARCH = `sparc`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_sparc64.go
rename to src/internal/goarch/zgoarch_sparc64.go
index e2a0134affd01e30e004230c4f7891d1eaed394c..5149507917d2cd1dda6ea6c3bd20f8c324d6b392 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build sparc64
 // +build sparc64
 
-package sys
+package goarch
 
 const GOARCH = `sparc64`
 
similarity index 87%
rename from src/runtime/internal/sys/zgoarch_wasm.go
rename to src/internal/goarch/zgoarch_wasm.go
index 52e85dea371d6d6149feb333e7c08088fe6e6242..fd25e93e747150bd1e20c3930afaadd69350dc29 100644 (file)
@@ -1,9 +1,9 @@
-// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
+// Code generated by gengoarch.go using 'go generate'. DO NOT EDIT.
 
 //go:build wasm
 // +build wasm
 
-package sys
+package goarch
 
 const GOARCH = `wasm`
 
similarity index 59%
rename from src/runtime/internal/sys/gengoos.go
rename to src/internal/goos/gengoos.go
index ffe962f71df61c89cba3261d7e017c5de4e432b2..ebcdfec3ba97a1fba3103285b50f0b80c5d1c295 100644 (file)
@@ -16,17 +16,14 @@ import (
        "strings"
 )
 
-var gooses, goarches []string
+var gooses []string
 
 func main() {
-       data, err := os.ReadFile("../../../go/build/syslist.go")
+       data, err := os.ReadFile("../../go/build/syslist.go")
        if err != nil {
                log.Fatal(err)
        }
-       const (
-               goosPrefix   = `const goosList = `
-               goarchPrefix = `const goarchList = `
-       )
+       const goosPrefix = `const goosList = `
        for _, line := range strings.Split(string(data), "\n") {
                if strings.HasPrefix(line, goosPrefix) {
                        text, err := strconv.Unquote(strings.TrimPrefix(line, goosPrefix))
@@ -35,13 +32,6 @@ func main() {
                        }
                        gooses = strings.Fields(text)
                }
-               if strings.HasPrefix(line, goarchPrefix) {
-                       text, err := strconv.Unquote(strings.TrimPrefix(line, goarchPrefix))
-                       if err != nil {
-                               log.Fatalf("parsing goarchList: %v", err)
-                       }
-                       goarches = strings.Fields(text)
-               }
        }
 
        for _, target := range gooses {
@@ -63,7 +53,7 @@ func main() {
                fmt.Fprintf(&buf, "// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.\n\n")
                fmt.Fprintf(&buf, "//go:build %s\n", strings.Join(tags, " && "))
                fmt.Fprintf(&buf, "// +build %s\n\n", strings.Join(tags, ","))
-               fmt.Fprintf(&buf, "package sys\n\n")
+               fmt.Fprintf(&buf, "package goos\n\n")
                fmt.Fprintf(&buf, "const GOOS = `%s`\n\n", target)
                for _, goos := range gooses {
                        value := 0
@@ -77,27 +67,4 @@ func main() {
                        log.Fatal(err)
                }
        }
-
-       for _, target := range goarches {
-               if target == "amd64p32" {
-                       continue
-               }
-               var buf bytes.Buffer
-               fmt.Fprintf(&buf, "// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.\n\n")
-               fmt.Fprintf(&buf, "//go:build %s\n", target)
-               fmt.Fprintf(&buf, "// +build %s\n\n", target) // must explicitly include target for bootstrapping purposes
-               fmt.Fprintf(&buf, "package sys\n\n")
-               fmt.Fprintf(&buf, "const GOARCH = `%s`\n\n", target)
-               for _, goarch := range goarches {
-                       value := 0
-                       if goarch == target {
-                               value = 1
-                       }
-                       fmt.Fprintf(&buf, "const Goarch%s = %d\n", strings.Title(goarch), value)
-               }
-               err := os.WriteFile("zgoarch_"+target+".go", buf.Bytes(), 0666)
-               if err != nil {
-                       log.Fatal(err)
-               }
-       }
 }
diff --git a/src/internal/goos/goos.go b/src/internal/goos/goos.go
new file mode 100644 (file)
index 0000000..332cf51
--- /dev/null
@@ -0,0 +1,12 @@
+// Copyright 2015 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.
+
+// package goos contains GOOS-specific constants.
+package goos
+
+// The next line makes 'go generate' write the zgoos*.go files with
+// per-OS information, including constants named Goos$GOOS for every
+// known GOOS. The constant is 1 on the current system, 0 otherwise;
+// multiplying by them is useful for defining GOOS-specific constants.
+//go:generate go run gengoos.go
similarity index 97%
rename from src/runtime/internal/sys/zgoos_aix.go
rename to src/internal/goos/zgoos_aix.go
index f3b907471f6e4ad68a933dbed7e25a45806e9052..f453a8a0a8fe7a2b368cd6e2cf6a601723e2fe11 100644 (file)
@@ -3,7 +3,7 @@
 //go:build aix
 // +build aix
 
-package sys
+package goos
 
 const GOOS = `aix`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_android.go
rename to src/internal/goos/zgoos_android.go
index e28baf7c48103e037941ebb03f55f485c7a3e3a4..d90c04f7589c5fa3b651aef5f4c899656b75317f 100644 (file)
@@ -3,7 +3,7 @@
 //go:build android
 // +build android
 
-package sys
+package goos
 
 const GOOS = `android`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_darwin.go
rename to src/internal/goos/zgoos_darwin.go
index 3c7f7b543eecdd2d3559c832f920d8c0a3fbd865..18f6c28b1283731ca511510f8ef4af0ccd6d2cf3 100644 (file)
@@ -3,7 +3,7 @@
 //go:build !ios && darwin
 // +build !ios,darwin
 
-package sys
+package goos
 
 const GOOS = `darwin`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_dragonfly.go
rename to src/internal/goos/zgoos_dragonfly.go
index f844d29e2a1e552c11a1b9f57d44e9c01df97c47..a658d1d07f2bde89f20c21d18c47404eca9813fe 100644 (file)
@@ -3,7 +3,7 @@
 //go:build dragonfly
 // +build dragonfly
 
-package sys
+package goos
 
 const GOOS = `dragonfly`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_freebsd.go
rename to src/internal/goos/zgoos_freebsd.go
index 8999a2797af0cbce96b97239bd4b3219dbf38e96..2534eb8c6f8fa915a55c55a7b54f17392dcd4a32 100644 (file)
@@ -3,7 +3,7 @@
 //go:build freebsd
 // +build freebsd
 
-package sys
+package goos
 
 const GOOS = `freebsd`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_hurd.go
rename to src/internal/goos/zgoos_hurd.go
index a546488bf8999df89df1e98ae3195e25d5c4b913..3fefb1fbb18827c02d6b84f72ca850e57155b24d 100644 (file)
@@ -3,7 +3,7 @@
 //go:build hurd
 // +build hurd
 
-package sys
+package goos
 
 const GOOS = `hurd`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_illumos.go
rename to src/internal/goos/zgoos_illumos.go
index 02a4ca06e82b1b54d064c1a15776f6868d332590..77495a3369b446ca247d7bc42e2e077dfad579d5 100644 (file)
@@ -3,7 +3,7 @@
 //go:build illumos
 // +build illumos
 
-package sys
+package goos
 
 const GOOS = `illumos`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_ios.go
rename to src/internal/goos/zgoos_ios.go
index 033eec623df05375589396351cf87311315ad58e..92820fe77e8530d90642230843e72b84485a8215 100644 (file)
@@ -3,7 +3,7 @@
 //go:build ios
 // +build ios
 
-package sys
+package goos
 
 const GOOS = `ios`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_js.go
rename to src/internal/goos/zgoos_js.go
index 28226ad60ad2dc94058da37c1a895f8e326d2f1f..6331a5c3f19e78f769fb8fcd50c9ab3d5e0e5b29 100644 (file)
@@ -3,7 +3,7 @@
 //go:build js
 // +build js
 
-package sys
+package goos
 
 const GOOS = `js`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_linux.go
rename to src/internal/goos/zgoos_linux.go
index 01546e4b9f26165b15cdf5f08091e083660ef545..aa4e2d31451b3414013180dac69455e3c79f5e80 100644 (file)
@@ -3,7 +3,7 @@
 //go:build !android && linux
 // +build !android,linux
 
-package sys
+package goos
 
 const GOOS = `linux`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_netbsd.go
rename to src/internal/goos/zgoos_netbsd.go
index 9d658b20ee200d9b3759c8fc5da24ad29ef1e578..39635104c03436f75940d5356b7447786819deb7 100644 (file)
@@ -3,7 +3,7 @@
 //go:build netbsd
 // +build netbsd
 
-package sys
+package goos
 
 const GOOS = `netbsd`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_openbsd.go
rename to src/internal/goos/zgoos_openbsd.go
index 0f55454a953fec156a7cb6c5f6bf6e982ba4fab1..61d4ac8bb028b117658ac361ed6dafce9daf02d1 100644 (file)
@@ -3,7 +3,7 @@
 //go:build openbsd
 // +build openbsd
 
-package sys
+package goos
 
 const GOOS = `openbsd`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_plan9.go
rename to src/internal/goos/zgoos_plan9.go
index d0347464d6d25dcf55cc1069a0128b600917b32e..7f0dc2fa041ca385674f25843f081070d487f0a0 100644 (file)
@@ -3,7 +3,7 @@
 //go:build plan9
 // +build plan9
 
-package sys
+package goos
 
 const GOOS = `plan9`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_solaris.go
rename to src/internal/goos/zgoos_solaris.go
index 05c3007e2c226077531804715ff5c386a10651eb..7497324a4f6d40f5ce1ff57c5bd540b0d8ba0682 100644 (file)
@@ -3,7 +3,7 @@
 //go:build !illumos && solaris
 // +build !illumos,solaris
 
-package sys
+package goos
 
 const GOOS = `solaris`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_windows.go
rename to src/internal/goos/zgoos_windows.go
index 7d07fa3a451150875f9710dc020da8b74a37be92..e316b80c82f0c9db9a327737361bc4aaeb754754 100644 (file)
@@ -3,7 +3,7 @@
 //go:build windows
 // +build windows
 
-package sys
+package goos
 
 const GOOS = `windows`
 
similarity index 97%
rename from src/runtime/internal/sys/zgoos_zos.go
rename to src/internal/goos/zgoos_zos.go
index d6e5b9b0cb2b98b2e9edd9a678e39645723c7bb1..26471f4f36e80975225280eecdb18bb621a3ee93 100644 (file)
@@ -3,7 +3,7 @@
 //go:build zos
 // +build zos
 
-package sys
+package goos
 
 const GOOS = `zos`
 
diff --git a/src/runtime/internal/sys/consts.go b/src/runtime/internal/sys/consts.go
new file mode 100644 (file)
index 0000000..815f789
--- /dev/null
@@ -0,0 +1,109 @@
+// Copyright 2014 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.
+
+package sys
+
+import (
+       "internal/goarch"
+       "internal/goos"
+)
+
+type ArchFamilyType = goarch.ArchFamilyType
+
+const (
+       AMD64   = goarch.AMD64
+       ARM     = goarch.ARM
+       ARM64   = goarch.ARM64
+       I386    = goarch.I386
+       MIPS    = goarch.MIPS
+       MIPS64  = goarch.MIPS64
+       PPC64   = goarch.PPC64
+       RISCV64 = goarch.RISCV64
+       S390X   = goarch.S390X
+       WASM    = goarch.WASM
+)
+
+// PtrSize is the size of a pointer in bytes - unsafe.Sizeof(uintptr(0)) but as an ideal constant.
+// It is also the size of the machine's native word size (that is, 4 on 32-bit systems, 8 on 64-bit).
+const PtrSize = goarch.PtrSize
+
+// ArchFamily is the architecture family (AMD64, ARM, ...)
+const ArchFamily ArchFamilyType = goarch.ArchFamily
+
+// AIX requires a larger stack for syscalls.
+const StackGuardMultiplier = StackGuardMultiplierDefault*(1-goos.GoosAix) + 2*goos.GoosAix
+
+// BigEndian reports whether the architecture is big-endian.
+const BigEndian = goarch.BigEndian
+
+// DefaultPhysPageSize is the default physical page size.
+const DefaultPhysPageSize = goarch.DefaultPhysPageSize
+
+// PCQuantum is the minimal unit for a program counter (1 on x86, 4 on most other systems).
+// The various PC tables record PC deltas pre-divided by PCQuantum.
+const PCQuantum = goarch.PCQuantum
+
+// Int64Align is the required alignment for a 64-bit integer (4 on 32-bit systems, 8 on 64-bit).
+const Int64Align = goarch.PtrSize
+
+// MinFrameSize is the size of the system-reserved words at the bottom
+// of a frame (just above the architectural stack pointer).
+// It is zero on x86 and PtrSize on most non-x86 (LR-based) systems.
+// On PowerPC it is larger, to cover three more reserved words:
+// the compiler word, the link editor word, and the TOC save word.
+const MinFrameSize = goarch.MinFrameSize
+
+// StackAlign is the required alignment of the SP register.
+// The stack must be at least word aligned, but some architectures require more.
+const StackAlign = goarch.StackAlign
+
+const GOARCH = goarch.GOARCH
+
+const (
+       Goarch386         = goarch.Goarch386
+       GoarchAmd64       = goarch.GoarchAmd64
+       GoarchAmd64p32    = goarch.GoarchAmd64p32
+       GoarchArm         = goarch.GoarchArm
+       GoarchArmbe       = goarch.GoarchArmbe
+       GoarchArm64       = goarch.GoarchArm64
+       GoarchArm64be     = goarch.GoarchArm64be
+       GoarchPpc64       = goarch.GoarchPpc64
+       GoarchPpc64le     = goarch.GoarchPpc64le
+       GoarchMips        = goarch.GoarchMips
+       GoarchMipsle      = goarch.GoarchMipsle
+       GoarchMips64      = goarch.GoarchMips64
+       GoarchMips64le    = goarch.GoarchMips64le
+       GoarchMips64p32   = goarch.GoarchMips64p32
+       GoarchMips64p32le = goarch.GoarchMips64p32le
+       GoarchPpc         = goarch.GoarchPpc
+       GoarchRiscv       = goarch.GoarchRiscv
+       GoarchRiscv64     = goarch.GoarchRiscv64
+       GoarchS390        = goarch.GoarchS390
+       GoarchS390x       = goarch.GoarchS390x
+       GoarchSparc       = goarch.GoarchSparc
+       GoarchSparc64     = goarch.GoarchSparc64
+       GoarchWasm        = goarch.GoarchWasm
+)
+
+const GOOS = goos.GOOS
+
+const (
+       GoosAix       = goos.GoosAix
+       GoosAndroid   = goos.GoosAndroid
+       GoosDarwin    = goos.GoosDarwin
+       GoosDragonfly = goos.GoosDragonfly
+       GoosFreebsd   = goos.GoosFreebsd
+       GoosHurd      = goos.GoosHurd
+       GoosIllumos   = goos.GoosIllumos
+       GoosIos       = goos.GoosIos
+       GoosJs        = goos.GoosJs
+       GoosLinux     = goos.GoosLinux
+       GoosNacl      = goos.GoosNacl
+       GoosNetbsd    = goos.GoosNetbsd
+       GoosOpenbsd   = goos.GoosOpenbsd
+       GoosPlan9     = goos.GoosPlan9
+       GoosSolaris   = goos.GoosSolaris
+       GoosWindows   = goos.GoosWindows
+       GoosZos       = goos.GoosZos
+)
index 9d9ac4507f66447037acc3599f70640583a97cf4..694101d36fda4133c60640b714437198e35dce60 100644 (file)
@@ -5,11 +5,3 @@
 // package sys contains system- and configuration- and architecture-specific
 // constants used by the runtime.
 package sys
-
-// The next line makes 'go generate' write the zgo*.go files with
-// per-OS and per-arch information, including constants
-// named Goos$GOOS and Goarch$GOARCH for every
-// known GOOS and GOARCH. The constant is 1 on the
-// current system, 0 otherwise; multiplying by them is
-// useful for defining GOOS- or GOARCH-specific constants.
-//go:generate go run gengoos.go