Does the link to the universal static library (device / simulator) contain x86 code in the released binary for hand?

I am not familiar with the universal binary / library thing and want to clarify some issues in my mind.

I can create a universal static library containing both device code (arm6 / 7) and simulator code (x86). Now it’s not clear to me how the build process decides which code should be used from the universal library.

  • I understand that xcode defines the architecture on which the target should be built as an option -sdk. Thus, the option -sdkwill not only indicate which sdk will be used, but all source code should also be compiled by ISA?

  • If so, will he also automatically select the appropriate part of the universal library, so if only the x86 code and only the hand code for the devices are created for the simulator?

+3
source share
2 answers

I have no answers for ten days, so I think the question is too trivial to attract attention. Although I could not find any great basic knowledge about universal libraries or even an official document from anyone, but I just decided to make simple dumb control over my binary size. I checked the size of the binaries when I linked to a regular library and a universal library.

The results were the same. That way I could complete the link process correctly and close my stupid question =).

+1
source

Apple lipo . XCode .

0

Source: https://habr.com/ru/post/1795110/