This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Fix compact unwind output for 32 bit builds
ClosedPublic

Authored by DavidSpickett on Jul 8 2022, 4:50 AM.

Details

Reviewers
int3
Group Reviewers
Restricted Project
Commits
rG79942d32a631: [lld-macho] Fix compact unwind output for 32 bit builds
Summary

This test was failing on our 32 bit build bot:
https://lab.llvm.org/buildbot/#/builders/178/builds/2463

This happened because in UnwindInfoSectionImpl::finalize
a decision is made whether to write out regular or compressed
unwind info.

One check in this does:

if (cuPtr->functionAddress >= functionAddressMax) {
        break;

Where cuPtr->functionAddress was uint64_t and functionAddressMax
was uintptr_t, which is 4 bytes on a 32 bit system.

Using uint64_t for functionAddressMax fixes this problem.
Presumably because at only 4 bytes, the max is much lower than
we expect. We're targetting 64 bit though so the size of the max
should match the size of the addresses.

Diff Detail

Event Timeline

DavidSpickett created this revision.Jul 8 2022, 4:50 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 8 2022, 4:50 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
DavidSpickett requested review of this revision.Jul 8 2022, 4:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2022, 4:50 AM
DavidSpickett retitled this revision from [lld][MachO] Fix compact unwind output for 32 bit builds to [lld-macho] Fix compact unwind output for 32 bit builds.Jul 8 2022, 6:40 AM
int3 accepted this revision.Jul 8 2022, 10:56 AM

Thank you!

This revision is now accepted and ready to land.Jul 8 2022, 10:56 AM