Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 87859 - Suggestion for distcc improvement in a multi-architecture network
Summary: Suggestion for distcc improvement in a multi-architecture network
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Disenchanted (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-03 18:39 UTC by Andrew de Quincey
Modified: 2005-06-18 12:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Example modification to use shell scripts (distcc-config.patch,1.17 KB, patch)
2005-04-19 06:12 UTC, Andrew de Quincey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew de Quincey 2005-04-03 18:39:50 UTC
This is just a suggestion for a change I'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 'gcc', 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++ "$@"

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.
Comment 1 Andrew de Quincey 2005-04-03 18:42:00 UTC
sorry, the sample script I included should be:
#!/bin/sh
exec i686-pc-linux-gnu-g++ "$@"

Too many machines here :)
Comment 2 Lisa Seelye (RETIRED) gentoo-dev 2005-04-19 06:03:41 UTC
Can you post a diff of your distcc-config and the one in Portage please?
Comment 3 Andrew de Quincey 2005-04-19 06:12:35 UTC
Created attachment 56655 [details, diff]
Example modification to use shell scripts

Here you go. It now also creates a 'cc' shell script, which calls ${ARCH}-gcc
since none of the cross compilers I created installed a ${ARCH}-cc link.
Comment 4 Lisa Seelye (RETIRED) gentoo-dev 2005-05-31 04:26:41 UTC
Markus, what do you think of this for the next version?
Comment 5 Disenchanted (RETIRED) gentoo-dev 2005-06-04 14:43:19 UTC
i don;t know about he change to distcc-config

but i surely agree that the exec fullpath-gcc "$@" and exec fullpath-g++ "$@"
scripts should be required to allow proper cross compiling, i didn'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
Comment 6 Disenchanted (RETIRED) gentoo-dev 2005-06-04 14:44:10 UTC
sorry, i always forget to add me to CC: with the comment
Comment 7 Disenchanted (RETIRED) gentoo-dev 2005-06-12 14:01:09 UTC
can i add it then if you are too busy?
Comment 8 Markus Nigbur (RETIRED) gentoo-dev 2005-06-12 17:45:03 UTC
As I'm too busy with other stuff right now, just go ahead, morfic.
Comment 9 Markus Nigbur (RETIRED) gentoo-dev 2005-06-12 17:46:29 UTC
reassigning.
Comment 10 Disenchanted (RETIRED) gentoo-dev 2005-06-18 12:40:22 UTC
2.18.3-r8 is now in portage, thanks Andrew