mirror of
https://github.com/golang/go.git
synced 2025-05-06 08:03:03 +00:00
all: remove scattered remnants of darwin/arm
This removes all conditions and conditional code (that I could find) that depended on darwin/arm. Fixes #35439 (since that only happened on darwin/arm) Fixes #37611. Change-Id: Ia4c32a5a4368ed75231075832b0b5bfb1ad11986 Reviewed-on: https://go-review.googlesource.com/c/go/+/227198 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
parent
da8591b61c
commit
f7e6ab44b4
@ -32,7 +32,7 @@ func TestCrossPackageTests(t *testing.T) {
|
|||||||
t.Skip("Can't exec cmd/go subprocess on Android.")
|
t.Skip("Can't exec cmd/go subprocess on Android.")
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch runtime.GOARCH {
|
switch runtime.GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
t.Skip("Can't exec cmd/go subprocess on iOS.")
|
t.Skip("Can't exec cmd/go subprocess on iOS.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ import (
|
|||||||
|
|
||||||
func testSigaltstack(t *testing.T) {
|
func testSigaltstack(t *testing.T) {
|
||||||
switch {
|
switch {
|
||||||
case runtime.GOOS == "solaris", runtime.GOOS == "illumos", runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64"):
|
case runtime.GOOS == "solaris", runtime.GOOS == "illumos", runtime.GOOS == "darwin" && runtime.GOARCH == "arm64":
|
||||||
t.Skipf("switching signal stack not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
|
t.Skipf("switching signal stack not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
|
||||||
case runtime.GOOS == "darwin" && runtime.GOARCH == "386":
|
case runtime.GOOS == "darwin" && runtime.GOARCH == "386":
|
||||||
t.Skipf("sigaltstack fails on darwin/386")
|
t.Skipf("sigaltstack fails on darwin/386")
|
||||||
|
@ -159,7 +159,7 @@ func Add(x int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testCthread(t *testing.T) {
|
func testCthread(t *testing.T) {
|
||||||
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
||||||
t.Skip("the iOS exec wrapper is unable to properly handle the panic from Add")
|
t.Skip("the iOS exec wrapper is unable to properly handle the panic from Add")
|
||||||
}
|
}
|
||||||
sum.i = 0
|
sum.i = 0
|
||||||
|
@ -134,7 +134,7 @@ func testMain(m *testing.M) int {
|
|||||||
} else {
|
} else {
|
||||||
switch GOOS {
|
switch GOOS {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
if GOARCH == "arm" || GOARCH == "arm64" {
|
if GOARCH == "arm64" {
|
||||||
libbase += "_shared"
|
libbase += "_shared"
|
||||||
}
|
}
|
||||||
case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos":
|
case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos":
|
||||||
@ -305,7 +305,7 @@ func TestEarlySignalHandler(t *testing.T) {
|
|||||||
switch GOOS {
|
switch GOOS {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch GOARCH {
|
switch GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
|
t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
|
||||||
}
|
}
|
||||||
case "windows":
|
case "windows":
|
||||||
@ -487,7 +487,7 @@ func checkSignalForwardingTest(t *testing.T) {
|
|||||||
switch GOOS {
|
switch GOOS {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch GOARCH {
|
switch GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
|
t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
|
||||||
}
|
}
|
||||||
case "windows":
|
case "windows":
|
||||||
@ -603,7 +603,7 @@ func TestExtar(t *testing.T) {
|
|||||||
if runtime.Compiler == "gccgo" {
|
if runtime.Compiler == "gccgo" {
|
||||||
t.Skip("skipping -extar test when using gccgo")
|
t.Skip("skipping -extar test when using gccgo")
|
||||||
}
|
}
|
||||||
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
||||||
t.Skip("shell scripts are not executable on iOS hosts")
|
t.Skip("shell scripts are not executable on iOS hosts")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ func testMain(m *testing.M) int {
|
|||||||
libgodir := GOOS + "_" + GOARCH
|
libgodir := GOOS + "_" + GOARCH
|
||||||
switch GOOS {
|
switch GOOS {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
if GOARCH == "arm" || GOARCH == "arm64" {
|
if GOARCH == "arm64" {
|
||||||
libgodir += "_shared"
|
libgodir += "_shared"
|
||||||
}
|
}
|
||||||
case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos":
|
case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos":
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
func requireTestSOSupported(t *testing.T) {
|
func requireTestSOSupported(t *testing.T) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
switch runtime.GOARCH {
|
switch runtime.GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
if runtime.GOOS == "darwin" {
|
if runtime.GOOS == "darwin" {
|
||||||
t.Skip("No exec facility on iOS.")
|
t.Skip("No exec facility on iOS.")
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
func requireTestSOSupported(t *testing.T) {
|
func requireTestSOSupported(t *testing.T) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
switch runtime.GOARCH {
|
switch runtime.GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
if runtime.GOOS == "darwin" {
|
if runtime.GOOS == "darwin" {
|
||||||
t.Skip("No exec facility on iOS.")
|
t.Skip("No exec facility on iOS.")
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,7 @@ export IPHONEOS_DEPLOYMENT_TARGET=5.1
|
|||||||
# cmd/cgo doesn't support llvm-gcc-4.2, so we have to use clang.
|
# cmd/cgo doesn't support llvm-gcc-4.2, so we have to use clang.
|
||||||
CLANG=`xcrun --sdk $SDK --find clang`
|
CLANG=`xcrun --sdk $SDK --find clang`
|
||||||
|
|
||||||
if [ "$GOARCH" == "arm" ]; then
|
if [ "$GOARCH" == "arm64" ]; then
|
||||||
CLANGARCH="armv7"
|
|
||||||
elif [ "$GOARCH" == "arm64" ]; then
|
|
||||||
CLANGARCH="arm64"
|
CLANGARCH="arm64"
|
||||||
else
|
else
|
||||||
echo "unknown GOARCH=$GOARCH" >&2
|
echo "unknown GOARCH=$GOARCH" >&2
|
||||||
|
@ -42,7 +42,7 @@ gettargets() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
selectedtargets() {
|
selectedtargets() {
|
||||||
gettargets | egrep -v 'android-arm|darwin-arm' | egrep "$pattern"
|
gettargets | egrep -v 'android-arm|darwin-arm64' | egrep "$pattern"
|
||||||
}
|
}
|
||||||
|
|
||||||
# put linux first in the target list to get all the architectures up front.
|
# put linux first in the target list to get all the architectures up front.
|
||||||
|
4
src/cmd/dist/build.go
vendored
4
src/cmd/dist/build.go
vendored
@ -1461,8 +1461,8 @@ func wrapperPathFor(goos, goarch string) string {
|
|||||||
if gohostos != "android" {
|
if gohostos != "android" {
|
||||||
return pathf("%s/misc/android/go_android_exec.go", goroot)
|
return pathf("%s/misc/android/go_android_exec.go", goroot)
|
||||||
}
|
}
|
||||||
case goos == "darwin" && (goarch == "arm" || goarch == "arm64"):
|
case goos == "darwin" && goarch == "arm64":
|
||||||
if gohostos != "darwin" || (gohostarch != "arm" && gohostarch != "arm64") {
|
if gohostos != "darwin" || gohostarch != "arm64" {
|
||||||
return pathf("%s/misc/ios/go_darwin_arm_exec.go", goroot)
|
return pathf("%s/misc/ios/go_darwin_arm_exec.go", goroot)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
8
src/cmd/dist/test.go
vendored
8
src/cmd/dist/test.go
vendored
@ -887,7 +887,7 @@ func (t *tester) addCmd(dt *distTest, dir string, cmdline ...interface{}) *exec.
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *tester) iOS() bool {
|
func (t *tester) iOS() bool {
|
||||||
return goos == "darwin" && (goarch == "arm" || goarch == "arm64")
|
return goos == "darwin" && goarch == "arm64"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *tester) out(v string) {
|
func (t *tester) out(v string) {
|
||||||
@ -902,7 +902,7 @@ func (t *tester) extLink() bool {
|
|||||||
switch pair {
|
switch pair {
|
||||||
case "aix-ppc64",
|
case "aix-ppc64",
|
||||||
"android-arm", "android-arm64",
|
"android-arm", "android-arm64",
|
||||||
"darwin-386", "darwin-amd64", "darwin-arm", "darwin-arm64",
|
"darwin-386", "darwin-amd64", "darwin-arm64",
|
||||||
"dragonfly-amd64",
|
"dragonfly-amd64",
|
||||||
"freebsd-386", "freebsd-amd64", "freebsd-arm",
|
"freebsd-386", "freebsd-amd64", "freebsd-arm",
|
||||||
"linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-mips64", "linux-mips64le", "linux-mips", "linux-mipsle", "linux-s390x",
|
"linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-mips64", "linux-mips64le", "linux-mips", "linux-mipsle", "linux-s390x",
|
||||||
@ -927,7 +927,7 @@ func (t *tester) internalLink() bool {
|
|||||||
if goos == "android" {
|
if goos == "android" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if goos == "darwin" && (goarch == "arm" || goarch == "arm64") {
|
if t.iOS() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// Internally linking cgo is incomplete on some architectures.
|
// Internally linking cgo is incomplete on some architectures.
|
||||||
@ -963,7 +963,7 @@ func (t *tester) supportedBuildmode(mode string) bool {
|
|||||||
}
|
}
|
||||||
switch pair {
|
switch pair {
|
||||||
case "aix-ppc64",
|
case "aix-ppc64",
|
||||||
"darwin-386", "darwin-amd64", "darwin-arm", "darwin-arm64",
|
"darwin-386", "darwin-amd64", "darwin-arm64",
|
||||||
"linux-amd64", "linux-386", "linux-ppc64le", "linux-s390x",
|
"linux-amd64", "linux-386", "linux-ppc64le", "linux-s390x",
|
||||||
"freebsd-amd64",
|
"freebsd-amd64",
|
||||||
"windows-amd64", "windows-386":
|
"windows-amd64", "windows-386":
|
||||||
|
4
src/cmd/dist/util.go
vendored
4
src/cmd/dist/util.go
vendored
@ -383,8 +383,8 @@ func xsamefile(f1, f2 string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func xgetgoarm() string {
|
func xgetgoarm() string {
|
||||||
if goos == "darwin" || goos == "android" {
|
if goos == "android" {
|
||||||
// Assume all darwin/arm and android devices have VFPv3.
|
// Assume all android devices have VFPv3.
|
||||||
// These ports are also mostly cross-compiled, so it makes little
|
// These ports are also mostly cross-compiled, so it makes little
|
||||||
// sense to auto-detect the setting.
|
// sense to auto-detect the setting.
|
||||||
return "7"
|
return "7"
|
||||||
|
@ -36,8 +36,8 @@ func TestMain(m *testing.M) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func maybeSkip(t *testing.T) {
|
func maybeSkip(t *testing.T) {
|
||||||
if runtime.GOOS == "darwin" && strings.HasPrefix(runtime.GOARCH, "arm") {
|
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
||||||
t.Skip("darwin/arm does not have a full file tree")
|
t.Skip("darwin/arm64 does not have a full file tree")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ func init() {
|
|||||||
canRun = false
|
canRun = false
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch runtime.GOARCH {
|
switch runtime.GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
canRun = false
|
canRun = false
|
||||||
}
|
}
|
||||||
case "linux":
|
case "linux":
|
||||||
|
@ -1940,8 +1940,7 @@ func externalLinkingForced(p *Package) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch cfg.BuildContext.GOARCH {
|
if cfg.BuildContext.GOARCH == "arm64" {
|
||||||
case "arm", "arm64":
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ func pkgImportPath(pkgpath string) *load.Package {
|
|||||||
func TestRespectSetgidDir(t *testing.T) {
|
func TestRespectSetgidDir(t *testing.T) {
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
|
if runtime.GOARCH == "arm64" {
|
||||||
t.Skip("can't set SetGID bit with chmod on iOS")
|
t.Skip("can't set SetGID bit with chmod on iOS")
|
||||||
}
|
}
|
||||||
case "windows", "plan9":
|
case "windows", "plan9":
|
||||||
|
@ -117,7 +117,7 @@ func buildModeInit() {
|
|||||||
switch cfg.Goos {
|
switch cfg.Goos {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch cfg.Goarch {
|
switch cfg.Goarch {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
codegenArg = "-shared"
|
codegenArg = "-shared"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ func buildModeInit() {
|
|||||||
ldBuildmode = "pie"
|
ldBuildmode = "pie"
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch cfg.Goarch {
|
switch cfg.Goarch {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
codegenArg = "-shared"
|
codegenArg = "-shared"
|
||||||
}
|
}
|
||||||
fallthrough
|
fallthrough
|
||||||
|
@ -39,7 +39,7 @@ func MustLinkExternal(goos, goarch string) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
case "darwin":
|
case "darwin":
|
||||||
if goarch == "arm" || goarch == "arm64" {
|
if goarch == "arm64" {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -789,11 +789,6 @@ func asmb(ctxt *ld.Link) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func asmb2(ctxt *ld.Link) {
|
func asmb2(ctxt *ld.Link) {
|
||||||
machlink := uint32(0)
|
|
||||||
if ctxt.HeadType == objabi.Hdarwin {
|
|
||||||
machlink = uint32(ld.Domacholink(ctxt))
|
|
||||||
}
|
|
||||||
|
|
||||||
/* output symbol table */
|
/* output symbol table */
|
||||||
ld.Symsize = 0
|
ld.Symsize = 0
|
||||||
|
|
||||||
@ -811,9 +806,6 @@ func asmb2(ctxt *ld.Link) {
|
|||||||
case objabi.Hplan9:
|
case objabi.Hplan9:
|
||||||
symo = uint32(ld.Segdata.Fileoff + ld.Segdata.Filelen)
|
symo = uint32(ld.Segdata.Fileoff + ld.Segdata.Filelen)
|
||||||
|
|
||||||
case objabi.Hdarwin:
|
|
||||||
symo = uint32(ld.Segdwarf.Fileoff + uint64(ld.Rnd(int64(ld.Segdwarf.Filelen), int64(*ld.FlagRound))) + uint64(machlink))
|
|
||||||
|
|
||||||
case objabi.Hwindows:
|
case objabi.Hwindows:
|
||||||
symo = uint32(ld.Segdwarf.Fileoff + ld.Segdwarf.Filelen)
|
symo = uint32(ld.Segdwarf.Fileoff + ld.Segdwarf.Filelen)
|
||||||
symo = uint32(ld.Rnd(int64(symo), ld.PEFILEALIGN))
|
symo = uint32(ld.Rnd(int64(symo), ld.PEFILEALIGN))
|
||||||
@ -845,11 +837,6 @@ func asmb2(ctxt *ld.Link) {
|
|||||||
|
|
||||||
case objabi.Hwindows:
|
case objabi.Hwindows:
|
||||||
// Do nothing
|
// Do nothing
|
||||||
|
|
||||||
case objabi.Hdarwin:
|
|
||||||
if ctxt.LinkMode == ld.LinkExternal {
|
|
||||||
ld.Machoemitreloc(ctxt)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -872,9 +859,6 @@ func asmb2(ctxt *ld.Link) {
|
|||||||
objabi.Hopenbsd:
|
objabi.Hopenbsd:
|
||||||
ld.Asmbelf(ctxt, int64(symo))
|
ld.Asmbelf(ctxt, int64(symo))
|
||||||
|
|
||||||
case objabi.Hdarwin:
|
|
||||||
ld.Asmbmacho(ctxt)
|
|
||||||
|
|
||||||
case objabi.Hwindows:
|
case objabi.Hwindows:
|
||||||
ld.Asmbpe(ctxt)
|
ld.Asmbpe(ctxt)
|
||||||
}
|
}
|
||||||
|
@ -100,15 +100,6 @@ func archinit(ctxt *ld.Link) {
|
|||||||
*ld.FlagRound = 0x10000
|
*ld.FlagRound = 0x10000
|
||||||
}
|
}
|
||||||
|
|
||||||
case objabi.Hdarwin: /* apple MACH */
|
|
||||||
ld.HEADR = ld.INITIAL_MACHO_HEADR
|
|
||||||
if *ld.FlagTextAddr == -1 {
|
|
||||||
*ld.FlagTextAddr = 4096 + int64(ld.HEADR)
|
|
||||||
}
|
|
||||||
if *ld.FlagRound == -1 {
|
|
||||||
*ld.FlagRound = 4096
|
|
||||||
}
|
|
||||||
|
|
||||||
case objabi.Hwindows: /* PE executable */
|
case objabi.Hwindows: /* PE executable */
|
||||||
// ld.HEADR, ld.FlagTextAddr, ld.FlagRound are set in ld.Peinit
|
// ld.HEADR, ld.FlagTextAddr, ld.FlagRound are set in ld.Peinit
|
||||||
return
|
return
|
||||||
|
@ -106,9 +106,6 @@ func (ctxt *Link) computeTLSOffset() {
|
|||||||
case sys.AMD64:
|
case sys.AMD64:
|
||||||
ctxt.Tlsoffset = 0x30
|
ctxt.Tlsoffset = 0x30
|
||||||
|
|
||||||
case sys.ARM:
|
|
||||||
ctxt.Tlsoffset = 0 // dummy value, not needed
|
|
||||||
|
|
||||||
case sys.ARM64:
|
case sys.ARM64:
|
||||||
ctxt.Tlsoffset = 0 // dummy value, not needed
|
ctxt.Tlsoffset = 0 // dummy value, not needed
|
||||||
}
|
}
|
||||||
|
@ -618,15 +618,6 @@ func archreloc(ctxt *ld.Link, r *sym.Reloc, s *sym.Symbol, val int64) (int64, bo
|
|||||||
}
|
}
|
||||||
r.Xsym = rs
|
r.Xsym = rs
|
||||||
|
|
||||||
// ld64 for arm seems to want the symbol table to contain offset
|
|
||||||
// into the section rather than pseudo virtual address that contains
|
|
||||||
// the section load address.
|
|
||||||
// we need to compensate that by removing the instruction's address
|
|
||||||
// from addend.
|
|
||||||
if ctxt.HeadType == objabi.Hdarwin {
|
|
||||||
r.Xadd -= ld.Symaddr(s) + int64(r.Off)
|
|
||||||
}
|
|
||||||
|
|
||||||
if r.Xadd/4 > 0x7fffff || r.Xadd/4 < -0x800000 {
|
if r.Xadd/4 > 0x7fffff || r.Xadd/4 < -0x800000 {
|
||||||
ld.Errorf(s, "direct call too far %d", r.Xadd/4)
|
ld.Errorf(s, "direct call too far %d", r.Xadd/4)
|
||||||
}
|
}
|
||||||
@ -789,11 +780,6 @@ func asmb(ctxt *ld.Link) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func asmb2(ctxt *ld.Link) {
|
func asmb2(ctxt *ld.Link) {
|
||||||
machlink := uint32(0)
|
|
||||||
if ctxt.HeadType == objabi.Hdarwin {
|
|
||||||
machlink = uint32(ld.Domacholink(ctxt))
|
|
||||||
}
|
|
||||||
|
|
||||||
/* output symbol table */
|
/* output symbol table */
|
||||||
ld.Symsize = 0
|
ld.Symsize = 0
|
||||||
|
|
||||||
@ -811,9 +797,6 @@ func asmb2(ctxt *ld.Link) {
|
|||||||
case objabi.Hplan9:
|
case objabi.Hplan9:
|
||||||
symo = uint32(ld.Segdata.Fileoff + ld.Segdata.Filelen)
|
symo = uint32(ld.Segdata.Fileoff + ld.Segdata.Filelen)
|
||||||
|
|
||||||
case objabi.Hdarwin:
|
|
||||||
symo = uint32(ld.Segdwarf.Fileoff + uint64(ld.Rnd(int64(ld.Segdwarf.Filelen), int64(*ld.FlagRound))) + uint64(machlink))
|
|
||||||
|
|
||||||
case objabi.Hwindows:
|
case objabi.Hwindows:
|
||||||
symo = uint32(ld.Segdwarf.Fileoff + ld.Segdwarf.Filelen)
|
symo = uint32(ld.Segdwarf.Fileoff + ld.Segdwarf.Filelen)
|
||||||
symo = uint32(ld.Rnd(int64(symo), ld.PEFILEALIGN))
|
symo = uint32(ld.Rnd(int64(symo), ld.PEFILEALIGN))
|
||||||
@ -845,11 +828,6 @@ func asmb2(ctxt *ld.Link) {
|
|||||||
|
|
||||||
case objabi.Hwindows:
|
case objabi.Hwindows:
|
||||||
// Do nothing
|
// Do nothing
|
||||||
|
|
||||||
case objabi.Hdarwin:
|
|
||||||
if ctxt.LinkMode == ld.LinkExternal {
|
|
||||||
ld.Machoemitreloc(ctxt)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -872,9 +850,6 @@ func asmb2(ctxt *ld.Link) {
|
|||||||
objabi.Hopenbsd:
|
objabi.Hopenbsd:
|
||||||
ld.Asmbelf(ctxt, int64(symo))
|
ld.Asmbelf(ctxt, int64(symo))
|
||||||
|
|
||||||
case objabi.Hdarwin:
|
|
||||||
ld.Asmbmacho(ctxt)
|
|
||||||
|
|
||||||
case objabi.Hwindows:
|
case objabi.Hwindows:
|
||||||
ld.Asmbpe(ctxt)
|
ld.Asmbpe(ctxt)
|
||||||
}
|
}
|
||||||
|
@ -100,15 +100,6 @@ func archinit(ctxt *ld.Link) {
|
|||||||
*ld.FlagRound = 0x10000
|
*ld.FlagRound = 0x10000
|
||||||
}
|
}
|
||||||
|
|
||||||
case objabi.Hdarwin: /* apple MACH */
|
|
||||||
ld.HEADR = ld.INITIAL_MACHO_HEADR
|
|
||||||
if *ld.FlagTextAddr == -1 {
|
|
||||||
*ld.FlagTextAddr = 4096 + int64(ld.HEADR)
|
|
||||||
}
|
|
||||||
if *ld.FlagRound == -1 {
|
|
||||||
*ld.FlagRound = 4096
|
|
||||||
}
|
|
||||||
|
|
||||||
case objabi.Hwindows: /* PE executable */
|
case objabi.Hwindows: /* PE executable */
|
||||||
// ld.HEADR, ld.FlagTextAddr, ld.FlagRound are set in ld.Peinit
|
// ld.HEADR, ld.FlagTextAddr, ld.FlagRound are set in ld.Peinit
|
||||||
return
|
return
|
||||||
|
@ -104,9 +104,6 @@ func (ctxt *Link) computeTLSOffset() {
|
|||||||
case sys.AMD64:
|
case sys.AMD64:
|
||||||
ctxt.Tlsoffset = 0x30
|
ctxt.Tlsoffset = 0x30
|
||||||
|
|
||||||
case sys.ARM:
|
|
||||||
ctxt.Tlsoffset = 0 // dummy value, not needed
|
|
||||||
|
|
||||||
case sys.ARM64:
|
case sys.ARM64:
|
||||||
ctxt.Tlsoffset = 0 // dummy value, not needed
|
ctxt.Tlsoffset = 0 // dummy value, not needed
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
|
|
||||||
func TestSystemRoots(t *testing.T) {
|
func TestSystemRoots(t *testing.T) {
|
||||||
switch runtime.GOARCH {
|
switch runtime.GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
t.Skipf("skipping on %s/%s, no system root", runtime.GOOS, runtime.GOARCH)
|
t.Skipf("skipping on %s/%s, no system root", runtime.GOOS, runtime.GOARCH)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,11 +111,8 @@ func TestMultiplePackageImport(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestLocalDirectory(t *testing.T) {
|
func TestLocalDirectory(t *testing.T) {
|
||||||
if runtime.GOOS == "darwin" {
|
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
||||||
switch runtime.GOARCH {
|
t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
|
||||||
case "arm", "arm64":
|
|
||||||
t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cwd, err := os.Getwd()
|
cwd, err := os.Getwd()
|
||||||
@ -244,11 +241,8 @@ func TestMatchFile(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestImportCmd(t *testing.T) {
|
func TestImportCmd(t *testing.T) {
|
||||||
if runtime.GOOS == "darwin" {
|
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
||||||
switch runtime.GOARCH {
|
t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
|
||||||
case "arm", "arm64":
|
|
||||||
t.Skipf("skipping on %s/%s, no valid GOROOT", runtime.GOOS, runtime.GOARCH)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p, err := Import("cmd/internal/objfile", "", 0)
|
p, err := Import("cmd/internal/objfile", "", 0)
|
||||||
|
@ -517,7 +517,7 @@ func listStdPkgs(goroot string) ([]string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDependencies(t *testing.T) {
|
func TestDependencies(t *testing.T) {
|
||||||
iOS := runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64")
|
iOS := runtime.GOOS == "darwin" && runtime.GOARCH == "arm64"
|
||||||
if iOS {
|
if iOS {
|
||||||
// Tests run in a limited file system and we do not
|
// Tests run in a limited file system and we do not
|
||||||
// provide access to every source file.
|
// provide access to every source file.
|
||||||
|
@ -26,8 +26,7 @@ import (
|
|||||||
// import.
|
// import.
|
||||||
func skipSpecialPlatforms(t *testing.T) {
|
func skipSpecialPlatforms(t *testing.T) {
|
||||||
switch platform := runtime.GOOS + "-" + runtime.GOARCH; platform {
|
switch platform := runtime.GOOS + "-" + runtime.GOARCH; platform {
|
||||||
case "darwin-arm",
|
case "darwin-arm64":
|
||||||
"darwin-arm64":
|
|
||||||
t.Skipf("no compiled packages available for import on %s", platform)
|
t.Skipf("no compiled packages available for import on %s", platform)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ func HasGoBuild() bool {
|
|||||||
case "android", "js":
|
case "android", "js":
|
||||||
return false
|
return false
|
||||||
case "darwin":
|
case "darwin":
|
||||||
if strings.HasPrefix(runtime.GOARCH, "arm") {
|
if runtime.GOARCH == "arm64" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ func HasExec() bool {
|
|||||||
case "js":
|
case "js":
|
||||||
return false
|
return false
|
||||||
case "darwin":
|
case "darwin":
|
||||||
if strings.HasPrefix(runtime.GOARCH, "arm") {
|
if runtime.GOARCH == "arm64" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ func HasExec() bool {
|
|||||||
func HasSrc() bool {
|
func HasSrc() bool {
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
if strings.HasPrefix(runtime.GOARCH, "arm") {
|
if runtime.GOARCH == "arm64" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# Use of this source code is governed by a BSD-style
|
# Use of this source code is governed by a BSD-style
|
||||||
# license that can be found in the LICENSE file.
|
# license that can be found in the LICENSE file.
|
||||||
|
|
||||||
# For testing darwin/arm{,64} on iOS.
|
# For testing darwin/arm64 on iOS.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
ulimit -c 0 # no core files
|
ulimit -c 0 # no core files
|
||||||
@ -20,13 +20,10 @@ if [ "$GOOS" != "darwin" ]; then
|
|||||||
echo "iostest.bash requires GOOS=darwin, got GOOS=$GOOS" 1>&2
|
echo "iostest.bash requires GOOS=darwin, got GOOS=$GOOS" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ "$GOARCH" != "arm" ] && [ "$GOARCH" != "arm64" ]; then
|
if [ "$GOARCH" != "arm64" ]; then
|
||||||
echo "iostest.bash requires GOARCH=arm or GOARCH=arm64, got GOARCH=$GOARCH" 1>&2
|
echo "iostest.bash requires GOARCH=arm64, got GOARCH=$GOARCH" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ "$GOARCH" = "arm" ]; then
|
|
||||||
export GOARM=7
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$1" = "-restart" ]; then
|
if [ "$1" = "-restart" ]; then
|
||||||
# Reboot to make sure previous runs do not interfere with the current run.
|
# Reboot to make sure previous runs do not interfere with the current run.
|
||||||
|
@ -53,7 +53,7 @@ func testableNetwork(network string) bool {
|
|||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch runtime.GOARCH {
|
switch runtime.GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
case "android":
|
case "android":
|
||||||
|
@ -991,7 +991,7 @@ func TestDialerControl(t *testing.T) {
|
|||||||
// except that it won't skip testing on non-mobile builders.
|
// except that it won't skip testing on non-mobile builders.
|
||||||
func mustHaveExternalNetwork(t *testing.T) {
|
func mustHaveExternalNetwork(t *testing.T) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
mobile := runtime.GOOS == "android" || runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64")
|
mobile := runtime.GOOS == "android" || runtime.GOOS == "darwin" && runtime.GOARCH == "arm64"
|
||||||
if testenv.Builder() == "" || mobile {
|
if testenv.Builder() == "" || mobile {
|
||||||
testenv.MustHaveExternalNetwork(t)
|
testenv.MustHaveExternalNetwork(t)
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ func TestLookupGoogleSRV(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
mustHaveExternalNetwork(t)
|
mustHaveExternalNetwork(t)
|
||||||
|
|
||||||
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
if iOS() {
|
||||||
t.Skip("no resolv.conf on iOS")
|
t.Skip("no resolv.conf on iOS")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ func TestLookupGmailMX(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
mustHaveExternalNetwork(t)
|
mustHaveExternalNetwork(t)
|
||||||
|
|
||||||
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
if iOS() {
|
||||||
t.Skip("no resolv.conf on iOS")
|
t.Skip("no resolv.conf on iOS")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ func TestLookupGmailNS(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
mustHaveExternalNetwork(t)
|
mustHaveExternalNetwork(t)
|
||||||
|
|
||||||
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
if iOS() {
|
||||||
t.Skip("no resolv.conf on iOS")
|
t.Skip("no resolv.conf on iOS")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ func TestLookupGmailTXT(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
mustHaveExternalNetwork(t)
|
mustHaveExternalNetwork(t)
|
||||||
|
|
||||||
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
if iOS() {
|
||||||
t.Skip("no resolv.conf on iOS")
|
t.Skip("no resolv.conf on iOS")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -637,7 +637,7 @@ func TestLookupDotsWithRemoteSource(t *testing.T) {
|
|||||||
t.Skip("IPv4 is required")
|
t.Skip("IPv4 is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
if iOS() {
|
||||||
t.Skip("no resolv.conf on iOS")
|
t.Skip("no resolv.conf on iOS")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ func testableNetwork(network string) bool {
|
|||||||
return unixEnabledOnAIX
|
return unixEnabledOnAIX
|
||||||
}
|
}
|
||||||
// iOS does not support unix, unixgram.
|
// iOS does not support unix, unixgram.
|
||||||
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
if iOS() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
case "unixpacket":
|
case "unixpacket":
|
||||||
@ -81,6 +81,10 @@ func testableNetwork(network string) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func iOS() bool {
|
||||||
|
return runtime.GOOS == "darwin" && runtime.GOARCH == "arm64"
|
||||||
|
}
|
||||||
|
|
||||||
// testableAddress reports whether address of network is testable on
|
// testableAddress reports whether address of network is testable on
|
||||||
// the current platform configuration.
|
// the current platform configuration.
|
||||||
func testableAddress(network, address string) bool {
|
func testableAddress(network, address string) bool {
|
||||||
|
@ -745,7 +745,7 @@ func TestWriteTimeoutFluctuation(t *testing.T) {
|
|||||||
defer c.Close()
|
defer c.Close()
|
||||||
|
|
||||||
d := time.Second
|
d := time.Second
|
||||||
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
if iOS() {
|
||||||
d = 3 * time.Second // see golang.org/issue/10775
|
d = 3 * time.Second // see golang.org/issue/10775
|
||||||
}
|
}
|
||||||
max := time.NewTimer(d)
|
max := time.NewTimer(d)
|
||||||
|
@ -482,7 +482,7 @@ func UserHomeDir() (string, error) {
|
|||||||
case "android":
|
case "android":
|
||||||
return "/sdcard", nil
|
return "/sdcard", nil
|
||||||
case "darwin":
|
case "darwin":
|
||||||
if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
|
if runtime.GOARCH == "arm64" {
|
||||||
return "/", nil
|
return "/", nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ var sysdir = func() *sysDir {
|
|||||||
}
|
}
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch runtime.GOARCH {
|
switch runtime.GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
wd, err := syscall.Getwd()
|
wd, err := syscall.Getwd()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wd = err.Error()
|
wd = err.Error()
|
||||||
@ -146,7 +146,7 @@ func localTmp() string {
|
|||||||
return TempDir()
|
return TempDir()
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch runtime.GOARCH {
|
switch runtime.GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
return TempDir()
|
return TempDir()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -483,7 +483,7 @@ func TestReaddirnamesOneAtATime(t *testing.T) {
|
|||||||
dir = "/system/bin"
|
dir = "/system/bin"
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch runtime.GOARCH {
|
switch runtime.GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
wd, err := Getwd()
|
wd, err := Getwd()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@ -1297,7 +1297,7 @@ func TestChdirAndGetwd(t *testing.T) {
|
|||||||
dirs = []string{"/", "/usr"}
|
dirs = []string{"/", "/usr"}
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch runtime.GOARCH {
|
switch runtime.GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
dirs = nil
|
dirs = nil
|
||||||
for _, d := range []string{"d1", "d2"} {
|
for _, d := range []string{"d1", "d2"} {
|
||||||
dir, err := ioutil.TempDir("", d)
|
dir, err := ioutil.TempDir("", d)
|
||||||
|
@ -109,8 +109,8 @@ func TestMkdirAllAtSlash(t *testing.T) {
|
|||||||
t.Skipf("skipping on %s", runtime.GOOS)
|
t.Skipf("skipping on %s", runtime.GOOS)
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch runtime.GOARCH {
|
switch runtime.GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
t.Skipf("skipping on darwin/%s, mkdir returns EPERM", runtime.GOARCH)
|
t.Skipf("skipping on darwin/arm64, mkdir returns EPERM")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RemoveAll("/_go_os_test")
|
RemoveAll("/_go_os_test")
|
||||||
|
@ -24,7 +24,7 @@ func (p *Process) blockUntilWaitable() (bool, error) {
|
|||||||
// The waitid system call expects a pointer to a siginfo_t,
|
// The waitid system call expects a pointer to a siginfo_t,
|
||||||
// which is 128 bytes on all GNU/Linux systems.
|
// which is 128 bytes on all GNU/Linux systems.
|
||||||
// On Darwin, it requires greater than or equal to 64 bytes
|
// On Darwin, it requires greater than or equal to 64 bytes
|
||||||
// for darwin/{386,arm} and 104 bytes for darwin/amd64.
|
// for darwin/386 and 104 bytes for darwin/amd64.
|
||||||
// We don't care about the values it returns.
|
// We don't care about the values it returns.
|
||||||
var siginfo [16]uint64
|
var siginfo [16]uint64
|
||||||
psig := &siginfo[0]
|
psig := &siginfo[0]
|
||||||
|
@ -431,12 +431,9 @@ func chtmpdir(t *testing.T) (restore func()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestWalk(t *testing.T) {
|
func TestWalk(t *testing.T) {
|
||||||
if runtime.GOOS == "darwin" {
|
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
||||||
switch runtime.GOARCH {
|
restore := chtmpdir(t)
|
||||||
case "arm", "arm64":
|
defer restore()
|
||||||
restore := chtmpdir(t)
|
|
||||||
defer restore()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpDir, err := ioutil.TempDir("", "TestWalk")
|
tmpDir, err := ioutil.TempDir("", "TestWalk")
|
||||||
@ -1281,11 +1278,8 @@ func TestDriveLetterInEvalSymlinks(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestBug3486(t *testing.T) { // https://golang.org/issue/3486
|
func TestBug3486(t *testing.T) { // https://golang.org/issue/3486
|
||||||
if runtime.GOOS == "darwin" {
|
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
||||||
switch runtime.GOARCH {
|
t.Skipf("skipping on %s/%s", runtime.GOOS, runtime.GOARCH)
|
||||||
case "arm", "arm64":
|
|
||||||
t.Skipf("skipping on %s/%s", runtime.GOOS, runtime.GOARCH)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
root, err := filepath.EvalSymlinks(runtime.GOROOT() + "/test")
|
root, err := filepath.EvalSymlinks(runtime.GOROOT() + "/test")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -11,8 +11,7 @@ package cgo
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
#cgo darwin,!arm,!arm64 LDFLAGS: -lpthread
|
#cgo darwin,!arm64 LDFLAGS: -lpthread
|
||||||
#cgo darwin,arm LDFLAGS: -framework CoreFoundation
|
|
||||||
#cgo darwin,arm64 LDFLAGS: -framework CoreFoundation
|
#cgo darwin,arm64 LDFLAGS: -framework CoreFoundation
|
||||||
#cgo dragonfly LDFLAGS: -lpthread
|
#cgo dragonfly LDFLAGS: -lpthread
|
||||||
#cgo freebsd LDFLAGS: -lpthread
|
#cgo freebsd LDFLAGS: -lpthread
|
||||||
|
@ -94,7 +94,7 @@ threadentry(void *v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// init_working_dir sets the current working directory to the app root.
|
// init_working_dir sets the current working directory to the app root.
|
||||||
// By default darwin/arm processes start in "/".
|
// By default darwin/arm64 processes start in "/".
|
||||||
static void
|
static void
|
||||||
init_working_dir()
|
init_working_dir()
|
||||||
{
|
{
|
||||||
|
@ -289,9 +289,9 @@ func mpreinit(mp *m) {
|
|||||||
// Called to initialize a new m (including the bootstrap m).
|
// Called to initialize a new m (including the bootstrap m).
|
||||||
// Called on the new thread, cannot allocate memory.
|
// Called on the new thread, cannot allocate memory.
|
||||||
func minit() {
|
func minit() {
|
||||||
// The alternate signal stack is buggy on arm and arm64.
|
// The alternate signal stack is buggy on arm64.
|
||||||
// The signal handler handles it directly.
|
// The signal handler handles it directly.
|
||||||
if GOARCH != "arm" && GOARCH != "arm64" {
|
if GOARCH != "arm64" {
|
||||||
minitSignalStack()
|
minitSignalStack()
|
||||||
}
|
}
|
||||||
minitSignalMask()
|
minitSignalMask()
|
||||||
@ -301,9 +301,9 @@ func minit() {
|
|||||||
// Called from dropm to undo the effect of an minit.
|
// Called from dropm to undo the effect of an minit.
|
||||||
//go:nosplit
|
//go:nosplit
|
||||||
func unminit() {
|
func unminit() {
|
||||||
// The alternate signal stack is buggy on arm and arm64.
|
// The alternate signal stack is buggy on arm64.
|
||||||
// See minit.
|
// See minit.
|
||||||
if GOARCH != "arm" && GOARCH != "arm64" {
|
if GOARCH != "arm64" {
|
||||||
unminitSignals()
|
unminitSignals()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ func testCPUProfile(t *testing.T, matches matchFunc, need []string, avoid []stri
|
|||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
switch runtime.GOARCH {
|
switch runtime.GOARCH {
|
||||||
case "arm", "arm64":
|
case "arm64":
|
||||||
// nothing
|
// nothing
|
||||||
default:
|
default:
|
||||||
out, err := exec.Command("uname", "-a").CombinedOutput()
|
out, err := exec.Command("uname", "-a").CombinedOutput()
|
||||||
|
@ -63,9 +63,7 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
|
|||||||
c.set_pc(uint32(funcPC(sigpanic)))
|
c.set_pc(uint32(funcPC(sigpanic)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(issue 35439): enabling async preemption causes failures on darwin/arm.
|
const pushCallSupported = true
|
||||||
// Disable for now.
|
|
||||||
const pushCallSupported = GOOS != "darwin"
|
|
||||||
|
|
||||||
func (c *sigctxt) pushCall(targetPC uintptr) {
|
func (c *sigctxt) pushCall(targetPC uintptr) {
|
||||||
// Push the LR to stack, as we'll clobber it in order to
|
// Push the LR to stack, as we'll clobber it in order to
|
||||||
|
@ -350,8 +350,8 @@ func preemptM(mp *m) {
|
|||||||
// yet, so doSigPreempt won't work.
|
// yet, so doSigPreempt won't work.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if GOOS == "darwin" && (GOARCH == "arm" || GOARCH == "arm64") && !iscgo {
|
if GOOS == "darwin" && GOARCH == "arm64" && !iscgo {
|
||||||
// On darwin, we use libc calls, and cgo is required on ARM and ARM64
|
// On darwin, we use libc calls, and cgo is required on ARM64
|
||||||
// so we have TLS set up to save/restore G during C calls. If cgo is
|
// so we have TLS set up to save/restore G during C calls. If cgo is
|
||||||
// absent, we cannot save/restore G in TLS, and if a signal is
|
// absent, we cannot save/restore G in TLS, and if a signal is
|
||||||
// received during C execution we cannot get the G. Therefore don't
|
// received during C execution we cannot get the G. Therefore don't
|
||||||
@ -1191,7 +1191,7 @@ func signalstack(s *stack) {
|
|||||||
sigaltstack(&st, nil)
|
sigaltstack(&st, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
// setsigsegv is used on darwin/arm{,64} to fake a segmentation fault.
|
// setsigsegv is used on darwin/arm64 to fake a segmentation fault.
|
||||||
//
|
//
|
||||||
// This is exported via linkname to assembly in runtime/cgo.
|
// This is exported via linkname to assembly in runtime/cgo.
|
||||||
//
|
//
|
||||||
|
@ -17,14 +17,11 @@
|
|||||||
// Note: both functions will clobber R0 and R11 and
|
// Note: both functions will clobber R0 and R11 and
|
||||||
// can be called from 5c ABI code.
|
// can be called from 5c ABI code.
|
||||||
|
|
||||||
// On android and darwin, runtime.tls_g is a normal variable.
|
// On android, runtime.tls_g is a normal variable.
|
||||||
// TLS offset is computed in x_cgo_inittls.
|
// TLS offset is computed in x_cgo_inittls.
|
||||||
#ifdef GOOS_android
|
#ifdef GOOS_android
|
||||||
#define TLSG_IS_VARIABLE
|
#define TLSG_IS_VARIABLE
|
||||||
#endif
|
#endif
|
||||||
#ifdef GOOS_darwin
|
|
||||||
#define TLSG_IS_VARIABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// save_g saves the g register into pthread-provided
|
// save_g saves the g register into pthread-provided
|
||||||
// thread-local memory, so that we can call externally compiled
|
// thread-local memory, so that we can call externally compiled
|
||||||
|
@ -132,7 +132,7 @@ func uint64mod(n, d uint64) uint64 {
|
|||||||
|
|
||||||
//go:nosplit
|
//go:nosplit
|
||||||
// nosplit because division is used in syscall context in nanotime on darwin/386
|
// nosplit because division is used in syscall context in nanotime on darwin/386
|
||||||
// and darwin/arm where stack splits are not allowed.
|
// where stack splits are not allowed.
|
||||||
func int64div(n, d int64) int64 {
|
func int64div(n, d int64) int64 {
|
||||||
// Check for 32 bit operands
|
// Check for 32 bit operands
|
||||||
if int64(int32(n)) == n && int64(int32(d)) == d {
|
if int64(int32(n)) == n && int64(int32(d)) == d {
|
||||||
|
@ -142,13 +142,6 @@ darwin_arm64)
|
|||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||||
mkasm="go run mkasm_darwin.go"
|
mkasm="go run mkasm_darwin.go"
|
||||||
;;
|
;;
|
||||||
darwin_arm)
|
|
||||||
mkerrors="$mkerrors -m32"
|
|
||||||
mksyscall="./mksyscall.pl -l32 -darwin"
|
|
||||||
mksysnum="./mksysnum_darwin.pl /usr/include/sys/syscall.h"
|
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
|
||||||
mkasm="go run mkasm_darwin.go"
|
|
||||||
;;
|
|
||||||
dragonfly_amd64)
|
dragonfly_amd64)
|
||||||
mkerrors="$mkerrors -m64"
|
mkerrors="$mkerrors -m64"
|
||||||
mksyscall="./mksyscall.pl -dragonfly"
|
mksyscall="./mksyscall.pl -dragonfly"
|
||||||
|
@ -70,7 +70,7 @@ func _() {
|
|||||||
// Thus this test also verifies that the Flock_t structure can be
|
// Thus this test also verifies that the Flock_t structure can be
|
||||||
// roundtripped with F_SETLK and F_GETLK.
|
// roundtripped with F_SETLK and F_GETLK.
|
||||||
func TestFcntlFlock(t *testing.T) {
|
func TestFcntlFlock(t *testing.T) {
|
||||||
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
||||||
t.Skip("skipping; no child processes allowed on iOS")
|
t.Skip("skipping; no child processes allowed on iOS")
|
||||||
}
|
}
|
||||||
flock := syscall.Flock_t{
|
flock := syscall.Flock_t{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user