<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Zack of All Trades &#187; software</title>
	<atom:link href="http://zackofalltrades.com/tag/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://zackofalltrades.com</link>
	<description>… and master of, um… let me get back to you on that…</description>
	<lastBuildDate>Fri, 01 Apr 2011 14:20:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Compiling for multiple processor architectures in Mac OS X 10.5 Leopard</title>
		<link>http://zackofalltrades.com/2008/11/compiling-for-multiple-processor-architectures-in-mac-os-x-105-leopard/</link>
		<comments>http://zackofalltrades.com/2008/11/compiling-for-multiple-processor-architectures-in-mac-os-x-105-leopard/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 06:45:26 +0000</pubDate>
		<dc:creator>Zack Williams</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://zackofalltrades.com/?p=149</guid>
		<description><![CDATA[If you're compiling code on Mac OS X 10.5 Leopard from source with standard Unix tools like make, your resulting binary will usually be compiled only for the architecture you're currently running on.   Here's how to fix that. ]]></description>
			<content:encoded><![CDATA[<p>This is probably covered elsewhere in far greater detail, but I thought I&#8217;d drop a note here for my own reference more than anything. </p>
<p>If you&#8217;re compiling code on Mac OS X 10.5 Leopard from source with standard Unix tools like <code>make</code>, your resulting binary will usually be compiled only for the architecture you&#8217;re currently running on.   For example, when I first compiled a copy of <a href="http://sourceforge.net/projects/pwgen/">pwgen</a> for making sets of random passwords, the binary I got was i386 only: </p>
<pre>
$ file pwgen
pwgen: Mach-O executable i386
</pre>
<p>But, if you modify the Makefile to include the 4 architectures that Mac OS X (currently) supports: </p>
<pre>
CFLAGS = -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64
LDFLAGS =  -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64
</pre>
<p>GCC will be run with those options when compiling the code and creating the final binary, and you&#8217;ll get a &#8220;fat&#8221; binary that supports all the processor architectures: </p>
<pre>
$ file pwgen
pwgen: Mach-O universal binary with 4 architectures
pwgen (for architecture ppc7400):	Mach-O executable ppc
pwgen (for architecture ppc64):	Mach-O 64-bit executable ppc64
pwgen (for architecture i386):	Mach-O executable i386
pwgen (for architecture x86_64):	Mach-O 64-bit executable x86_64
</pre>
<p>Note that doing compiling anything on OS X will require that you install the Developer Tools, which you can download from the <a href="http://developer.apple.com/">Apple Developer Connection</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://zackofalltrades.com/2008/11/compiling-for-multiple-processor-architectures-in-mac-os-x-105-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

