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

x/mobile: IOS static libaray build by go mobile make clang++ crashed with ldflags "-Wl,-fixup_chains" #67870

Open
liudikang opened this issue Jun 7, 2024 · 1 comment
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@liudikang
Copy link

What version of Go are you using (go version)?

go version go1.22.1 darwin/arm64

What did you do?

First we build a go project with gomobile (https://github.com/xxf098/go-tun2socks-build) as a static library,
then linker this static library into our IOS project.

What did you see happen?

lld crashed.

I found crash position of lld:

SymtabSectionImpl<LP>::writeTo of file lld/MachO/SyntheticSections.cpp
Crashed on this line: nList->n_sect = defined->isec()->parent->index;

I debug llvm found crash symbol is arm64_ios_lib.ptr

After we remove ldflags "-Wl,-fixup_chains" ,or modify llvm code crash not happed.

What did you expect to see?

The ios static library compiled by gomobile works fine with clang link parameter "-Wl,-fixup_chains".

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Jun 7, 2024
@gopherbot gopherbot added this to the Unreleased milestone Jun 7, 2024
@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants