Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android build is broken with Go 1.23 #1165

Closed
bobrofon opened this issue Aug 23, 2024 · 0 comments · Fixed by #1166
Closed

Android build is broken with Go 1.23 #1165

bobrofon opened this issue Aug 23, 2024 · 0 comments · Fixed by #1166

Comments

@bobrofon
Copy link
Contributor

In #1158 a new dependency https://github.com/wlynxg/anet was added to the project. A few days later Go 1.23.0 was released. And it was discovered that github.com/wlynxg/anet fails to build with Go 1.23 without an additional ldflag -checklinkname=0.

$ ./contrib/mobile/build -a
Building aar for Android
gomobile: go build -tags mobile -ldflags -X github.com/yggdrasil-network/yggdrasil-go/src/version.buildName=yggdrasil-go-1.23 -X github.com/yggdrasil-network/yggdrasil-go/src/version.buildVersion=0.5.8-2-g261d8e4 -s -w  -buildmode=c-shared -o=/tmp/gomobile-work-3160141326/android/src/main/jniLibs/x86/libgojni.so ./gobind failed: exit status 1
# gobind/gobind
link: github.com/wlynxg/anet: invalid reference to net.zoneCache

More details here: https://github.com/wlynxg/anet/blob/main/README.md#how-to-build-with-go-1230-or-later

bobrofon added a commit to bobrofon/yggdrasil-go that referenced this issue Aug 23, 2024
The 'github.com/wlynxg/anet' library depends on the '//go:linkname'
liker feature [1]. However, since Go 1.23.0, the usage of
'//go:linkname' has been restricted [2]. And now it's necessary to
explicitly specify '-checklinkname=0' linker flag to use it.

[1] https://github.com/wlynxg/anet/blob/main/README.md#how-to-build-with-go-1230-or-later
[2] https://tip.golang.org/doc/go1.23#linker

Resoles: yggdrasil-network#1165
bobrofon added a commit to bobrofon/yggdrasil-go that referenced this issue Aug 23, 2024
The 'github.com/wlynxg/anet' library depends on the '//go:linkname'
liker feature [1]. However, since Go 1.23.0, the usage of
'//go:linkname' has been restricted [2]. And now it's necessary to
explicitly specify '-checklinkname=0' linker flag to use it.

[1] https://github.com/wlynxg/anet/blob/main/README.md#how-to-build-with-go-1230-or-later
[2] https://tip.golang.org/doc/go1.23#linker

Resolves: yggdrasil-network#1165
neilalexander pushed a commit that referenced this issue Sep 29, 2024
The `github.com/wlynxg/anet` library depends on the `//go:linkname`
linker feature [1]. However, since Go 1.23.0, the usage of
`//go:linkname` has been restricted [2]. And now it's necessary to
explicitly specify `-checklinkname=0` linker flag to use it.

[1]
https://github.com/wlynxg/anet/blob/main/README.md#how-to-build-with-go-1230-or-later
[2] https://tip.golang.org/doc/go1.23#linker

Resolves: #1165
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant