Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate Use of all_load #239

blakewatters opened this Issue Jul 24, 2011 · 1 comment


None yet
1 participant
Copy link

blakewatters commented Jul 24, 2011


I love your library. Well done.

I am looking for a way to link with your library and not use -all_load for a variety of reasons including debugging purposes with other dependent libraries that I use (our own). I haven't looked into it, but i'm assuming that you do the -all_load to fix the catalog bug / linke bug with LCC. The linker fails when you have multiple architectures (armv6 and armv7) and you use the -ObjC linker flag.

Something like this error


ld: duplicate symbol OBJC_METACLASS$_RKJSONParser in /Users/ryanconnelly/Documents/pps/mxpos/ThirdParty/RestKit/libRestKitJSONParserSBJSON.a(RKJSONParser+SBJSON.o) and /Users/ryanconnelly/Documents/pps/mxpos/ThirdParty/RestKit/libRestKitJSONParserYAJL.a(RKJSONParser+YAJL.o) for architecture armv6
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

I know three20 came up with a creative way to avoid using the -all_load. They wrote an doc about it here:

Look at "Update2" for the "dummy class" solution which I find is the best option.

If you look in their source code on github you can see exactly how the used it.

Here is an example:

Basically, you include a macro for each object file that only contains a category extension which fixes the link errors without using the -all_load linker flag.

Anyway, just thought I'd share that info. Thanks.

Reply to this email directly or view it on GitHub:


This comment has been minimized.

Copy link
Member Author

blakewatters commented Aug 30, 2011

Looks like we just need to adapt this macro and use around all the categories, including the Vendor/ ones. Then we can drop -all_load.

#define FIX_CATEGORY_BUG(name)
@interface FIXCATEGORYBUG ## name;
@implementation FIXCATEGORYBUG ## name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.