>> On Oct 2, 2015, at 11:40 AM, Jens Alfke <[email protected]> wrote:
>> 
>> How does one tell whether a static library contains bitcode?

Jon Hjelle suggested:

> A while back I came across this answer in the forums: 
> https://forums.developer.apple.com/thread/3971#11560 
> <https://forums.developer.apple.com/thread/3971#11560>
> 
> Quick summary for the list:
> 
> Use `otool -l | grep __LLVM` to search for the “__LLVM” segment (there’s a 
> “bitcode” section that will also exist, but it’s not a sufficient condition 
> to check for the presence of embedded bitcode).

This works. Unfortunately what I found is that the original static libraries 
built by Xcode contain bitcode, but when I use `lipo` to combine the device and 
simulator libraries into one, the resulting library is missing the bitcode.

Basically my build script just does
        lipo -create -output fatLibrary.a Release-iphoneos/library.a 
Release-iphonesimulator/library.a
This is necessary to create a library that can be used to build an app for both 
simulator and device. (If we distribute two library files, it requires a bunch 
of ugly customization of the developer’s project’s build settings. This is a 
very longstanding flaw in Xcode that I and others have complained about several 
times.)

Unfortunately the lipo tool has very few options, so there doesn’t seem to be a 
way to turn off whatever behavior is causing the __LLVM segment to be lost in 
the copying process.

—Jens
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to