]> Cypherpunks repositories - gostls13.git/commitdiff
cmd, syscall: use syscall.Mmap on solaris for Go ≥ 1.20
authorTobias Klauser <tklauser@distanz.ch>
Wed, 14 Sep 2022 15:08:15 +0000 (17:08 +0200)
committerGopher Robot <gobot@golang.org>
Thu, 15 Sep 2022 06:23:50 +0000 (06:23 +0000)
CL 413374 added syscall.Mmap on solaris. Use it in cmd/compile and
cmd/link if the bootstrap toolchain is Go ≥ 1.20.

For #52875
For #54265

Change-Id: I9a0534bf97926eecf0c6f1f9218e855344ba158f
Reviewed-on: https://go-review.googlesource.com/c/go/+/430496
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>

src/cmd/compile/internal/base/mapfile_mmap.go
src/cmd/compile/internal/base/mapfile_read.go
src/cmd/internal/bio/buf_mmap.go
src/cmd/internal/bio/buf_nommap.go
src/cmd/link/internal/ld/outbuf_mmap.go
src/cmd/link/internal/ld/outbuf_nommap.go
src/syscall/zerrors_solaris_amd64.go

index 3a5f4cfe21d889d98f722a64cf46c5498116bcf5..b01d0f4efc664718edffbacd760ef0e7bcd6ad59 100644 (file)
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd
-// +build darwin dragonfly freebsd linux netbsd openbsd
+//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || (solaris && go1.20)
+// +build darwin dragonfly freebsd linux netbsd openbsd solaris,go1.20
 
 package base
 
index 01796a9bab7c9978f0b22211d714efff01782c58..e84810ea347eed96c110545e6551ec8c722ac5e9 100644 (file)
@@ -2,8 +2,14 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd
-// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd
+//go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !(solaris && go1.20)
+// +build !darwin
+// +build !dragonfly
+// +build !freebsd
+// +build !linux
+// +build !netbsd
+// +build !openbsd
+// +build !solaris !go1.20
 
 package base
 
index 89ae39f736abbd82e679495bf7bf132a4c628818..3543637154312651c7d2d2b394644c94ba42aea2 100644 (file)
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd
-// +build darwin dragonfly freebsd linux netbsd openbsd
+//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || (solaris && go1.20)
+// +build darwin dragonfly freebsd linux netbsd openbsd solaris,go1.20
 
 package bio
 
index 533a93180cdbf9e966df3b607e067d667a1dd2dc..dab3435260a14b0352461098164f3b5fcca14d25 100644 (file)
@@ -2,8 +2,14 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd
-// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd
+//go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !(solaris && go1.20)
+// +build !darwin
+// +build !dragonfly
+// +build !freebsd
+// +build !linux
+// +build !netbsd
+// +build !openbsd
+// +build !solaris !go1.20
 
 package bio
 
index 40a3222788ecb925ef32738bcf54db9a5eee01da..d8f8a10db137f3f904c2aeaad75244df71e55e33 100644 (file)
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd
-// +build aix darwin dragonfly freebsd linux netbsd openbsd
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || (solaris && go1.20)
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris,go1.20
 
 package ld
 
index c870fa2c1823942106ca920c65b0295333128791..4154981b099df07f0236e06a051984aa77829e2d 100644 (file)
@@ -2,8 +2,16 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !windows
-// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!windows
+//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !(solaris && go1.20) && !windows
+// +build !aix
+// +build !darwin
+// +build !dragonfly
+// +build !freebsd
+// +build !linux
+// +build !netbsd
+// +build !openbsd
+// +build !solaris !go1.20
+// +build !windows
 
 package ld
 
index fb25dacee43f8d88655528d3b9721273cd01772b..8e77bf79c6e08211d574caa1a39a8e7a78aff79b 100644 (file)
@@ -594,6 +594,7 @@ const (
        MAP_ALIGN                     = 0x200
        MAP_ANON                      = 0x100
        MAP_ANONYMOUS                 = 0x100
+       MAP_FILE                      = 0x0
        MAP_FIXED                     = 0x10
        MAP_INITDATA                  = 0x800
        MAP_NORESERVE                 = 0x40