Skip to content

Commit 65bc42a

Browse files
authored
anet upgrade fix
The anet dependency is deeply embedded — it's pulled in by go-libp2p, kubo, boxo, ipfs-cluster, and many others, all through pion's webrtc transport. There's no way to avoid it without reverting the entire update. The fix is to pass -checklinkname=0 to the linker in your gomobile build command: gomobile bind -ldflags="-checklinkname=0" -target=android ./mobile/ This disables Go 1.23+'s strict //go:linkname checking. The anet package uses //go:linkname net.zoneCache to work around Android 11+ SELinux restrictions on network interface enumeration — it's intentional and necessary, but the Go linker started rejecting it. This is the same workaround syncthing/syncthing#10211 for their Android builds. The upstream fix will come when either: - The anet maintainer removes the //go:linkname directives (wlynxg/anet#11) - Go's stdlib fixes net.Interfaces() on Android directly (golang/go#68082)
1 parent a40c399 commit 65bc42a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ Created with gomobile with Android NDK 25:
99
gomobile bind -v -o mobile.aar -target=android -androidapi 26 github.com/functionl
1010
and/go-fula/mobile
1111

12-
or cd go-fula and gomobile bind -v -o mobile.aar -target=android -androidapi 26 ./mobile
12+
or cd go-fula and
13+
14+
```
15+
gomobile bind -v -o mobile.aar -target=android -ldflags="-checklinkname=0" -androidapi 26 ./mobile
16+
```
17+

0 commit comments

Comments
 (0)