[PATCH] D48694: [libc++abi] Limit libc++ header search to specified paths

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 29 17:34:57 PDT 2018


smeenai added a comment.

In https://reviews.llvm.org/D48694#1146232, @EricWF wrote:

> LGTM, but I'm a bit confused. You seem to argue that no system places C++ headers on the default search paths, but also that it would be a problem if such a system did.
>  Why wouldn't the conclusion be true? That is, although C++ includes aren't normally found along the default paths, when they are found, we should still consider them?
>
> That being said, the current behavior of searching certian default include paths first does seem incorrect. So I'm OK with disabling it.
>
> I also agree that we shouldn't necessarily be looking for `vector` header, how about looking for `__config` instead, since it's libc++ specific?


Switching to `__config` is a good idea. I can do that separately, since it should be pretty uncontroversial.

For whether it makes sense to search for includes in the system path, that boils down to @ldionne's question of whether building libc++abi against a system-installed libc++ is supported. I actually don't know the answer to that myself ... @dexonsmith and @EricWF, what are your thoughts on that? The current search won't find the system-installed libc++ headers on Darwin anyway though, where they're placed in the compiler's include directory rather than a system include directory.

If we do decide that searching for C++ headers in the system is important, we can do two separate find_path calls, to ensure our specified paths are searched before the system paths. (We may also want to tweak the second call to actually look for the system C++ headers in the right places in that case.)


Repository:
  rCXXA libc++abi

https://reviews.llvm.org/D48694





More information about the cfe-commits mailing list