all: remove support for windows/arm

Also CL 690655 for golang.org/x/sys.

For #71671

Change-Id: Iceb369dec5affb944a39d07cdabfd7add6f1f319
Reviewed-on: https://go-review.googlesource.com/c/go/+/648795
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
qiulaidongfeng 2025-02-12 16:25:23 +08:00 committed by Gopher Robot
parent e0a1ea431c
commit dc54d7b607
19 changed files with 15 additions and 4205 deletions

View file

@ -1,2 +1,6 @@
## Ports {#ports}
### Windows
<!-- go.dev/issue/71671 -->
As [announced](/doc/go1.25#windows) in the Go 1.25 release notes, the [broken](/doc/go1.24#windows) 32-bit windows/arm port (`GOOS=windows` `GOARCH=arm`) is removed.

View file

@ -1819,7 +1819,6 @@ var cgoEnabled = map[string]bool{
"solaris/amd64": true,
"windows/386": true,
"windows/amd64": true,
"windows/arm": false,
"windows/arm64": true,
}
@ -1831,7 +1830,6 @@ var broken = map[string]bool{
"freebsd/riscv64": true, // Broken: go.dev/issue/73568.
"linux/sparc64": true, // An incomplete port. See CL 132155.
"openbsd/mips64": true, // Broken: go.dev/issue/58110.
"windows/arm": true, // Broken: go.dev/issue/68552.
}
// List of platforms which are first class ports. See go.dev/issue/38874.

View file

@ -33,7 +33,6 @@ type systeminfo struct {
const (
PROCESSOR_ARCHITECTURE_AMD64 = 9
PROCESSOR_ARCHITECTURE_INTEL = 0
PROCESSOR_ARCHITECTURE_ARM = 5
PROCESSOR_ARCHITECTURE_ARM64 = 12
PROCESSOR_ARCHITECTURE_IA64 = 6
)
@ -47,8 +46,6 @@ func sysinit() {
gohostarch = "amd64"
case PROCESSOR_ARCHITECTURE_INTEL:
gohostarch = "386"
case PROCESSOR_ARCHITECTURE_ARM:
gohostarch = "arm"
case PROCESSOR_ARCHITECTURE_ARM64:
gohostarch = "arm64"
default:

View file

@ -174,8 +174,6 @@ func (f *peFile) goarch() string {
return "386"
case pe.IMAGE_FILE_MACHINE_AMD64:
return "amd64"
case pe.IMAGE_FILE_MACHINE_ARMNT:
return "arm"
case pe.IMAGE_FILE_MACHINE_ARM64:
return "arm64"
default:

View file

@ -105,9 +105,5 @@ func archinit(ctxt *ld.Link) {
if *ld.FlagTextAddr == -1 {
*ld.FlagTextAddr = ld.Rnd(0x10000, *ld.FlagRound) + int64(ld.HEADR)
}
case objabi.Hwindows: /* PE executable */
// ld.HEADR, ld.FlagTextAddr, ld.FlagRound are set in ld.Peinit
return
}
}

View file

@ -34,7 +34,7 @@ func (mode *BuildMode) Set(s string) error {
return fmt.Errorf("invalid buildmode: %q", s)
case "exe":
switch buildcfg.GOOS + "/" + buildcfg.GOARCH {
case "darwin/arm64", "windows/arm", "windows/arm64": // On these platforms, everything is PIE
case "darwin/arm64", "windows/arm64": // On these platforms, everything is PIE
*mode = BuildModePIE
default:
*mode = BuildModeExe

View file

@ -913,8 +913,6 @@ func (f *peFile) writeFileHeader(ctxt *Link) {
fh.Machine = pe.IMAGE_FILE_MACHINE_AMD64
case sys.I386:
fh.Machine = pe.IMAGE_FILE_MACHINE_I386
case sys.ARM:
fh.Machine = pe.IMAGE_FILE_MACHINE_ARMNT
case sys.ARM64:
fh.Machine = pe.IMAGE_FILE_MACHINE_ARM64
}

View file

@ -194,7 +194,7 @@ func BuildModeSupported(compiler, buildmode, goos, goarch string) bool {
"ios/amd64", "ios/arm64",
"aix/ppc64",
"openbsd/arm64",
"windows/386", "windows/amd64", "windows/arm", "windows/arm64":
"windows/386", "windows/amd64", "windows/arm64":
return true
}
return false
@ -226,7 +226,7 @@ func InternalLinkPIESupported(goos, goarch string) bool {
case "android/arm64",
"darwin/amd64", "darwin/arm64",
"linux/amd64", "linux/arm64", "linux/loong64", "linux/ppc64le",
"windows/386", "windows/amd64", "windows/arm", "windows/arm64":
"windows/386", "windows/amd64", "windows/arm64":
return true
}
return false

View file

@ -57,7 +57,6 @@ var List = []OSArch{
{"wasip1", "wasm"},
{"windows", "386"},
{"windows", "amd64"},
{"windows", "arm"},
{"windows", "arm64"},
}
@ -111,6 +110,5 @@ var distInfo = map[OSArch]osArchInfo{
{"wasip1", "wasm"}: {},
{"windows", "386"}: {CgoSupported: true, FirstClass: true},
{"windows", "amd64"}: {CgoSupported: true, FirstClass: true},
{"windows", "arm"}: {Broken: true},
{"windows", "arm64"}: {CgoSupported: true},
}

View file

@ -794,9 +794,6 @@ TEXT setg<>(SB),NOSPLIT|NOFRAME,$0-0
MOVW R0, g
// Save g to thread-local storage.
#ifdef GOOS_windows
B runtime·save_g(SB)
#else
#ifdef GOOS_openbsd
B runtime·save_g(SB)
#else
@ -808,7 +805,6 @@ TEXT setg<>(SB),NOSPLIT|NOFRAME,$0-0
MOVW g, R0
RET
#endif
#endif
TEXT runtime·emptyfunc(SB),0,$0-0
RET

View file

@ -635,10 +635,6 @@ func TestCPUProfileWithFork(t *testing.T) {
// Use smaller size for Android to avoid crash.
heap = 100 << 20
}
if runtime.GOOS == "windows" && runtime.GOARCH == "arm" {
// Use smaller heap for Windows/ARM to avoid crash.
heap = 100 << 20
}
if testing.Short() {
heap = 100 << 20
}

View file

@ -1,12 +0,0 @@
// Copyright 2018 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.
#include "go_asm.h"
#include "go_tls.h"
#include "textflag.h"
// This is the entry point for the program from the
// kernel for an ordinary -buildmode=exe program.
TEXT _rt0_arm_windows(SB),NOSPLIT|NOFRAME,$0
B ·rt0_go(SB)

View file

@ -39,7 +39,7 @@ func enableWER() {
}
}
// in sys_windows_386.s, sys_windows_amd64.s, sys_windows_arm.s, and sys_windows_arm64.s
// in sys_windows_386.s, sys_windows_amd64.s, and sys_windows_arm64.s
func exceptiontramp()
func firstcontinuetramp()
func lastcontinuetramp()
@ -64,10 +64,9 @@ func initExceptionHandler() {
//go:nosplit
func isAbort(r *context) bool {
pc := r.ip()
if GOARCH == "386" || GOARCH == "amd64" || GOARCH == "arm" {
if GOARCH == "386" || GOARCH == "amd64" {
// In the case of an abort, the exception IP is one byte after
// the INT3 (this differs from UNIX OSes). Note that on ARM,
// this means that the exception IP is no longer aligned.
// the INT3 (this differs from UNIX OSes).
pc--
}
return isAbortPC(pc)

View file

@ -236,7 +236,7 @@ func callbackasm()
// and we want callback to arrive at
// correspondent call instruction instead of start of
// runtime.callbackasm.
// On ARM, runtime.callbackasm is a series of mov and branch instructions.
// On ARM64, runtime.callbackasm is a series of mov and branch instructions.
// R12 is loaded with the callback index. Each entry is two instructions,
// hence 8 bytes.
func callbackasmAddr(i int) uintptr {
@ -246,8 +246,8 @@ func callbackasmAddr(i int) uintptr {
panic("unsupported architecture")
case "386", "amd64":
entrySize = 5
case "arm", "arm64":
// On ARM and ARM64, each entry is a MOV instruction
case "arm64":
// On ARM64, each entry is a MOV instruction
// followed by a branch instruction
entrySize = 8
}

View file

@ -1,84 +0,0 @@
// Copyright 2018 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 !faketime
#include "go_asm.h"
#include "textflag.h"
#include "time_windows.h"
TEXT time·now(SB),NOSPLIT,$0-20
MOVW $_INTERRUPT_TIME, R3
loop:
MOVW time_hi1(R3), R1
DMB MB_ISH
MOVW time_lo(R3), R0
DMB MB_ISH
MOVW time_hi2(R3), R2
CMP R1, R2
BNE loop
// wintime = R1:R0, multiply by 100
MOVW $100, R2
MULLU R0, R2, (R4, R3) // R4:R3 = R1:R0 * R2
MULA R1, R2, R4, R4
// wintime*100 = R4:R3
MOVW R3, mono+12(FP)
MOVW R4, mono+16(FP)
MOVW $_SYSTEM_TIME, R3
wall:
MOVW time_hi1(R3), R1
DMB MB_ISH
MOVW time_lo(R3), R0
DMB MB_ISH
MOVW time_hi2(R3), R2
CMP R1, R2
BNE wall
// w = R1:R0 in 100ns untis
// convert to Unix epoch (but still 100ns units)
#define delta 116444736000000000
SUB.S $(delta & 0xFFFFFFFF), R0
SBC $(delta >> 32), R1
// Convert to nSec
MOVW $100, R2
MULLU R0, R2, (R4, R3) // R4:R3 = R1:R0 * R2
MULA R1, R2, R4, R4
// w = R2:R1 in nSec
MOVW R3, R1 // R4:R3 -> R2:R1
MOVW R4, R2
// multiply nanoseconds by reciprocal of 10**9 (scaled by 2**61)
// to get seconds (96 bit scaled result)
MOVW $0x89705f41, R3 // 2**61 * 10**-9
MULLU R1,R3,(R6,R5) // R7:R6:R5 = R2:R1 * R3
MOVW $0,R7
MULALU R2,R3,(R7,R6)
// unscale by discarding low 32 bits, shifting the rest by 29
MOVW R6>>29,R6 // R7:R6 = (R7:R6:R5 >> 61)
ORR R7<<3,R6
MOVW R7>>29,R7
// subtract (10**9 * sec) from nsec to get nanosecond remainder
MOVW $1000000000, R5 // 10**9
MULLU R6,R5,(R9,R8) // R9:R8 = R7:R6 * R5
MULA R7,R5,R9,R9
SUB.S R8,R1 // R2:R1 -= R9:R8
SBC R9,R2
// because reciprocal was a truncated repeating fraction, quotient
// may be slightly too small -- adjust to make remainder < 10**9
CMP R5,R1 // if remainder > 10**9
SUB.HS R5,R1 // remainder -= 10**9
ADD.HS $1,R6 // sec += 1
MOVW R6,sec_lo+0(FP)
MOVW R7,sec_hi+4(FP)
MOVW R1,nsec+8(FP)
RET

View file

@ -47,34 +47,6 @@ TEXT runtime·callbackasm(SB),NOSPLIT|NOFRAME,$0
}
}
func genasmArm() {
var buf bytes.Buffer
buf.WriteString(`// Code generated by wincallback.go using 'go generate'. DO NOT EDIT.
// External code calls into callbackasm at an offset corresponding
// to the callback index. Callbackasm is a table of MOV and B instructions.
// The MOV instruction loads R12 with the callback index, and the
// B instruction branches to callbackasm1.
// callbackasm1 takes the callback index from R12 and
// indexes into an array that stores information about each callback.
// It then calls the Go implementation for that callback.
#include "textflag.h"
TEXT runtime·callbackasm(SB),NOSPLIT|NOFRAME,$0
`)
for i := 0; i < maxCallback; i++ {
fmt.Fprintf(&buf, "\tMOVW\t$%d, R12\n", i)
buf.WriteString("\tB\truntime·callbackasm1(SB)\n")
}
err := os.WriteFile("zcallback_windows_arm.s", buf.Bytes(), 0666)
if err != nil {
fmt.Fprintf(os.Stderr, "wincallback: %s\n", err)
os.Exit(2)
}
}
func genasmArm64() {
var buf bytes.Buffer
@ -121,7 +93,6 @@ const cb_max = %d // maximum number of windows callbacks allowed
func main() {
genasm386Amd64()
genasmArm()
genasmArm64()
gengo()
}

File diff suppressed because it is too large Load diff

View file

@ -14,7 +14,6 @@ import (
"internal/msan"
"internal/oserror"
"internal/race"
"runtime"
"sync"
"unsafe"
)
@ -525,18 +524,8 @@ func setFilePointerEx(handle Handle, distToMove int64, newFilePointer *int64, wh
if unsafe.Sizeof(uintptr(0)) == 8 {
_, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 4, uintptr(handle), uintptr(distToMove), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence), 0, 0)
} else {
// Different 32-bit systems disgaree about whether distToMove starts 8-byte aligned.
switch runtime.GOARCH {
default:
panic("unsupported 32-bit architecture")
case "386":
// distToMove is a LARGE_INTEGER, which is 64 bits.
_, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 5, uintptr(handle), uintptr(distToMove), uintptr(distToMove>>32), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence), 0)
case "arm":
// distToMove must be 8-byte aligned per ARM calling convention
// https://docs.microsoft.com/en-us/cpp/build/overview-of-arm-abi-conventions#stage-c-assignment-of-arguments-to-registers-and-stack
_, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 6, uintptr(handle), 0, uintptr(distToMove), uintptr(distToMove>>32), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence))
}
// distToMove is a LARGE_INTEGER, which is 64 bits.
_, _, e1 = Syscall6(procSetFilePointerEx.Addr(), 5, uintptr(handle), uintptr(distToMove), uintptr(distToMove>>32), uintptr(unsafe.Pointer(newFilePointer)), uintptr(whence), 0)
}
if e1 != 0 {
return errnoErr(e1)

View file

@ -1,22 +0,0 @@
// Copyright 2018 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 syscall
type WSAData struct {
Version uint16
HighVersion uint16
Description [WSADESCRIPTION_LEN + 1]byte
SystemStatus [WSASYS_STATUS_LEN + 1]byte
MaxSockets uint16
MaxUdpDg uint16
VendorInfo *byte
}
type Servent struct {
Name *byte
Aliases **byte
Port uint16
Proto *byte
}