Skip to content

undefined symbol: __cxx_global_var_init #457

@Andarwinux

Description

@Andarwinux

main.cpp

int DoIt()
{
    return 0; 
}
inline int Unused0 = DoIt();

int GetUnused();

int main(int, char **)
{
    return GetUnused();
}

lib.cpp

int DoIt();
inline int Unused0 = DoIt();

int GetUnused()
{
    return Unused0;
}
x86_64-w64-mingw32-clang++ -mguard=cf -flto=thin lib.cpp main.cpp

ld.lld: error: undefined symbol: __cxx_global_var_init
>>> referenced by /tmp/a.exe.lto.main-bf068e.obj
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It looks like only the most recent nightly appears this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions