[cfe-dev] clang++ invoking custom built gold

Rafael Avila de Espindola rafael.espindola at gmail.com
Mon Mar 21 08:05:19 PDT 2011


On 11-03-21 07:08 AM, Giulio Eulisse wrote:
> Dear all,
>
> I'm trying to compile our software (a quite large C++ codebase) using
> clang.
>
> We usually build it with an own-built version of gcc 4.5.1 + gold
> since we do not want / cannot use the system compiler. For the record
> the linux distribution we use is SLC5
> (https://www.scientificlinux.org/) which itself is a variant of
> RHEL5.
>
> To do the port I used the same environment to build the clang suite
> and then changed g++ to clang++ in our build files.
>
> While we still have some compilation issue to fix, the main problem
> is that any linking fails because gold, which is invoked via clang++,
> is not able to get the correct runtime stuff:
>
> /afs/cern.ch/cms/slc5_amd64_gcc451/external/gcc/4.5.1/bin/ld: error:
> cannot open crtbeginS.o: No such file or directory
> /afs/cern.ch/cms/slc5_amd64_gcc451/external/gcc/4.5.1/bin/ld: error:
> cannot open crtendS.o: No such file or directory
> /afs/cern.ch/cms/slc5_amd64_gcc451/external/gcc/4.5.1/bin/ld: error:
> cannot find -lstdc++
> /afs/cern.ch/cms/slc5_amd64_gcc451/external/gcc/4.5.1/bin/ld: error:
> cannot find -lgcc_s
> /afs/cern.ch/cms/slc5_amd64_gcc451/external/gcc/4.5.1/bin/ld: error:
> cannot find -lgcc_s
>
> Googling around I found some hints on how to workaround the problem
> and actually managed to hammer it to a working state (see attached
> patch), however this is clearly a kludge and I was wondering if you
> had any better solution.

You have to detect your distro and then pass the correct search path to 
gold.

Cheers,
Rafael



More information about the cfe-dev mailing list