Skip to content

Commit 4ec411d

Browse files
committed
further restrict net package usage
Signed-off-by: leongross <[email protected]>
1 parent 513f947 commit 4ec411d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

loader/goroot.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,19 @@ func needsSyscallPackage(buildTags []string) bool {
227227

228228
// linuxNetworking returns whether the unmodified go linux net stack should be used
229229
// until the full rework of the net package is done.
230+
// To ensure the correct build target, check for the following tags:
231+
// linux && !baremetal && !nintendoswitch && !tinygo.wasm
230232
func linuxNetworking(buildTags []string) bool {
233+
targetLinux := false
231234
for _, tag := range buildTags {
232235
if tag == "linux" {
233-
return true
236+
targetLinux = true
237+
}
238+
if tag == "baremetal" || tag == "nintendoswitch" || tag == "tinygo.wasm" {
239+
return false
234240
}
235241
}
236-
return false
242+
return targetLinux
237243
}
238244

239245
// The boolean indicates whether to merge the subdirs.

0 commit comments

Comments
 (0)