Nikola Smiljanic
2015-Jun-12 02:30 UTC
[LLVMdev] [cfe-dev] How to change the linker of clang
That's what I used to do but each Ubuntu update would revert the symlink. That's when I found about -fuse-ld=gold, I'd expect it to work with other linkers as well. On Fri, Jun 12, 2015 at 11:52 AM, 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 >> >> > > _______________________________________________ > 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/20150612/9f733638/attachment.html>
On Fri, Jun 12, 2015 at 12:30:54PM +1000, Nikola Smiljanic wrote:> That's what I used to do but each Ubuntu update would revert the symlink. > That's when I found about -fuse-ld=gold, I'd expect it to work with other > linkers as well.Also maybe clang could support -B option like gcc have [1], that allow you to change prefix for executables and other compiler stuff. [1]: https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html
Joerg Sonnenberger
2015-Jun-13 20:38 UTC
[LLVMdev] [cfe-dev] How to change the linker of clang
On Fri, Jun 12, 2015 at 12:17:04PM +0300, Azat Khuzhin wrote:> On Fri, Jun 12, 2015 at 12:30:54PM +1000, Nikola Smiljanic wrote: > > That's what I used to do but each Ubuntu update would revert the symlink. > > That's when I found about -fuse-ld=gold, I'd expect it to work with other > > linkers as well. > > Also maybe clang could support -B option like gcc have [1], that allow > you to change prefix for executables and other compiler stuff.It does. Joerg