My build script combines armv7 and arm64 libraries. It’s been a little while
since I first did that, so I just checked my build again and I see bitcode in
the resulting combined library (which I combined with `lipo -create` as well).
My script looks something like this:
find out_ios/Release-iphoneos -name '*.a' -execdir lipo -create
out_ios/Release-iphoneos/{} out_ios_64/Release-iphoneos/{} -o
out_ios_combined/Release-iphoneos/{} \;
The libraries that I’m building have a build script of their own and I noticed
today that they use libtool to combine them
(https://chromium.googlesource.com/external/webrtc/+/master/talk/build/merge_ios_libs).
I feel pretty ignorant about the details of combining libraries like this, but
I wonder if libtool has some different options or perhaps just works
differently and might work where lipo isn’t working for you?
Jon
On Saturday, October 3, 2015 at 6:13 PM, Jens Alfke wrote:
>
> > > On Oct 2, 2015, at 11:40 AM, Jens Alfke <[email protected]
> > > (mailto:[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
> >
> > 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]
> (mailto:[email protected]))
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/xcode-users/jahjelle%40gmail.com
>
> This email sent to [email protected] (mailto:[email protected])
_______________________________________________
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]