<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Clang libtools built out-of-tree cannot find libc++ on MacOS"
   href="https://bugs.llvm.org/show_bug.cgi?id=33607">33607</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang libtools built out-of-tree cannot find libc++ on MacOS
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>4.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>sdconsta@syr.edu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Until OS X 10.9, libc++ headers were installed into /usr/include/c++/v1. Since
then, then have been installed either as part of the XCode.app library, or as
part of the XCode command line tools. So they could potentially be in the
following locations:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
/Library/Developer/CommandLineTools/usr/include/c++/v1

In InitHeaderSearch.cpp (here:
<a href="https://clang.llvm.org/doxygen/InitHeaderSearch_8cpp_source.html">https://clang.llvm.org/doxygen/InitHeaderSearch_8cpp_source.html</a>),
InitHeaderSearch::AddDefaultIncludePaths() still uses /usr/include/c++/v1. This
doesn't matter for clang itself, because it can always find libc++ through the
relative path ../include/c++/v1. The problem arises when a libtool is built
out-of-tree using the clang Frontend library. In this case, on OS X 10.9+,
neither the legacy path (/usr/include/c++/v1) nor the relative path used by
clang will work.

Here is the relevant cfe-dev thread on this topic:

<a href="http://lists.llvm.org/pipermail/cfe-dev/2017-June/054425.html">http://lists.llvm.org/pipermail/cfe-dev/2017-June/054425.html</a></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>