XCode 3.2 linker fails to link categories into binaries for ARM targets
| Originator: | dhmspector | ||
| Number: | rdar://7175200 | Date Originated: | 27-Aug-2009 11:02 AM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | IDE: 1610.0 Core: 1608.0 Tools: 1591.0 |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: XCode3.2 fails to correctly link categories contained in external static libraries for ARM targets. Specifically in the example provided I am using a category on NSData that uses the common crypto code that is linked into a static library. The code works under XCode 3.1.3 under 10.5.8; under 10.6 (10432) and XCode 3.2 the linker fails to include the category code in the ARM binary. Steps to Reproduce: 0. Unzip included test program 1. Compile for simulator and run - will work 2. Compile and debug on device - will crash Expected Results: NSData category code be linked into final ARM binary and work as expected when called from a host program Actual Results: When running my application on the simulator the code works as expected; when running on the device a unknown selector exception is thrown. Regression: Compile and run this project under XCode 3.1.3 under 10.5.8 for both the simulator and the device Linker fails to bind category code into final binary for the ARM target as is shown in the included symbol dumps Notes: Attached is a zip file containing a demo project, and two symbol dumps from compiled ARM and i386 binaries. The symbol dumps clearly show that the i386 binaries has all of the required code;the ARM binaries do not.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Adding the -all_load linker flag works around this problem, per:
http://code.google.com/p/json-framework/wiki/FAQ#My%5Fapp%5Fworks%5Fin%5Fthe%5FiPhone%5Fsimulator,%5Fbut%5Fcrashes%5Fon%5Fthe%5Fdevice
Though there are reports of -all_load causing problems in certain projects. Works fine for me.