Open liudikang opened 3 months ago
go version go1.22.1 darwin/arm64
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.
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;
SymtabSectionImpl<LP>::writeTo
lld/MachO/SyntheticSections.cpp
nList->n_sect = defined->isec()->parent->index;
I debug llvm found crash symbol is arm64_ios_lib.ptr
arm64_ios_lib.ptr
After we remove ldflags "-Wl,-fixup_chains" ,or modify llvm code crash not happed.
The ios static library compiled by gomobile works fine with clang link parameter "-Wl,-fixup_chains".
Similar Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
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 filelld/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".