From 4ec411d45cd707d6ebc07cf9cd8beda40980e1df Mon Sep 17 00:00:00 2001 From: leongross Date: Fri, 11 Oct 2024 16:33:19 +0200 Subject: [PATCH] further restrict net package usage Signed-off-by: leongross --- loader/goroot.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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.