[distcc] collect2: cannot find 'ld'

Jason Addison jraddison at gmail.com
Fri Nov 2 02:02:17 GMT 2007


fixed ...

I just needed to set PATH correctly in the SCons environment due to
the way ccache is installed in Fedora 7 (new compiler commands are set
up to intercept and redirect to ccache):

env = Environment( ENV = {'HOME' : home,
                          'DISTCC_HOSTS' : os.environ['DISTCC_HOSTS'],
                          'PATH' :
'/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin'} )

The ccache path needed to be prepended to the standard POSIX PATH.

BTW, in SCons I only set the following. When linking, it uses CXX
which is set to distcc.

env.Replace( CXX = 'distcc' )
env.Replace( CC = 'distcc' )

Its working great so far. Thanks for the input Philips.

On 11/1/07, Ihar `Philips` Filipau <thephilips at gmail.com> wrote:
> Now it really looks to me that you did assign LD = CXX in your SConscript.
> It is only CXX has to be "distcc ccache g++". LD has to remain "g++".
>
>
> On 11/1/07, Jason Addison <jraddison at gmail.com> wrote:
> >
> > On 10/31/07, Ihar `Philips` Filipau <thephilips at gmail.com> wrote:
> > > On 11/1/07, Jason Addison <jraddison at gmail.com> wrote:
> > > > Compiling works great. When it comes
> > > > to linking ... disaster!
> > >
> > > I was under strong impression that distcc cannot distribute linking.
> > > For example, if you would check its source code and see what it does and
> how
> > > it does distribution - you would see that's impossible.
> > >
> >
> > Thanks for the response. Like you said, I probably have to start
> > investigating the distcc source to pin down the problem. I did not
> > think that distcc was trying to link on a remote machine. I thought
> > that, when it came time to link, it would do it locally. In fact, I
> > think that is what it is trying to do. I think that it is running g++,
> > which is running collect2 on my machine, but, due to the environment
> > not being propagated by SCons and ccache, collect2 can not find ld. I
> > explicitly directed Scons to use ld for linking, instead of distcc,
> > and it failed (I don't recall if it was the same failure).
> >
> > > [ I have seen several commercial offerings - none of them provides
> > > distributed linking. ]
> > >
> > > > Linking fails with
> > > >
> > > > $ scons -j 7
> > > > ... compiliing ...
> > > > distcc -o MyApp ...
> > > > ...
> > > > collect2: cannot find 'ld'
> > > > distcc[24315] ERROR: compile (null) on localhost failed
> > > >
> > > > If I simply copy the link command and run it directly in the shell, it
> > > > works!
> > >
> > > For that to work, environments on both hosts have to match.
> > > Compilation doesn't have this problem - linking does.
> > >
> > > Just do linking locally. It's not a big deal anyway.
> > >
> >
> > The more I think about it, the more I think that the problem has to do
> > with distcc running g++ when it comes time to link. When it tries to
> > run g++ on my machine, it runs the real g++, not ccache as it did on
> > the remote machine (where ccache is installed it looks as if g??
> > commands are intercepted using PATH and run ccache instead). Hmmmm ...
> > now that I consider it further, I probably need to learn more about
> > ccache.
> >
> > Does anyone else use SCons / ccache / distcc or see the error of my ways?
> > __
> > distcc mailing list             http://distcc.samba.org/
> > To unsubscribe or change options:
> > https://lists.samba.org/mailman/listinfo/distcc
> >
>
>
>
> --
> Трепет души если его боятся может обратится в страх. Но приняв его, он
> просто становится судьбой.
>   -- Unknown
>
> Don't walk behind me, I may not lead.
> Don't walk in front of me, I may not follow.
> Just walk beside me and be my friend.
>     -- Albert Camus (attributed to)


More information about the distcc mailing list