Skip to content

ld64.lld fails to link some against some hidden symbols during LTO #57864

@glandium

Description

@glandium

(This is a regression from 103e1d9 and doesn't happen with ld64).

STR:

This currently fails with:

ld64.lld: error: undefined symbol: mozilla::ServoTraversalStatistics::sActive
>>> referenced by /tmp/lto.tmp:(symbol style::driver::traverse_dom::hea1ff5b66fd96c5e+0x2e)
>>> referenced by /tmp/lto.tmp:(symbol style::driver::should_report_statistics::hd9417f01a14da219+0x7)
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)

What's peculiar here is that mozilla::ServoTraversalStatistics::sActive is defined as:

@_ZN7mozilla24ServoTraversalStatistics7sActiveE = hidden local_unnamed_addr global i8 0, align 1

in libxul.a(Unified_cpp_layout_style2.o) and

@"\01__ZN7mozilla24ServoTraversalStatistics7sActiveE" = external local_unnamed_addr global i8

in libgkrust.a(style-08fd5a26b9ae3025.3v30u7e8x2rxhb7t.rcgu.o).

Metadata

Metadata

Assignees

Labels

LTOLink time optimization (regular/full LTO or ThinLTO)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions