ARC deploy to 10.6 fails if selectively enabled

Originator:me
Number:rdar://11539939 Date Originated:25-May-2012 09:58 PM
Status:Open Resolved:Closed
Product:Developer Tools Product Version:Xcode 4.3.2
Classification:Other Bug Reproducible:Always
 
I was deploying some code that uses ARC on a machine running 10.6 today, and received an error from the dynamic linker:

    Symbol not found: _objc_retain

(amongst others).

My project was mostly using existing manual retain–release code, with only a couple of new files using ARC. Accordingly, I had ARC disabled in the main target settings, and had selectively enabled it for the two files by adding -fobjc-arc to the per-file build settings (under Build Phases).

On a hunch, I enabled ARC in the target, and then flopped the per-file settings (removing the flag for the two files, and adding -fno-objc-arc to all the others) and no longer got the dynamic link error on 10.6.

I suggest the documentation be updated to reflect this.



13-Jul-2012 12:40 PM Apple Developer Bug Reporting Team :
Engineering has requested the following information in order to further investigate this issue:

Does this reproduce with Xcode 4.4?  Xcode should now be passing -fobjc-link-runtime to the compiler and linker, which we believe should fix this problem.

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!