From 79467baf12621174f23443e5652523d39d99752d Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Thu, 18 Nov 2021 21:52:20 +0100 Subject: [PATCH] all: remove FreeBSD support FreeBSD support has been broken for a long time, probably since https://github.com/tinygo-org/tinygo/pull/1860 (merged in May). Nobody has complained yet, so I am going to assume nobody uses it. This doesn't remove support for FreeBSD entirely: the code necessary to build TinyGo on FreeBSD is still there. It just removes the code necessary to build binaries targetting FreeBSD. But again, it could very well be broken as we don't test it. If anybody wants to re-enable support for FreeBSD, they would be welcome to do that. But I think it would at the very least need a smoke test of some sort. --- compiler/syscall.go | 2 +- src/crypto/rand/rand_arc4random.go | 2 +- src/os/file_unix.go | 2 +- src/runtime/os_freebsd.go | 5 ----- src/runtime/runtime_unix.go | 2 +- src/runtime/runtime_unix_heap.go | 2 +- src/runtime/runtime_unix_noheap.go | 2 +- 7 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 src/runtime/os_freebsd.go diff --git a/compiler/syscall.go b/compiler/syscall.go index db379d52..ddd8daed 100644 --- a/compiler/syscall.go +++ b/compiler/syscall.go @@ -157,7 +157,7 @@ func (b *builder) createRawSyscall(call *ssa.CallCommon) (llvm.Value, error) { // functions, depending on the target OS/arch. func (b *builder) createSyscall(call *ssa.CallCommon) (llvm.Value, error) { switch b.GOOS { - case "linux", "freebsd": + case "linux": syscallResult, err := b.createRawSyscall(call) if err != nil { return syscallResult, err diff --git a/src/crypto/rand/rand_arc4random.go b/src/crypto/rand/rand_arc4random.go index cbc76af9..9d28e63f 100644 --- a/src/crypto/rand/rand_arc4random.go +++ b/src/crypto/rand/rand_arc4random.go @@ -1,4 +1,4 @@ -// +build darwin freebsd tinygo.wasm +// +build darwin tinygo.wasm // This implementation of crypto/rand uses the arc4random_buf function // (available on both MacOS and WASI) to generate random numbers. diff --git a/src/os/file_unix.go b/src/os/file_unix.go index b83574d5..7ead108b 100644 --- a/src/os/file_unix.go +++ b/src/os/file_unix.go @@ -1,4 +1,4 @@ -// +build darwin linux,!baremetal freebsd,!baremetal +// +build darwin linux,!baremetal package os diff --git a/src/runtime/os_freebsd.go b/src/runtime/os_freebsd.go deleted file mode 100644 index 1ba30196..00000000 --- a/src/runtime/os_freebsd.go +++ /dev/null @@ -1,5 +0,0 @@ -// +build freebsd - -package runtime - -const GOOS = "freebsd" diff --git a/src/runtime/runtime_unix.go b/src/runtime/runtime_unix.go index ae924026..d8a988dd 100644 --- a/src/runtime/runtime_unix.go +++ b/src/runtime/runtime_unix.go @@ -1,4 +1,4 @@ -// +build darwin linux,!baremetal,!wasi freebsd,!baremetal +// +build darwin linux,!baremetal,!wasi // +build !nintendoswitch package runtime diff --git a/src/runtime/runtime_unix_heap.go b/src/runtime/runtime_unix_heap.go index 9224369a..d3b97ccc 100644 --- a/src/runtime/runtime_unix_heap.go +++ b/src/runtime/runtime_unix_heap.go @@ -1,4 +1,4 @@ -// +build darwin linux,!baremetal,!wasi freebsd,!baremetal +// +build darwin linux,!baremetal,!wasi // +build !nintendoswitch // +build gc.conservative gc.leaking diff --git a/src/runtime/runtime_unix_noheap.go b/src/runtime/runtime_unix_noheap.go index f9826ac5..e1f0eb5f 100644 --- a/src/runtime/runtime_unix_noheap.go +++ b/src/runtime/runtime_unix_noheap.go @@ -1,4 +1,4 @@ -// +build darwin linux,!baremetal,!wasi freebsd,!baremetal +// +build darwin linux,!baremetal,!wasi // +build !nintendoswitch