[distcc] Wrapper for different GCC versions.

Fergus Henderson fergus at google.com
Wed Aug 27 16:51:27 GMT 2008


On Wed, Aug 27, 2008 at 10:53 AM, Daniel Beecham <joshu at goobah.org> wrote:

> Fergus Henderson wrote:
>
>> On Tue, Aug 26, 2008 at 3:05 PM, Daniel Beecham <joshu at goobah.org> wrote:
>>
>>
>>
>>> Hi there everyone.
>>> First post here, so to introduce me, I'm Daniel. :-)
>>>
>>> I have three computers, a Gentoo hardened server, a Gentoo desktop and a
>>> Gentoo laptop. All run core2duo, but i don't want to give the server
>>> anything unstable, like the gcc 4.3.
>>>
>>> Well, anyway, i've compiled gcc 4.3 (called via /usr/bin/gcc-4.3.1), and
>>> i
>>> want everything compiled by the server (for the laptop/desktop) via
>>> distcc
>>> to be of that version. Searching, i've found (
>>> http://lists.samba.org/archive/distcc/2006q4/003468.html) a previous
>>> mail
>>> by this mailing list where Patrick shows his way of doing it. Here's how
>>> it
>>> looks for me (thank you, Patrick):
>>>
>>> sh-3.2# cd /usr/lib/distcc/bin/
>>> sh-3.2# ls -la
>>> total 16
>>> drwxr-xr-x 3 root   root 4096 Aug 26 20:05 .
>>> drwxr-xr-x 3 root   root 4096 Aug 26 13:04 ..
>>> drwxr-xr-x 2 root   root 4096 Aug 26 15:30 .backup
>>> -rw-r--r-- 1 distcc  240    0 Aug 26 15:13 .keep_sys-devel_distcc-0
>>> lrwxrwxrwx 1 root   root    7 Aug 26 15:28 c++ -> wrapper
>>> lrwxrwxrwx 1 root   root    7 Aug 26 15:28 cc -> wrapper
>>> lrwxrwxrwx 1 root   root    7 Aug 26 15:28 g++ -> wrapper
>>> lrwxrwxrwx 1 root   root   15 Aug 26 15:30 g++-4.3.1 -> /usr/bin/distcc
>>> lrwxrwxrwx 1 root   root    7 Aug 26 15:28 gcc -> wrapper
>>> lrwxrwxrwx 1 root   root   15 Aug 26 15:29 gcc-4.3.1 -> /usr/bin/distcc
>>> -rwxr-xr-x 1 root   root   60 Aug 26 15:27 wrapper
>>> lrwxrwxrwx 1 root   root    7 Aug 26 15:30 x86_64-pc-linux-gnu-c++ ->
>>> wrapper
>>> lrwxrwxrwx 1 root   root    7 Aug 26 15:30 x86_64-pc-linux-gnu-g++ ->
>>> wrapper
>>> sh-3.2# cat wrapper
>>> #!/bin/bash
>>> exec /usr/lib/distcc/bin/g${0:$[-2]}-4.3.1 "$@"
>>>
>>> But, trying to compile, it tells me the gcc 4.3-only flag -march=core2 is
>>> a
>>> bad value. (as if it's using gcc 3.4.6. Am i doing something wrong?
>>>
>>>
>>
>>
>> Did you add /usr/lib/distcc/bin to the start of your PATH?
>> What's the compilation command?
>> Which distcc version are you using?
>> For debugging, try adding "set -x" (after the #! line) to your bash
>> wrapper
>> script, and set DISTCC_VERBOSE=1.
>>
>>
>>
> Hmm, PATH on the client machine has /usr/lib/distcc/bin at first,


Good.


> as well as the server /etc/profile,


That shouldn't be necessary, and might be harmful.


> however, distcc echoes
> something along the lines with "distcc 2.18.3 trace: compiler name is
> x86_64-pc-linux-gnu-gcc, setting PATH="/usr/local/sbin:/usr....". That must
> be the problem.


distcc removes its own directory from the PATH, before searching for the
compiler, to ensure that you don't end up having distcc recursively invoke
itself.

If that is what's causing the problem, it might work better if you put the
symlinks to "wrapper" in a different directory than the symlinks to distcc.

Otherwise, please attach the full output from a distcc command with
DISTCC_VERBOSE=1.
-- 
Fergus Henderson <fergus at google.com>
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the distcc mailing list