[LLVMdev] [cfe-dev] How to change the linker of clang

Nathan Wilson nwilson20 at gmail.com
Thu Jun 11 18:52:56 PDT 2015


On Thu, Jun 11, 2015 at 8:31 PM, Eric Lu <eirc.lew at gmail.com> wrote:

> 1) Build clang with GCC-4.9.2, when compling other application s with
> clang/clang++, the default linker is ld, can I replace it with other linker
> tool, if we can, how to do it?
>
> I.E. can we use collect2 instead?
>
You could symlink ld to point to collect2.

For example I use gold and point to:
ls -la /usr/local/bin/ld:
/usr/local/bin/ld -> /usr/bin/gold


> 2) how to specify the  path, if we do not use the default vertion GCC?
>

You can specify which version of GCC when you run cmake by adding the flags:
-DCMAKE_C_COMPILER=<path> -DCMAKE_CXX_COMPILER=<path>


>
> Best Regards!
> Eric Lew
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150611/1ffe2d72/attachment.html>


More information about the llvm-dev mailing list