I’m not familiar with the universal binary/library thing, and would like to clarify some questions in my mind.
I can build an universal static library that contains both device code (arm6/7) and simulator code (x86). Now It’s not clear for me how the build process decides which code should be used from the universal library.
-
My understanding is that the xcode decides the architecture on which the target should be built by
-sdkoption. So does-sdkoption not only specify which sdk to be used, but also to which ISA all the source code should be compiled? -
If so, would it also automatically choose a corresponding part of the universal library, so if built for the simulator only x86 code is linked, and only arm code for the devices?
I’ve got no answers for ten days, so I think the question is too trivial to draw anyone’s attention. Although I couldn’t find any great underlying knowledge about universal libraries nor even an official document from anyone, but I just decided to make a simple dumb check on my binary size. I checked the size of binaries when I linked against an ordinary library and an universal library.
The results was the same. So I could conclude the link process does the right thing and close my stupid question =).