Bitcode-enabled static library not backwards-compatible with Xcode 6 and older

Originator:joachimb
Number:rdar://21884601 Date Originated:17-Jul-2015 05:33 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 7 beta 3
Classification:Other Bug Reproducible:Always
 
Summary:
I build a proprietary SDK for a living at Lookback, where we ship a static archive .framework. We have so far been able to ship a single distribution for all OSes and Xcodes, and would love to continue doing so. However, enabling Bitcode and doing Build & Archive in Xcode 7 generates a static library which has duplicate symbols when linked with an app in Xcode 6.

Steps to Reproduce:
1. Create a “Static Library” project in Xcode 7
2. Enable Bitcode on it
3. Build and Archive
4. Create an “iOS App” project in Xcode 6
5. Link the previous static library into this app

Expected Results:
6. Works fine

Actual Results:
7. Duplicate symbols


duplicate symbol _llvm.cmdline in:
    ../HD/Lookback.framework/Lookback(Lookback.o)
    ../HD/Lookback.framework/Lookback(GFUIKitFunctions.o)
duplicate symbol _llvm.embedded.module in:
    ../HD/Lookback.framework/Lookback(Lookback.o)
    ../HD/Lookback.framework/Lookback(GFUIKitFunctions.o)
… and so on for quite a while

Regression:
Haven’t had a compatibility issue like this since Universal Binaries were introduced :/

Notes:
Could you perhaps add an UUID suffix to the symbols? Or the name/path of the module? E g “_llvm.embedded.module. 7464665a-2ce4-11e5-b345-feff819cdc9f”. Then this information would just be discarded by older Xcodes, and not interfere with the arm7/arm64 symbols that the app actually links with.

Comments

Joachim Bengtsson17-Jul-2015 06:00 PM

And I apologize again: I accidentally enabled bitcode for the simulator build of my library :( My bad! Thanks for rubberducking!

This issue has been verified as resolved and can be closed. Joachim Bengtsson17-Jul-2015 05:55 PM

I apologize: the attached steps to reproduce don't work :( I can't reproduce this in a minimal project outside of my main one. I still can't explain those duplicate symbols, and a google search yields nothing.

By joachimb at July 18, 2015, 1 a.m. (reply...)

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!