[llvm-bugs] [Bug 25341] New: "foo.h" headers cause cyclic dependency between 'std' and 'Darwin' modules

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 28 14:01:40 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=25341

            Bug ID: 25341
           Summary: "foo.h" headers cause cyclic dependency between 'std'
                    and 'Darwin' modules
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: cdavis5x at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151028/85f8bac4/attachment-0001.html>


More information about the llvm-bugs mailing list