Skip to content

wasm-ld crash when LTO enabled: __cxx_global_var_init.1 present in "init functions" but not defined #62243

Closed
@sbc100

Description

@sbc100

We've seen certain situations where in LTO builds wasm-ld will crash during Writer::createCallCtorsFunction because one of the init function in the generted LTO object file ( __cxx_global_var_init.1) in undefined and does not get assigned a function index (so crashes in sym->getFunctionIndex()).

I'm still working on reducing the repro case as more.

This seems to have started with https://reviews.llvm.org/D135427, which I guess makes sense since that change explicitly calls out __cxx_global_var_init as being discarded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LTOLink time optimization (regular/full LTO or ThinLTO)lld:wasm

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions