The workaround that worked for me (because I couldn’t understand which part of the building process created an additional architecture goal for compilation): just remove the architecture from one of the two .a libraries.
First, you can list the architecture with a simple file command:
$ file libwhatever.a libwhatever.a: Mach-O universal binary with 4 architectures libwhatever.a (for architecture armv7): current ar archive random library libwhatever.a (for architecture armv7s): current ar archive random library libwhatever.a (for architecture arm64): current ar archive random library libwhatever.a (for architecture i386): current ar archive random library $ file libfoo.a libfoo.a: Mach-O universal binary with 2 architectures libfoo.a (for architecture i386): current ar archive random library libfoo.a (for architecture x86_64): current ar archive random library
Then this workaround is simply to remove the i386 arch from the first libwhatever.a (which in any case should have been only for arch * in my case).
lipo -remove i386 libwhatever.a -output /tmp/libwhatever.a mv /tmp/libwhatever.a libwhatever.a
and then you can create / merge .a files without warning.
source share