This is an archive of the discontinued LLVM Phabricator instance.

[libc++abi] Limit libc++ header search to specified paths
AbandonedPublic

Authored by smeenai on Jun 27 2018, 2:27 PM.

Details

Summary

Right now, when libc++abi is locating libc++ headers, it specifies
several search locations, but it also doesn't prevent CMake from looking
for those headers in system directories. I don't know if this was
intentional or an oversight, but it has several issues:

  • We're looking specifically for the vector header, which could just as easily be found in a libstdc++ (or other C++ library) installation.
  • No system I know of places their C++ headers directly in system include directories (they're always under a C++ subdirectory), so the system search will never succeed.
  • find_path searches system paths before the user-specified PATHS, so if some system does happen to have C++ headers in its system include directories, those headers will be preferred, which doesn't seem desirable.

It makes sense to me to limit this header search to the explicitly
specified paths (using NO_DEFAULT_PATH, as is done for the other
find_path call in this file), but I'm putting it up for review in case
there's some use case I'm not thinking of.

Diff Detail

Event Timeline

smeenai created this revision.Jun 27 2018, 2:27 PM
smeenai edited subscribers, added: cfe-commits; removed: llvm-commits.Jun 27 2018, 2:29 PM

Huh, this went to llvm-commits instead of cfe-commits automatically. I guess the auto mailing list subscribing doesn't work great with the monorepo?

Please close this and open a new one. Adding cfe-commits after the fact will fail to send the patch/description to cfe-commits, and not everyone is on llvm-commits.