<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Using wrong compiler when linking Lsan-x86_64-Test (and maybe elsewhere)"
   href="http://llvm.org/bugs/show_bug.cgi?id=16272">16272</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Using wrong compiler when linking Lsan-x86_64-Test (and maybe elsewhere)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>andyg1001@hotmail.co.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When compiling compiler-rt using cmake, the just-built version of clang is used
to compile source files (e.g. lsan_dummy_unittest.cc.x86_64.o), but when it
comes to linking (e.g. Lsan-x86_64-Test), the compiler used for linking is the
system one.

On my system, this causes the build to fail on linking Lsan-x86_64-Test with
"undefined reference to `std::ios_base::Init::Init()'" since the source file is
compiled against libstdc++11 but being linked against libc++11.

I expect there is a simple solution, i.e. to ensure that the same compiler is
used for compiling and for linking, but I am not familiar with compiler-rt so
can't provide a fix myself.

I also don't know whether this problem occurs elsewhere -- it may just be
fortunate that the conflict arises here!</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>