[distcc] gcc versioning suggestion

Martin Pool mbp at samba.org
Wed Nov 13 01:12:00 GMT 2002


On 12 Nov 2002, Michael Santy <mike.santy at dynetics.com> wrote:
> In reading through the newsgroups, I have seen how many people have 
> requested version matching with gcc.  Instead of querying the version of 
> gcc installed every time, you are able to pass it -V to request a 
> specific version of the compiler.  If that specific version does not 
> exist, gcc returns an error.
> 
> For example (outside of distcc), if I have gcc 3.1 installed and execute 
> the command:
> gcc -V 2.95 -c foo.c
> I get the error:
> gcc: installation problem, cannot exec 'cc1': No such file or directory
> However, if I execute:
> gcc -V 3.1 -c foo.c
> All is happy.

I've since been informed that it's better to use a different name for
gcc, because -V doesn't work completely reliably.  I'm not sure of the
exact reason.

For example
 
 distcc gcc-3.2-x86-linux -c foo.c

> This is a way to assume all of the distccd hosts have the correct 
> version of gcc, and if they do not, distcc will fall back on the 
> localhost.  This is an easy way to be safe if you are compiling c++, 
> which has the potential to produce mismatched abi object files when 
> using different versions of gcc.  I'm not sure if this should be handled 
> by the user of distcc or distcc itself.

You can do this by putting it in your CXXFLAGS.  If necessary, an
autoconf test could find out the appropriate values.

-- 
Martin



More information about the distcc mailing list