Create Universal Binary with One Architecture?
Create Universal Binary with One Architecture?
- Subject: Create Universal Binary with One Architecture?
- From: Jeffrey Walton <email@hidden>
- Date: Sun, 07 Jul 2013 22:29:15 -0400
Hi All,
I need to create a universal binary from the command line. The twist
is that I'm only using one architecture.
Out of the box, it appears the command line tools create a non-fat executable:
...
$clang++ -o cryptest.exe -DNDEBUG -g -Os -pipe -fPIC -arch armv7
--sysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
-miphoneos-version-min=5.0 -DCRYPTOPP_DISABLE_ASM=1 bench.o bench2.o
test.o validat1.o validat2.o validat3.o adhoc.o datatest.o regtest.o
fipsalgt.o dlltest.o ./libcryptopp.a
...
$ file cryptest.exe
cryptest.exe: Mach-O executable arm
If I use two architectures (armv7 and armv7s), then I get the universal binary:
$ file cryptest.exe
cryptest.exe: Mach-O universal binary with 2 architectures
cryptest.exe (for architecture armv7): Mach-O executable arm
cryptest.exe (for architecture armv7s): Mach-O executable arm
If I strip the unwanted architecture, then I still have a universal binary:
$ mv cryptest.exe cryptest.exe.bu
$ xcrun -sdk iphoneos lipo cryptest.exe.bu -remove armv7s -output cryptest.exe
$ codesign -fs "Jeffrey Walton" cryptest.exe
cryptest.exe: replacing existing signature
$ file cryptest.exe
cryptest.exe: Mach-O universal binary with 1 architecture
cryptest.exe (for architecture armv7): Mach-O executable arm
How does one specify a universal binary, even if using one architecture?
Jeff
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden