Dear Rafael, Thank you for your answer. The verbose mode -v shows that clang uses the old ld in /usr/bin while I install the gold in /usr/local/bin. Regards, Chunbai On Tue, Dec 3, 2013 at 9:23 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:> > Could anyone tell me where my mistake is? > > Try running > > clang -flto a.o b.o -o main -v > > it should print how clang is running the linker. See if it is running > the linker you expect and if it is passing -plugin to it. > > Cheers, > Rafael >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131205/eadabd72/attachment.html>
On 5 December 2013 07:46, Chunbai YANG <chunbyang2 at gapps.cityu.edu.hk> wrote:> Dear Rafael, > > Thank you for your answer. The verbose mode -v shows that clang uses the old > ld in /usr/bin while I install the gold in /usr/local/bin.Clang should be searching the path. What does $ which ld print? Maybe all that you have to do is $ export PATH=/usr/local/bin:$PATH Cheers, Rafael
The problem is solved. Thank you for your time, Rafael. Previously, my clang uses the ld in /usr/bin. However, I installed the gold plugin to /usr/local/bin. So that clang actually uses the wrong ld. Now it's fixed by configuring clang to the ld in /usr/local/bin. Regards, Chunbai On Thu, Dec 5, 2013 at 10:04 PM, Rafael Espíndola < rafael.espindola at gmail.com> wrote:> On 5 December 2013 07:46, Chunbai YANG <chunbyang2 at gapps.cityu.edu.hk> > wrote: > > Dear Rafael, > > > > Thank you for your answer. The verbose mode -v shows that clang uses the > old > > ld in /usr/bin while I install the gold in /usr/local/bin. > > Clang should be searching the path. What does > > $ which ld > > print? Maybe all that you have to do is > > $ export PATH=/usr/local/bin:$PATH > > Cheers, > Rafael >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131207/fa14b241/attachment.html>