What does the -all_load linker flag do?

IphoneObjective CGccLinker

Iphone Problem Overview


I can't find anywhere what the -all_load flag do when compiling Objective-C code.

I have some issues uploading binaries to Apple, the they say it's because I didn't use this flag, but my code compiles even without it.

Can some one help me with that?

Thanks

Iphone Solutions


Solution 1 - Iphone

It is probably related to this technical note https://developer.apple.com/library/content/qa/qa1490/_index.html

> IMPORTANT: For 64-bit and iPhone OS applications, there is a linker bug that prevents -ObjC from loading objects files from static libraries that contain only categories and no classes. The workaround is to use the -all_load or -force_load flags. -all_load forces the linker to load all object files from every archive it sees, even those without Objective-C code. -force_load is available in Xcode 3.2 and later. It allows finer grain control of archive loading. Each -force_load option must be followed by a path to an archive, and every object file in that archive will be loaded.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGuy EphraimView Question on Stackoverflow
Solution 1 - IphoneSharjeel AzizView Answer on Stackoverflow