<?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>Mithro rants about stuff &#187; cross compile</title>
	<atom:link href="http://blog.mithis.net/archives/tag/cross-compile/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.mithis.net</link>
	<description></description>
	<lastBuildDate>Fri, 16 Dec 2011 06:02:58 +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 Windows using Cygwin on Linux&#8230;.</title>
		<link>http://blog.mithis.net/archives/tp/95-xcompiling-cygwin-on-linux-for-windows</link>
		<comments>http://blog.mithis.net/archives/tp/95-xcompiling-cygwin-on-linux-for-windows#comments</comments>
		<pubDate>Tue, 27 Jan 2009 06:52:22 +0000</pubDate>
		<dc:creator>mithro</dc:creator>
				<category><![CDATA[linux.conf.au]]></category>
		<category><![CDATA[Thousand Parsec]]></category>
		<category><![CDATA[cross compile]]></category>
		<category><![CDATA[cross compiling]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[mingw32]]></category>
		<category><![CDATA[thousand parsec]]></category>
		<category><![CDATA[tpserver-cpp]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.mithis.net/?p=95</guid>
		<description><![CDATA[So for the past week while I have been at the best conference in the world I have been trying to compile tpserver-cpp for Windows. I had done the hard work and gotten it to compile (as documented here, here and here) on Windows previously. However, as I was in Hobart at a Linux conference [...]]]></description>
			<content:encoded><![CDATA[<p>So for the past week while I have been at the <a href="http://linux.conf.au">best conference</a> in the world I have been trying to compile <a href="http://git.thousandparsec.net/gitweb/gitweb.cgi?p=tpserver-cpp.git;a=summary">tpserver-cpp</a> for Windows. I had done the hard work and gotten it to compile (as documented <a href="http://blog.mithis.net/archives/tp/10-compiling-tpserver-cpp-under-windows">here</a>, <a href="http://blog.mithis.net/archives/tp/12-compiling-tpserver-cpp-under-windows-part-2">here</a> and <a href="http://blog.mithis.net/archives/tp/13-compiling-tpserver-cpp-under-windows-part-3">here</a>) on Windows previously. However, as I was in Hobart at a Linux conference I didn&#8217;t really have access to Windows computer. That was not going to stop me, so I attempted to <a href="http://en.wikipedia.org/wiki/Cross-compiling">cross compile</a> the binaries under Linux. This has a number of advantages as it would mean when <a href="http://jms.id.au/wiki">someone</a> finally gets around to creating a autobuilder, we can produce Windows binaries too.</p>
<p>Ubuntu provides the <a href="http://www.mingw.org/">mingw32 compilers</a> in the <a href="http://packages.ubuntu.com/search?keywords=mingw32&amp;searchon=names&amp;section=all">repository</a> so I didn&#8217;t think it would be all that hard to get working. The problem is that tpserver-cpp does not have a &#8220;native&#8221; Windows support but <a href="http://www.cygwin.com/">cygwin</a> comes to the rescue and provides a compatibly layer. Using cygwin turned out to not be as simple as using mingw32 compiler with the cygwin headers.</p>
<p>I ended up using <a href="http://www.kegel.com/crosstool/">crosstool</a> to build my own cygwin compiler. I battled for a long while with the fact that Ubuntu now enables &#8220;fortify source&#8221; by default. This breaks many versions of things like binutils and gcc (which often do <i>naughty</i> things which fortify source does not like). After I figured out how to disable it, I was still was only able to get an ancient version of gcc to compile (3.3.6) which meant I had to fix a lot of problems in the tpserver-cpp code. I guess someone had to do it eventually, but it was annoying that I was forced too.</p>
<p>I then manually downloaded a bunch of <a href="http://mirror.aarnet.edu.au/pub/cygwin/release/">cygwin packages</a> to build a tree for the dependencies (such as boost and guile). This was much faster then trying to compile them on my own.  Finally, I was able to build tperver-cpp and create a Windows binary! I can confirm it runs fine under Wine and am now getting friends who are still shacked to Windows to test it there. </p>
<p>It sounds much simpler now, but it took me over a week of work to boil it down to these steps. It was like a constant game of wack-a-mole, once I had solved one problem another popped up.</p>
<p>So what now in this area? I want to get a recent version of the compiler working and preferably build all the dependencies ourselves (rather then rely on the cygwin compiled versions). I would ultimately like to see the cygwin compilers being packaged with Ubuntu/Debian in the same way that the mingw32 compilers are. I don&#8217;t know if any of that is likely to happen however as I never seem to have enought time. For now I have uploaded a copy of <a href="http://blog.mithis.net/~tim/crosstool-cygwin-gcc336.tar.bz2">my cross compiler</a> (It needs to be extracted so it is found in /opt/crosstool).</p>
<p>I hope this helps someone!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mithis.net/archives/tp/95-xcompiling-cygwin-on-linux-for-windows/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

