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? 2) how to specify the lib path, such as crtend.o , when we do not use the default vertion GCC? Best Regards! Eric Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150416/85c6f839/attachment.html>
Joerg Sonnenberger
2015-Apr-16 16:08 UTC
[LLVMdev] [cfe-dev] How to change the linker of clang
On Thu, Apr 16, 2015 at 11:31:21PM +0800, Eric Lu 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?collect2 is a sad historic artifact. It shouldn't be used. You can specify a search directory with -B, if it contains $TARGET-ld, it will be used.> 2) how to specify the lib path, such as crtend.o , when we do not use the > default vertion GCC?Similar, -B can be used here as well. Joerg