aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/internal/sys/gengoos.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/internal/sys/gengoos.go')
-rw-r--r--src/runtime/internal/sys/gengoos.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/runtime/internal/sys/gengoos.go b/src/runtime/internal/sys/gengoos.go
index 952b13649d..9bbc48d94f 100644
--- a/src/runtime/internal/sys/gengoos.go
+++ b/src/runtime/internal/sys/gengoos.go
@@ -9,8 +9,8 @@ package main
import (
"bytes"
"fmt"
- "io/ioutil"
"log"
+ "os"
"strconv"
"strings"
)
@@ -18,7 +18,7 @@ import (
var gooses, goarches []string
func main() {
- data, err := ioutil.ReadFile("../../../go/build/syslist.go")
+ data, err := os.ReadFile("../../../go/build/syslist.go")
if err != nil {
log.Fatal(err)
}
@@ -44,6 +44,9 @@ func main() {
}
for _, target := range gooses {
+ if target == "nacl" {
+ continue
+ }
var buf bytes.Buffer
fmt.Fprintf(&buf, "// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.\n\n")
if target == "linux" {
@@ -52,6 +55,9 @@ func main() {
if target == "solaris" {
fmt.Fprintf(&buf, "// +build !illumos\n") // must explicitly exclude illumos for solaris
}
+ if target == "darwin" {
+ fmt.Fprintf(&buf, "// +build !ios\n") // must explicitly exclude ios for darwin
+ }
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 GOOS = `%s`\n\n", target)
@@ -62,13 +68,16 @@ func main() {
}
fmt.Fprintf(&buf, "const Goos%s = %d\n", strings.Title(goos), value)
}
- err := ioutil.WriteFile("zgoos_"+target+".go", buf.Bytes(), 0666)
+ err := os.WriteFile("zgoos_"+target+".go", buf.Bytes(), 0666)
if err != nil {
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, "// +build %s\n\n", target) // must explicitly include target for bootstrapping purposes
@@ -81,7 +90,7 @@ func main() {
}
fmt.Fprintf(&buf, "const Goarch%s = %d\n", strings.Title(goarch), value)
}
- err := ioutil.WriteFile("zgoarch_"+target+".go", buf.Bytes(), 0666)
+ err := os.WriteFile("zgoarch_"+target+".go", buf.Bytes(), 0666)
if err != nil {
log.Fatal(err)
}