Commit 65bc42a
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
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments