Skip to content

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

Open
@liudikang

Description

@liudikang

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.mobileAndroid, iOS, and x/mobile

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions