<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>87859</bug_id>
          
          <creation_ts>2005-04-03 18:39 0000</creation_ts>
          <short_desc>Suggestion for distcc improvement in a multi-architecture network</short_desc>
          <delta_ts>2005-06-18 12:40:22 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Development</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>adq_dvb@lidskialf.net</reporter>
          <assigned_to>morfic@gentoo.org</assigned_to>
          <cc>lisa@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>adq_dvb@lidskialf.net</who>
            <bug_when>2005-04-03 18:39:50 0000</bug_when>
            <thetext>This is just a suggestion for a change I&apos;ve found to be useful. Feel free to ignore if it its not any good :) I just thought it might be handy.

The problem is machine A is i686-pc-linux-gnu. machine B is powerpc-pc-linux-gnu (well actually its not in my network, but this is a better example for various reasons).

Now I can install a cross compiler on B so that A can distribute jobs to it no problem, as long as machine A uses the full compiler name - i686-pc-linux-gnu-XXX.

However, there is an issue with the current symlinks in /usr/lib/distcc/bin on machine A. 

Since cc,c++,gcc,g++ are just linked directly to distcc, machine B will be asked to invoke just &apos;gcc&apos;, where really it should be asked to invoke i686-pc-linux-gnu-gcc. The result is the compilation fails because it will be asked to use an (i386 based) architecture it knows nothing about.

This is fixable with a simple change to distcc-config - instead of symlinks for cc,c++,gcc,g++, create shell scripts like the following on machine A (this would be called g++):
#!/bin/sh
exec x86_64-pc-linux-gnu-g++ &quot;$@&quot;

This way, it will always use the full compiler name with distcc, which will then be passed to machine B, which will then invoke the correct cross compiler.

Theres a sample version of distcc-config patched to do this at http://lidskialf.net/distcc-config.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>adq_dvb@lidskialf.net</who>
            <bug_when>2005-04-03 18:42:00 0000</bug_when>
            <thetext>sorry, the sample script I included should be:
#!/bin/sh
exec i686-pc-linux-gnu-g++ &quot;$@&quot;

Too many machines here :)
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>lisa@gentoo.org</who>
            <bug_when>2005-04-19 06:03:41 0000</bug_when>
            <thetext>Can you post a diff of your distcc-config and the one in Portage please?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>adq_dvb@lidskialf.net</who>
            <bug_when>2005-04-19 06:12:35 0000</bug_when>
            <thetext>Created an attachment (id=56655)
Example modification to use shell scripts

Here you go. It now also creates a &apos;cc&apos; shell script, which calls ${ARCH}-gcc
since none of the cross compilers I created installed a ${ARCH}-cc link.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>lisa@gentoo.org</who>
            <bug_when>2005-05-31 04:26:41 0000</bug_when>
            <thetext>Markus, what do you think of this for the next version?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>morfic@gentoo.org</who>
            <bug_when>2005-06-04 14:43:19 0000</bug_when>
            <thetext>i don;t know about he change to distcc-config

but i surely agree that the exec fullpath-gcc &quot;$@&quot; and exec fullpath-g++ &quot;$@&quot;
scripts should be required to allow proper cross compiling, i didn&apos;t test the
distc-config change yet, i simply as suggested by agaffney made gcc and g++ said
scripts, linked CC and C++ to gcc and g++ respectively and now qt and boost
compile as they should since the correct compiler is invoked on the host

if this should be behind a USE flag, so be it :) at least it keeps us from
having to setup manually a working cross compile capable distcc each time we upgrade

if anyone can think of a way to get the ful path/name over to the host w/o
shells, would be great, until then, this is good stuff
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>morfic@gentoo.org</who>
            <bug_when>2005-06-04 14:44:10 0000</bug_when>
            <thetext>sorry, i always forget to add me to CC: with the comment</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>morfic@gentoo.org</who>
            <bug_when>2005-06-12 14:01:09 0000</bug_when>
            <thetext>can i add it then if you are too busy?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>pYrania@gentoo.org</who>
            <bug_when>2005-06-12 17:45:03 0000</bug_when>
            <thetext>As I&apos;m too busy with other stuff right now, just go ahead, morfic.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>pYrania@gentoo.org</who>
            <bug_when>2005-06-12 17:46:29 0000</bug_when>
            <thetext>reassigning.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>morfic@gentoo.org</who>
            <bug_when>2005-06-18 12:40:22 0000</bug_when>
            <thetext>2.18.3-r8 is now in portage, thanks Andrew

</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>56655</attachid>
            <date>2005-04-19 06:12 0000</date>
            <desc>Example modification to use shell scripts</desc>
            <filename>distcc-config.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIC91c3IvYmluL2Rpc3RjYy1jb25maWcJMjAwNS0wNC0wMiAxNjowODo0NC4wMDAwMDAwMDAg
KzAxMDAKKysrIGRpc3RjYy1jb25maWctYWRxCTIwMDUtMDQtMDcgMTQ6MDY6MjMuMDAwMDAwMDAw
ICswMTAwCkBAIC02NSw3ICs2NSwyMiBAQAogZGVmIHBlcm1pc3Npb25zKHBhdGgsdXNlcixncm91
cCk6CiAJZm9yIGZpbGUgaW4gb3MubGlzdGRpcihwYXRoKToKIAkJI3ByaW50ICdDb25maWd1cmlu
ZycscGF0aCtmaWxlKycuLi4nCi0JCW9zLmNob3duKHBhdGgrZmlsZSx1c2VyLGdyb3VwKQorCQlv
cy5jaG1vZChwYXRoK2ZpbGUsMDc1NSkKKworZGV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ZlcnJpZGVzKGNob3N0KQogCWlu
c3RhbGxsaW5rcyhjaG9zdCkKIAogCXByaW50ICdDaGVja2luZyBwZXJtaXNzaW9ucy4uLicK
</data>        

          </attachment>
    </bug>

</bugzilla>