Add support for creating universal binaries which can contain an archive.
Test plan: make check-all
Paths
| Differential D67758
[llvm-lipo] Add support for archives ClosedPublic Authored by alexander-shaposhnikov on Sep 19 2019, 5:09 AM.
Details Summary Add support for creating universal binaries which can contain an archive. Test plan: make check-all
Diff Detail
Event Timeline
alexander-shaposhnikov added inline comments.
This revision is now accepted and ready to land.Sep 20 2019, 3:27 PM Comment Actions Logic looks fine. I have some concerns around alignment terminology that I suggest you address before committing.
alexander-shaposhnikov added inline comments.
Closed by commit rL372666: [llvm-lipo] Add support for archives (authored by alexander-shaposhnikov). · Explain WhySep 23 2019, 3:24 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 221110 test/tools/llvm-lipo/create-archive-input.test
tools/llvm-lipo/llvm-lipo.cpp
|
A segment alignment has no strong correlation to the section alignment, and the notion that the segment alignment is the maximum alignment of its sections is not true. Maybe the simplest way to say this is:
"For compatibility with cctools lipo, a file's alignment is calculated as the minimum aligment of all segments. For object files, the file's alignment is the maximum alignment of its sections."
Part of the problem is that the method here is named "calculateSegmentAlignment" but that 1) doesn't accurately describe how lipo is using that value, and 2) also doesn't completely describe what the function is doing. But cctools also has both these problems :) You have an opportunity to call this function something like "calculateSliceAlignment" or "calculateFileAlignment" which may be objectively better ...
Be aware the segment computation is merely a guess, and it may not be exactly correct. But it's correct enough for lipo.
And be aware the behavior for object files may change in future versions of cctools.