<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    I have tried using llvm-ar/nm/ranlib instead of the ones provided by
    binutils, but I'm still getting the same errors.<br>
    <br>
    Thank you for clarifying about the linked bug!<br>
    <br>
    <div class="moz-cite-prefix">Am 05.04.2016 um 17:21 schrieb Matt
      Godbolt:<br>
    </div>
    <blockquote
cite="mid:CAFWXXN1WAkvRJyi-r7+h1trXtyd5jC7gHpAozCW4700nvGS_bg@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr">In the linked bug, the issue is that symbols
        defined in multiple places (LTO and non-LTO) are provided by the
        linker plugin (which in GCC's case marks the symbols as
        private).  The error appears to be a difference in which symbol
        gold or ld picks as canonical. I don't think it's the same as
        the issue you're seeing (unless you're mixing LTO and non-LTO
        files).
        <div><br>
        </div>
        <div>I'd guess likely the 'ar' et al needs to be the llvm-ar. I
          have no experience with LTO in llvm, but with GCC unless one
          uses the "right" ar, then often LTO information is lost in the
          archive.</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Tue, Apr 5, 2016 at 8:43 AM Daniil Troshkov
          via llvm-dev <<a moz-do-not-send="true"
            href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div dir="ltr">you can also try to find exactly revision
            number (using binary search through revisions and using
            comments in suspicious commits) and try to ask author
            directly... at least it will be additional info...</div>
          <div dir="ltr">
            <div class="gmail_extra"><br>
              <div class="gmail_quote">On Tue, Apr 5, 2016 at 4:28 AM,
                Below, Daniel via llvm-dev <span dir="ltr"><<a
                    moz-do-not-send="true"
                    href="mailto:llvm-dev@lists.llvm.org"
                    target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a></a>></span>
                wrote:<br>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px
0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
                  <div
style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;background-color:rgb(255,255,255)"
                    dir="ltr">
                    <p>Hi all,</p>
                    <p><br>
                    </p>
                    <p>I've been playing around with LLVM and LTO trying
                      to compile some open-source projects.</p>
                    <p><br>
                    </p>
                    <p>Prior to the 3.8 release I had been using r250630
                      (if I remember correctly) and I was able to
                      successfully build GamePlay (<a
                        moz-do-not-send="true"
                        href="https://github.com/gameplay3d/GamePlay"
                        target="_blank"><a class="moz-txt-link-freetext" href="https://github.com/gameplay3d/GamePlay">https://github.com/gameplay3d/GamePlay</a></a>).</p>
                    <p>Sadly, since upgrading to 3.8 I am getting weird
                      link-time-errors (error: undefined reference to
                      'XYZ::~XYZ').</p>
                    <p><br>
                    </p>
                    <p>It appears that these destructors are all virtual
                      (although I cannot guarantee this does not break
                      for non-virtual destructors too). The project
                      generates an archive file which is then linked
                      against to generate a few sample applications.
                      During this linking phase, the above error
                      (undefined reference to 'XYZ::~XYZ') appears.</p>
                    <p><br>
                    </p>
                    <p><br>
                    </p>
                    <p>I have upgraded the gold-linker, and I have tried
                      using the current trunk of LLVM - both did not
                      help. After three days of trying to debug this, I
                      have run out of ideas.</p>
                    <p><br>
                    </p>
                    <p>Is this a known bug? I have found an issue on the
                      gnu/binutils bugtracker that sounds similar (<a
                        moz-do-not-send="true"
href="https://lists.gnu.org/archive/html/bug-binutils/2016-03/msg00235.html"
                        target="_blank"><a class="moz-txt-link-freetext" href="https://lists.gnu.org/archive/html/bug-binutils/2016-03/msg00235.html">https://lists.gnu.org/archive/html/bug-binutils/2016-03/msg00235.html</a></a>
                      - bugged symbol resolution of weak symbols),
                      although in my case compilation is aborted because
                      of said errors.</p>
                    <p><br>
                    </p>
                    <p>Have there been any undocumented changes to LTO
                      in 3.8 I should be aware of? Is there maybe a
                      specific gold-linker version I have to use or
                      should I use llvm-ar/nm now, instead of the ar/nm
                      provided by binutils (which have worked for me
                      before 3.8)?</p>
                    <p><br>
                    </p>
                    <p>Any help is greatly appreciated,</p>
                    <p><br>
                    </p>
                    <p>Daniel<br>
                    </p>
                  </div>
                  <br>
                  _______________________________________________<br>
                  LLVM Developers mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:llvm-dev@lists.llvm.org"
                    target="_blank">llvm-dev@lists.llvm.org</a><br>
                  <a moz-do-not-send="true"
                    href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev"
                    rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
                  <br>
                </blockquote>
              </div>
              <br>
            </div>
          </div>
          _______________________________________________<br>
          LLVM Developers mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
          <a moz-do-not-send="true"
            href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev"
            rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>