<html>
    <head>
      <base href="https://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 --- - "foo.h" headers cause cyclic dependency between 'std' and 'Darwin' modules"
   href="https://llvm.org/bugs/show_bug.cgi?id=25341">25341</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"foo.h" headers cause cyclic dependency between 'std' and 'Darwin' modules
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>All
          </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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>cdavis5x@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Ever since Richard started adding wrappers to libc++ for the standard C headers
("foo.h" headers, as he calls them), there's been a cyclic dependency between
the master libc++ module* 'std' and the Darwin master system header module
'Darwin'. Even attempting to use <assert.h>/<cassert> (as LLVM's test for
module support does) breaks like so:

While building module 'Darwin' imported from /usr/include/assert.h:42:
While building module 'std' imported from
[...]/llvm-git/build1/bin/../include/c++/v1/math.h:309:
In file included from <module-includes>:1:
In file included from
[...]/llvm-git/build1/bin/../include/c++/v1/algorithm:626:
In file included from [...]/llvm-git/build1/bin/../include/c++/v1/cstring:61:
[...]/llvm-git/build1/bin/../include/c++/v1/string.h:61:15: fatal error:
      cyclic dependency in module 'Darwin': Darwin -> std -> Darwin
#include_next <string.h>
              ^
While building module 'Darwin' imported from /usr/include/assert.h:42:
In file included from <module-includes>:86:
In file included from
[...]/llvm-git/build1/bin/../lib/clang/3.8.0/include/tgmath.h:29:
[...]/llvm-git/build1/bin/../include/c++/v1/math.h:309:10: fatal error:
      could not build module 'std'
#include <type_traits>
 ~~~~~~~~^
In file included from <stdin>:2:
/usr/include/assert.h:42:10: fatal error: could not build module 'Darwin'
#include <sys/cdefs.h>
 ~~~~~~~~^
3 errors generated.

I can't seem to get around this without turning off modules entirely--which is
a shame, because building LLVM is noticeably faster with modules on (at least,
when it works). No modification to libc++'s module map (at least, none that
I've tried) fixes this; the problem seems to be rooted in the fact that the
system headers are pulling in libc++'s "foo.h" wrappers.

* I'm talking, of course, about Clang's pre-compiled modules support, which is
turned on with -fmodules/-fcxx-modules.</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>