2 clang -c -g -arch x86_64h -arch x86_64 -arch i386 fat-test.c
3 libtool -static -o libfat-test.a fat-test.o
5 to generate a dylib instead:
6 clang -arch ... -arch ... -arch ... -dynamiclib fat-test.o -o fat-test.dylib
8 To reduce the size of the fat binary:
9 lipo -thin i386 -o fat-test.i386.o fat-test.o
10 lipo -thin x86_64 -o fat-test.x86_64.o fat-test.o
11 lipo -thin x86_64h -o fat-test.x86_64h.o fat-test.o
12 lipo -create -arch x86_64h fat-test.x86_64h.o -arch x86_64 fat-test.x86_64.o -arch i386 fat-test.i386.o -o fat-test.o -segalign i386 8 -segalign x86_64 8 -segalign x86_64h 8
16 #elif defined(__x86_64__)
18 #elif defined(__i386__)
20 #elif defined(__ARM_ARCH_7S__)
22 #elif defined(__ARM_ARCH_7A__)
24 #elif defined(__ARM64_ARCH_8__)
27 #error "Unknown architecture"