mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-05 08:37:31 -04:00
unix: remove Go 1.12 compatibility on darwin
Go 1.12 was released more than 3 years ago. Dropping support for it will simplify generating the wrappers needed for Getdirentries implementation. Change-Id: If24bf6ff9076fb4e281948c67bac87744df98d7a Reviewed-on: https://go-review.googlesource.com/c/sys/+/430176 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
committed by
Gopher Robot
parent
63ea559210
commit
7b5979e65e
+4
-26
@@ -31,7 +31,7 @@ func archPtrSize(arch string) int {
|
||||
}
|
||||
}
|
||||
|
||||
func generateASMFile(arch string, inFileNames []string, outFileName, buildTags string) map[string]bool {
|
||||
func generateASMFile(arch string, inFileNames []string, outFileName string) map[string]bool {
|
||||
trampolines := map[string]bool{}
|
||||
var orderedTrampolines []string
|
||||
for _, inFileName := range inFileNames {
|
||||
@@ -59,11 +59,6 @@ func generateASMFile(arch string, inFileNames []string, outFileName, buildTags s
|
||||
fmt.Fprintf(&out, "// go run mkasm.go %s\n", strings.Join(os.Args[1:], " "))
|
||||
fmt.Fprintf(&out, "// Code generated by the command above; DO NOT EDIT.\n")
|
||||
fmt.Fprintf(&out, "\n")
|
||||
if buildTags != "" {
|
||||
fmt.Fprintf(&out, "//go:build %s\n", buildTags)
|
||||
fmt.Fprintf(&out, "// +build %s\n", buildTags)
|
||||
fmt.Fprintf(&out, "\n")
|
||||
}
|
||||
fmt.Fprintf(&out, "#include \"textflag.h\"\n")
|
||||
for _, fn := range orderedTrampolines {
|
||||
fmt.Fprintf(&out, "\nTEXT %s_trampoline<>(SB),NOSPLIT,$0-0\n", fn)
|
||||
@@ -121,7 +116,6 @@ func main() {
|
||||
}
|
||||
goos, arch := os.Args[1], os.Args[2]
|
||||
|
||||
buildTags := ""
|
||||
syscallFilename := fmt.Sprintf("syscall_%s.go", goos)
|
||||
syscallArchFilename := fmt.Sprintf("syscall_%s_%s.go", goos, arch)
|
||||
zsyscallArchFilename := fmt.Sprintf("zsyscall_%s_%s.go", goos, arch)
|
||||
@@ -133,25 +127,9 @@ func main() {
|
||||
zsyscallArchFilename,
|
||||
}
|
||||
|
||||
trampolines := generateASMFile(arch, inFileNames, zsyscallASMFileName)
|
||||
|
||||
if goos == "darwin" {
|
||||
buildTags = "go1.12"
|
||||
writeDarwinTest(trampolines, fmt.Sprintf("darwin_%s_test.go", arch), arch)
|
||||
}
|
||||
trampolines := generateASMFile(arch, inFileNames, zsyscallASMFileName, buildTags)
|
||||
|
||||
if goos != "darwin" {
|
||||
return
|
||||
}
|
||||
|
||||
inFileNames = []string{
|
||||
"syscall_darwin.1_13.go",
|
||||
fmt.Sprintf("zsyscall_darwin_%s.1_13.go", arch),
|
||||
}
|
||||
trampolines2 := generateASMFile(arch, inFileNames, fmt.Sprintf("zsyscall_darwin_%s.1_13.s", arch), "go1.13")
|
||||
|
||||
// merge trampolines
|
||||
for trampoline := range trampolines2 {
|
||||
trampolines[trampoline] = true
|
||||
}
|
||||
|
||||
writeDarwinTest(trampolines, fmt.Sprintf("darwin_%s_test.go", arch), arch)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user