<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 6/23/15 1:45 AM, Aditya Verma wrote:<br>
    </div>
    <blockquote
cite="mid:CA+59L6gFvkoHMTV7X4UDN_nate+pOMb8DnYsksZeAFrTjKs4bw@mail.gmail.com"
      type="cite">
      <div dir="ltr">the symlink ld is already pointing to /usr/bin/ld.
        Also -fuse-ld=gold does not works on clang in freebsd. I am not
        sure where is the problem?should I remove /usr/bin/ld and create
        a new symlink to /usr/local/bin/ld.gold?</div>
    </blockquote>
    <br>
    Aditya:<br>
    <br>
    I would think that /usr/bin/ld would be BSD ld.  Can you verify
    whether /usr/bin/ld is ld.bfd or ld.gold?  If it's not ld.gold, it
    won't use the Gold plugin.<br>
    <br>
    Rafael:<br>
    <br>
    Does -fuse-ld=gold cause Clang to look for ld.gold, or does it just
    cause Clang to pass the need command-line options to ld to get it to
    use the gold plugin?  Ideally, I'd like to not have to manually
    modify things in /usr/bin to get the Gold plugin working on
    FreeBSD.  I would think that it makes systems upgrades a nightmare.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <blockquote
cite="mid:CA+59L6gFvkoHMTV7X4UDN_nate+pOMb8DnYsksZeAFrTjKs4bw@mail.gmail.com"
      type="cite">
      <div class="gmail_extra"><br clear="all">
        <div>
          <div class="gmail_signature">
            <div dir="ltr">Regards
              <div>Aditya Verma</div>
              <div>Junior Undergraduate</div>
              <div>IDD Computer Sc & Engg</div>
              <div>IIT(BHU), Varanasi(UP)</div>
            </div>
          </div>
        </div>
        <br>
        <div class="gmail_quote">On Mon, Jun 22, 2015 at 5:25 AM, Rafael
          Espíndola <span dir="ltr"><<a moz-do-not-send="true" href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Two
            options:<br>
            <br>
            * Try passing -fuse-ld=gold to clang.<br>
            * have 'ld' be a symlink to ld.gold.<br>
            <br>
            Cheers,<br>
            Rafael<br>
            <div>
              <div class="h5"><br>
                <br>
                <br>
                On 22 June 2015 at 04:02, Aditya Verma <<a moz-do-not-send="true" href="mailto:aditya.verma.cse12@iitbhu.ac.in">aditya.verma.cse12@iitbhu.ac.in</a>>
                wrote:<br>
                ><br>
                > I have been trying to enable the gold linker on
                FreeBSD to use the link time<br>
                > optimizations. I made gold from the binutils under
                /usr/ports. After<br>
                > building binutils using make -k install clean i got
                ld under /usr/bin and in<br>
                > the directory /usr/local/bin i got ld, ld.gold and
                ld.bfd.<br>
                ><br>
                > Now while trying to use link time optimization for
                the simple example<br>
                > programs herehttp://<a moz-do-not-send="true" href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_docs_GoldPlugin.html&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=RiyytjZtbvoW0RgjWgbaDEywnPSEyVOWm21_R6ftAW0&s=9yaRTUr1ClS9IcR4zr7lGBT8Xhpzm_Mgnll4tGNRYXU&e=" rel="noreferrer" target="_blank">llvm.org/docs/GoldPlugin.html</a>
                (a.c and b.c under the<br>
                > heading 'Examples of Link Time Optimization') i
                entered the four commands as<br>
                > follows:<br>
                ><br>
                > clang -flto a.c -c -o a.o<br>
                > ar q a.a a.o<br>
                > clang b.c -c -o b.o<br>
                > clang -flto a.a b.o -o main<br>
                ><br>
                > I got the following error:<br>
                ><br>
                > usr/bin/ld: unrecogonized option '-plugin'<br>
                > usr/bin/ld: use the --help option for usage
                information<br>
                > clang: error: linker command failed with exit code
                1 (use -v to see<br>
                > invocation)<br>
                ><br>
                > Is there the problem with the linker that ld.gold
                is not being called.<br>
                > Should I replace the ld with ld.gold? Does the
                linker looks in the right<br>
                > directiry for the .so plugins?<br>
                ><br>
                > The LLVMgold.so and libLTO.so shared objects are in
                the directory<br>
                > /usr/local/llvm-devel/lib/. I cannot find the
                directory where clang is<br>
                > installed. I am not sure where to make the
                bfd-plugins directory and add the<br>
                > symlinks to LLVMgold.so and libLTO.so.<br>
                ><br>
                > I am using freebsd 10.1 release. How to enable the
                gold linker for link time<br>
                > optimizations? also how can I enable it to be the
                default linker?<br>
                ><br>
                ><br>
              </div>
            </div>
            > _______________________________________________<br>
            > LLVM Developers mailing list<br>
            > <a moz-do-not-send="true" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> 
                   <a moz-do-not-send="true" href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
            > <a moz-do-not-send="true" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
            ><br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cs.rochester.edu_u_criswell&d=AwMD-g&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=LlL2cntjGj70ABD0GBQFxh9H1Bstfk7GesHZxa9q_Xg&s=CaeJRIz2anerWupLkvVuEaEg8IxZ381YtIzeUKWvGG4&e=">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>