Archive for January, 2010

distcc, ld and shared libraries

Posted by Vitalie Ciubotaru

Some time ago I run into a problem while compiling a  package distributedly. The problem was that some c++ code [I don’t remember which package was that] failed to compile on a remote machine. After short googling I found the explanation: it wasn’t distcc’s fault, but rather a problem with the linker. A proposed solution — actually just a workaround — was to set g++ as dynamic linker  while compiling c++ code:
export LD=g++
It worked and I made this setting permanent (by writing it in /etc/bashrc or another similar trick).
Yesterday, when [locally] upgrading libdv, I was unpleasantly surprised not finding the shared part of this library. After some hassle, e.g. building another version, I looked at the output of configure script  and saw something like “checking whether distcc linker (g++) supports shared libraries… no”. Un-setting LD variable solved the issue.
I wonder if there’s a trick that would allow both distributed compilation of c++ code and support of shared libraries…