<?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>chys&#039;s random notes &#187; distcc</title>
	<atom:link href="http://en.chys.info/tag/distcc/feed/" rel="self" type="application/rss+xml" />
	<link>http://en.chys.info</link>
	<description>Study more problems; Talk less of isms.</description>
	<lastBuildDate>Tue, 27 Dec 2011 11:56:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>cross distcc</title>
		<link>http://en.chys.info/2008/12/cross-distcc/</link>
		<comments>http://en.chys.info/2008/12/cross-distcc/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 21:22:00 +0000</pubDate>
		<dc:creator>chys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[distcc]]></category>

		<guid isPermaLink="false">http://blog.chys.info/2008/12/cross-distcc/</guid>
		<description><![CDATA[It is possible to distribute compilations to machines with different architectures. Here is an example, to allow distributing tasks from a 64-bit system (x86_64) to 32-bit systems (i686): First of all, both the client and servers should have distcc installed, of course. Then run the distcc daemon at the servers. Be careful so that they [...]<hr/>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>It is possible to distribute compilations to machines with different architectures.</p>
<p>Here is an example, to allow distributing tasks from a 64-bit system (x86_64) to 32-bit systems (i686):</p>
<p>First of all, both the client and servers should have distcc installed, of course. Then run the distcc daemon at the servers. Be careful so that they are not refusing connections from the client.</p>
<p>The distcc servers should also have the corresponding cross toolchains installed.<br />
In Gentoo, this is simple. Emerge <code>crossdev</code> and run <code>crossdev --target x86_64-pc-linux-gnu</code>. (Experience tells us it is better to stip <code>-march=...</code> from <code>CFLAGS</code> when building the cross toolchain, otherwise we may (or may not) encounter strange errors, though some options like <code>-march=nocona</code> are valid on both i686 and x86_64. The reason is beyond me&#8230;)</p>
<p>Then commands <code>x86_64-pc-linux-gnu-{gcc,g++}</code> should be available.</p>
<p>Most source packages are created with autotools, so they honor the environment variables <code>CC</code> and <code>CXX</code>. At the client end, export <code>CC='distcc x86_64-pc-linux-gnu-gcc'</code> and <code>CXX='distcc x86_64-pc-linux-gnu-g++'</code> before compiling.</p>
<p>It is important to use the full compiler name including the host architecutre (<code>x86_64-pc-linux-gnu</code> in this example). Otherwise the distcc servers call the native compilers, resulting in incompatible object files.</p>
<p>Alternatively you may want to use the “transparent” method of calling distcc: <code>PATH="/usr/lib/distcc/bin:$PATH" make</code>. This does not work automatically. Instead, it is necessary to use a wrapper script to make sure the architecture is explicitly specified:<br />
<blockquote>
<pre># cd /usr/lib/distcc/bin
# rm cc c++ gcc g++
# echo '#!/bin/bash' > distcc-wrapper
# echo 'exec /usr/lib/distcc/bin/x86_64-pc-linux-gnu-g${0:$[-2]} "$@"' >> distcc-wrapper
# chmod +x distcc-wrapper
# ln -s distcc-wrapper cc
# ln -s distcc-wrapper c++
# ln -s distcc-wrapper gcc
# ln -s distcc-wrapper g++</pre>
</blockquote>
<p>
Reference<br />
[1] <a href="http://www.gentoo.org/doc/en/cross-compiling-distcc.xml">DistCC Cross-compiling Guide &#8211; Gentoo Documentation</a>
<div class="blogger-post-footer">
<hr />
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://creativecommons.org/images/public/somerights20.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.</div>
<hr/><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://en.chys.info/2008/12/cross-distcc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

