This is an archive of the discontinued LLVM Phabricator instance.

[MinGW] Look for libc++ headers in a triplet prefixed path as well
ClosedPublic

Authored by mstorsjo on Apr 10 2018, 1:12 PM.

Details

Summary

This makes it consistent with libstdc++ and the other default include directories.

If these headers are found in both locations and one isn't a symlink to the other, this will cause errors due to libc++ headers having wrapper headers for some standard C headers, wrappers that do #include_next the actual one.

If the same libc++ standard C wrapper header exists in more than one include directory before the real system one, the header include guard will stop it from doing another #include_next to pick up the real one, breaking things.

As this is a rather uncommon situation, this should be acceptable and toolchain maintainers can adapt accordingly if necessary.

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Apr 10 2018, 1:12 PM
rnk accepted this revision.Apr 10 2018, 2:50 PM

lgtm

lib/Driver/ToolChains/MinGW.cpp
459 ↗(On Diff #141894)

Holy cow, this is long. =/ Maybe make a local variable Slash and use it?

This revision is now accepted and ready to land.Apr 10 2018, 2:50 PM
mstorsjo added inline comments.Apr 10 2018, 11:56 PM
lib/Driver/ToolChains/MinGW.cpp
459 ↗(On Diff #141894)

Ok, will do before pushing.

This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.