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

Brian Faull bfaull at cog-e.com
Thu Jun 11 19:47:03 PDT 2015


For #1: Consider also the -B option to specify a path prefix to consult for compiler-related sub-programs (e.g., GNU binutils) if the executables / symlinks etc. have similar names. 

Brian


On Jun 11, 2015, at 21:52, Nathan Wilson <nwilson20 at gmail.com> wrote:



> 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

_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150611/0d76d35f/attachment.html>


More information about the cfe-dev mailing list