2

I have a static iOS library built for armv7 and arm64, let's call it foo.a. It has dependencies on abc.a and def.a, which I have in armv7 and arm64 versions. I would like to package these together into one static library, so you can just use foo.a without having to include abc.a and def.a in your project.

In short, I would like to do something akin to

link arm64/abc.a arm64/def.a armv7/abc.a armv7/def.a foo.a -out foo.a

But I can't figure it which tool I'm supposed to use for this, or if I'm using them wrong. I've tried libtool, as such:

libtool -static arm64/abc.a arm64/def.a armv7/abc.a armv7/def.a foo.a -o foo.a

But I get the error message

Unrecognized option: '-static'

I've tried lipo

lipo -create -output foo.a arm64/abc.a arm64/def.a armv7/abc.a armv7/def.a foo.a

But I get the error message

fatal error: lipo: foo.a and armv7/abc.a have the same architecture (armv7) and can't be in the same fat output file

I must be misunderstanding something fundamental about this process, but I'm having a hard time finding out what

ldav1s
  • 15,885
  • 2
  • 53
  • 56
Sossisos
  • 1,569
  • 2
  • 10
  • 19
  • Do you own the source code of the static lib? If yes there are many tutorial that create far library with run script – Tj3n Mar 24 '17 at 08:11
  • @Tj3n I do, but we compile that from the command line too, and all the tutorials I can find talk about Xcode menu configurations. If you know of any tutorials for this through the cl, I'd love to read it – Sossisos Mar 24 '17 at 08:14
  • Not sure about cl, I only know that build for device then you are already have arm64, armv7, armv7s, maybe you already did so? You can use lipo to check all the architectures your lib containing – Tj3n Mar 24 '17 at 08:25
  • Yes, the foo.a library is built for armv7 and arm64 with the Xcode flag ARCHS="armv7 arm64", but abc.a and def.a are not multi-architecture, they have two libs each for armv7 and arm64 respectively – Sossisos Mar 24 '17 at 08:51

0 Answers0