[PATCH] D18849: [modules] Avoid module relocation error when building modules from VFS
Bruno Cardoso Lopes via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 6 17:15:57 PDT 2016
bruno created this revision.
bruno added reviewers: rsmith, benlangmuir, klimek.
bruno added subscribers: aprantl, dexonsmith, cfe-commits.
The reproducer script (generated by the crash reproducer) invokes clang
and tries to rebuild modules using the headers in the .cache/vfs
directory. Depending on the order that modules are constructed it is
possible that there's a mismatch between the directory that a module was
constructed and the path that it was found:
fatal error: module '_Builtin_stddef_max_align_t' was built in directory
but now resides in directory
This happens because getFile() can leak the original path depending on
the way it's accessed. This seems to be known issue and one that demands
a lot of work to get rid of, according to:
[cfe-dev] Module maps, __FILE__ and lazy stat'ing of header
I tried a couple of fixes to the issue but this is the less invasive I
could come up with. This fixes the issue by first looking into modules
by using virtual dir paths instead of the real ones. Let me know if
there's a better solution or whether I'm missing something.
With this change on Darwin we are able to simulate a crash for a simple
application using "Foundation/Foundation.h" (which relies on a bunch of
different frameworks and headers) and successfully rebuild all the
modules by relying solely at the VFS overlay.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4941 bytes
Desc: not available
More information about the cfe-commits