Skip to content

Commit 43fef1d

Browse files
committed
android: Add workaround for tailscale pidfd crash
1 parent 2dcb869 commit 43fef1d

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

cmd/internal/build_libbox/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ func buildAndroid() {
112112
args = append(args, debugFlags...)
113113
}
114114

115+
args = append(args, "-ldflags", "-checklinkname=0")
116+
115117
tags := append(sharedTags, memcTags...)
116118
if debugEnabled {
117119
tags = append(tags, debugTags...)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package libbox
2+
3+
import (
4+
"os"
5+
_ "unsafe"
6+
)
7+
8+
// https://github.com/SagerNet/sing-box/issues/3233
9+
// https://github.com/golang/go/issues/70508
10+
// https://github.com/tailscale/tailscale/issues/13452
11+
12+
//go:linkname checkPidfdOnce os.checkPidfdOnce
13+
var checkPidfdOnce func() error
14+
15+
func init() {
16+
checkPidfdOnce = func() error {
17+
return os.ErrInvalid
18+
}
19+
}

0 commit comments

Comments
 (0)