Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

universal binary

how does one create a universal binary?

iBook G4, Mac OS X (10.4.7)

Posted on Sep 9, 2006 10:14 AM

Reply
5 replies

Sep 9, 2006 4:33 PM in response to tricolaire

There are only a couple of settings in your xcode project that need set to build a universal binary. Open your project and select Project>Edit Project Settings. In the General tab set 'Cross-Develop Using Target SDK' to 'Mac OS X 10.4 (Universal)'. In the Build tab, select the 'Architectures' setting, click the Edit button and select both PPC and Intel.

That should be all you need, assuming there is no architecture specific code in your project.

You can see if your built application is universal by selecting it in the Finder and selecting File>Get Info. For a universal app the Kind field should say 'Application (Universal)'.

Jim

Sep 10, 2006 8:40 AM in response to Mihalis Tsoukalos

You can find out if an executable is a UB or not.
Look at the following example:
file ~/bin/unison
/Users/mtsouk/bin/unison: Mach-O executable ppc


Yep, and just to be a completist, there's also lipo via the Terminal app:

<pre class="command">lipo -info /Applications/EarthTime.app/Contents/MacOS/EarthTime </pre>Gives:
<pre class="command">Non-fat file: /Applications/EarthTime.app/Contents/MacOS/EarthTime is architecture: ppc</pre>On a PPC only file. If it's Universal, it gives:

<pre class="command">Architectures in the fat file: /Applications/EarthTime.app/Contents/MacOS/EarthTime are: ppc i386</pre>For more detailed info, use the -detailed_info flag:

<pre class="command">lipo -detailed_info /Applications/EarthTime.app/Contents/MacOS/EarthTime</pre>Gives you this:

<pre class="command">Fat header in: /Applications/EarthTime.app/Contents/MacOS/EarthTime
fat_magic 0xcafebabe
nfat_arch 2
architecture ppc
cputype CPU TYPEPOWERPC
cpusubtype CPU SUBTYPE_POWERPCALL
offset 4096
size 34844
align 2^12 (4096)
architecture i386
cputype CPU TYPEI386
cpusubtype CPU SUBTYPE_I386ALL
offset 40960
size 37836
align 2^12 (4096)</pre>Note how you have to give the full path to the actual executable inside the package. See man lipo for more details, including how it can be used to create or thin universal binaries.

charlie

universal binary

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.