Creating fat files: libtool vs lipo (Should I prefer lipo?)
Asked Answered
M

0

18

I wonder what would be the difference when using:

lipo -create i386/libAwesome.a armv7/libAwesome.a -o fat/libAwesome.a

and

libtool -static i386/libAwesome.a armv7/libAwesome.a -o fat/libAwesome.a

I have the impression that lipo is more general, and it will simply stick two files from different architectures while libtool is specific for libraries, Is this true?

Under what cases I should prefer Lipo over Libtool?

Magog answered 11/4, 2013 at 2:48 Comment(3)
Why this is non constructive? I am looking for an objective reason or case in where I should use lip over libtool.Magog
I think this is a reasonable question. It has an objective, non-opinion answer that we can determine by reading the documentation and/or experimenting.Bedard
If you run file on the output of the two commands, you'll see that both are “Mach-O universal binary with 2 architectures”, but the lipo-created file encapsulates two Mach-O object files while the libtool-created file encapsulates two “current ar archive random library” files. I don't think the lipo-created file will work as a static library file. Furthermore, if you try to put more armv7 and i386 object files into the library, the lipo command will fail (because it can't put multiple object files with the same architecture into its output), while the libtool command will succeed.Bedard

© 2022 - 2024 — McMap. All rights reserved.