Skip to content

Commit

Permalink
cmd, syscall: use syscall.Mmap on solaris for Go ≥ 1.20
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tklauser authored and gopherbot committed Sep 15, 2022
1 parent 972870d commit 7c32844
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/cmd/compile/internal/base/mapfile_mmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 8 additions & 2 deletions src/cmd/compile/internal/base/mapfile_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/cmd/internal/bio/buf_mmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 8 additions & 2 deletions src/cmd/internal/bio/buf_nommap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/cmd/link/internal/ld/outbuf_mmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 10 additions & 2 deletions src/cmd/link/internal/ld/outbuf_nommap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/syscall/zerrors_solaris_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7c32844

Please sign in to comment.