Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cmd/dist/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1760,15 +1760,15 @@ func buildModeSupported(compiler, buildmode, goos, goarch string) bool {
return false
}
case "freebsd":
return goarch == "amd64"
return goarch == "amd64" || goarch == "arm" || goarch == "arm64"
}
return false

case "c-shared":
switch platform {
case "linux/amd64", "linux/arm", "linux/arm64", "linux/loong64", "linux/386", "linux/ppc64le", "linux/riscv64", "linux/s390x",
"android/amd64", "android/arm", "android/arm64", "android/386",
"freebsd/amd64",
"freebsd/amd64", "freebsd/arm", "freebsd/arm64",
"darwin/amd64", "darwin/arm64",
"windows/amd64", "windows/386", "windows/arm64",
"wasip1/wasm":
Expand Down
4 changes: 2 additions & 2 deletions src/internal/platform/supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ func BuildModeSupported(compiler, buildmode, goos, goarch string) bool {
return false
}
case "freebsd":
return goarch == "amd64"
return goarch == "amd64" || goarch == "arm" || goarch == "arm64"
}
return false

case "c-shared":
switch platform {
case "linux/amd64", "linux/arm", "linux/arm64", "linux/loong64", "linux/386", "linux/ppc64le", "linux/riscv64", "linux/s390x",
"android/amd64", "android/arm", "android/arm64", "android/386",
"freebsd/amd64",
"freebsd/amd64", "freebsd/arm", "freebsd/arm64",
"darwin/amd64", "darwin/arm64",
"windows/amd64", "windows/386", "windows/arm64",
"wasip1/wasm":
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/cgo/gcc_freebsd_sigaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build freebsd && amd64
//go:build freebsd && (amd64 || arm || arm64)

#include <errno.h>
#include <stddef.h>
Expand All @@ -14,7 +14,7 @@

// go_sigaction_t is a C version of the sigactiont struct from
// os_freebsd.go. This definition — and its conversion to and from struct
// sigaction — are specific to freebsd/amd64.
// sigaction — are specific to freebsd/amd64, freebsd/arm, and freebsd/arm64.
typedef struct {
uint32_t __bits[_SIG_WORDS];
} go_sigset_t;
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/cgo/sigaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build (linux && (386 || amd64 || arm64 || loong64 || ppc64le)) || (freebsd && amd64)
//go:build (linux && (386 || amd64 || arm64 || loong64 || ppc64le)) || (freebsd && (amd64 || arm || arm64))

package cgo

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/cgo_sigaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Also used on linux/386 to clear the SA_RESTORER flag
// when using cgo; see issue #75253.

//go:build (linux && (386 || amd64 || arm64 || loong64 || ppc64le)) || (freebsd && amd64)
//go:build (linux && (386 || amd64 || arm64 || loong64 || ppc64le)) || (freebsd && (amd64 || arm || arm64))

package runtime

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/sigaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build (linux && !386 && !amd64 && !arm64 && !loong64 && !ppc64le) || (freebsd && !amd64)
//go:build (linux && !386 && !amd64 && !arm64 && !loong64 && !ppc64le) || (freebsd && !amd64 && !arm && !arm64)

package runtime

Expand Down
14 changes: 14 additions & 0 deletions src/runtime/sys_freebsd_arm.s
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,20 @@ TEXT runtime·asmSigaction(SB),NOSPLIT|NOFRAME,$0
MOVW R0, ret+12(FP)
RET

// Call the function stored in _cgo_sigaction using the GCC calling convention.
TEXT runtime·callCgoSigaction(SB),NOSPLIT,$0
MOVW sig+0(FP), R0
MOVW new+4(FP), R1
MOVW old+8(FP), R2
MOVW _cgo_sigaction(SB), R11
MOVW R13, R4
SUB $24, R13
BIC $0x7, R13 // alignment for ELF ABI
BL (R11)
MOVW R4, R13
MOVW R0, ret+12(FP)
RET

TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Reserve space for callee-save registers and arguments.
MOVM.DB.W [R4-R11], (R13)
Expand Down
12 changes: 12 additions & 0 deletions src/runtime/sys_freebsd_arm64.s
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,18 @@ ok:
MOVW R0, ret+24(FP)
RET

// Call the function stored in _cgo_sigaction using the GCC calling convention.
TEXT runtime·callCgoSigaction(SB),NOSPLIT,$0
MOVD sig+0(FP), R0
MOVD new+8(FP), R1
MOVD old+16(FP), R2
MOVD _cgo_sigaction(SB), R3
SUB $16, RSP // reserve 16 bytes for sp-8 where fp may be saved.
BL R3
ADD $16, RSP
MOVW R0, ret+24(FP)
RET

// func sigfwd(fn uintptr, sig uint32, info *siginfo, ctx unsafe.Pointer)
TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
MOVW sig+8(FP), R0
Expand Down