diff --git a/loader/goroot.go b/loader/goroot.go index 9bf031127b..648a0b133e 100644 --- a/loader/goroot.go +++ b/loader/goroot.go @@ -227,13 +227,19 @@ func needsSyscallPackage(buildTags []string) bool { // linuxNetworking returns whether the unmodified go linux net stack should be used // until the full rework of the net package is done. +// To ensure the correct build target, check for the following tags: +// linux && !baremetal && !nintendoswitch && !tinygo.wasm func linuxNetworking(buildTags []string) bool { + targetLinux := false for _, tag := range buildTags { if tag == "linux" { - return true + targetLinux = true + } + if tag == "baremetal" || tag == "nintendoswitch" || tag == "tinygo.wasm" { + return false } } - return false + return targetLinux } // The boolean indicates whether to merge the subdirs. diff --git a/src/runtime/netpoll.go b/src/runtime/netpoll.go index 1a182e3491..e4157b994f 100644 --- a/src/runtime/netpoll.go +++ b/src/runtime/netpoll.go @@ -43,5 +43,5 @@ func poll_runtime_pollSetDeadline(pd *pollDesc, d int64, mode int) { //go:linkname poll_runtime_pollOpen internal/poll.runtime_pollOpen func poll_runtime_pollOpen(fd uintptr) (*pollDesc, int) { // println("poll_runtime_pollOpen not implemented", fd) - return &pollDesc{runtimeCtx: uintptr(0xdeadbeef)}, pollNoError + return &pollDesc{runtimeCtx: uintptr(0x1337)}, pollNoError } diff --git a/src/syscall/forklock.go b/src/syscall/forklock.go index db9469e2fa..cab4721400 100644 --- a/src/syscall/forklock.go +++ b/src/syscall/forklock.go @@ -1,4 +1,4 @@ -//go:build tinygo && linux && !wasip1 && !wasip2 && !darwin +//go:build tinygo && linux && !wasip1 && !wasip2 && !darwin && !baremetal package syscall