[Object] Remove restriction universal archives having both IR and native (#67505)
Mach-O archives seems to be able to contain both IR objects and native objects mixed together. Apple tooling seems to deal with them correctly. The current implementation was adding an additional restriction of all the objects in the archive being either IR objects or native objects. The changes in this commit remove that restriction and allow mixing both IR and native objects, while still checking that the CPU restrictions still apply (all objects in a slice need to be the same CPU type/subtype). A test that was testing for the previous behaviour had been modified to test that mixed archives are allowed and that they create the expected results. Additionally, locally I checked the results of Apple's `libtool` against `llvm-libtool-darwin` with this code, and the resulting libraries are almost identical with expected differences in the GUID and code signatures load commands, and some minor differences in the rest of the binary.
Loading
Please sign in to comment