This is an archive of the discontinued LLVM Phabricator instance.

Fix dsymutil to handle universal files that exceed 4GB.
AbandonedPublic

Authored by clayborg on Mar 10 2022, 11:12 AM.

Details

Summary

This fixes a bug where if a unviversal mach-o file exceeded 4GB, dsymutil would return an error even if each slice was under 4GB in size, but the total universal file size exceeded 4GB.

Diff Detail

Event Timeline

clayborg created this revision.Mar 10 2022, 11:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 11:12 AM
clayborg requested review of this revision.Mar 10 2022, 11:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 11:12 AM
wallace accepted this revision.Mar 10 2022, 11:32 AM

Lgtm

llvm/tools/dsymutil/dsymutil.cpp
747

You can merge this if and the next one to reduce the indentation

This revision is now accepted and ready to land.Mar 10 2022, 11:32 AM

We are not sure if this is the way we want to fix this, the alternate fix is in https://reviews.llvm.org/D121398

Jonas, let me know if you want to me check this in by accepting it or not vs the other patch. If we want this code then great, else we could remove this code as part of https://reviews.llvm.org/D121398

JDevlieghere requested changes to this revision.Mar 10 2022, 12:31 PM

I prefer the way the other patch deals with non-fat Mach-O files. For fat binaries, we should iterate over the temp files and calculate the sum of the size and error out unless the final slice has an offset < UINT32_MAX. For example, having 3 architectures that are 1.5GB each is fine because the last slice starts at 3GB even though the final binary will be 4.5GB, but having 4 slices won't work.

This revision now requires changes to proceed.Mar 10 2022, 12:31 PM

I prefer the way the other patch deals with non-fat Mach-O files. For fat binaries, we should iterate over the temp files and calculate the sum of the size and error out unless the final slice has an offset < UINT32_MAX. For example, having 3 architectures that are 1.5GB each is fine because the last slice starts at 3GB even though the final binary will be 4.5GB, but having 4 slices won't work.

So this code needs to be removed then right as part of the other patch?