Xcode doesn't always generate bitcode for iOS static libraries
| Originator: | abarisain | ||
| Number: | rdar://25358081 | Date Originated: | 25/03/2016 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | 7.3 (7D175) |
| Classification: | Reproducible: | Always |
Summary: In Xcode 7.3, static libraries are sometimes compiled without bitcode. Steps to Reproduce: 1. Create a project that makes a static library-based framework 2. Enable bitcode support for that target 3. Make an aggregate target that invokes xcodebuild to build the static library for simulator and device 4. Pick the aggregate target, select a simulator 5. Build Expected Results: The static libraries should always have bitcode (checked with otool for a __LLVM segment) Actual Results: The static libraries lacks bitcode (no __LLVM segment) more often than not. Building a project using this library will make the compiler complain about lacking bitcode Version: Xcode 7.3 (7D175) Notes: I understand that this is quite an old school trick that doesn't really seem supported (especially since the push towards dynamic libraries) and that my project was probably expected to break. However, it did work with 7.2. I'd be happy to fix my project if it's not an Xcode issue. More information here: http://stackoverflow.com/questions/36184930/xcodebuild-7-3-cant-enable-bitcode Opening the console when building the aggregate target with Xcode 7.3 and filtering for "xcodebuild" shows that xcodebuild has "ENABLE_BITCODE" set to "no", even if it's set to "yes" in the target settings. Xcode 7.2.1 doesn't seem to output the same logs when running a build. The problem can be worked around by: - Picking the framework target, Generic iOS device - Clean it - Pick the framework target, any simulator - Compile - Pick the aggregate target, generic iOS device - Compile - Repeat if needed To break it again, you can pick the aggregate target for any simulator and build it. Configuration: Occurs on Xcode 7.3 (7D175), OSX El Capitan 10.11.4 Doesn't occur on Xcode 7.2.1 (7C1002) , OSX El Capitan 10.11.4
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!