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

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 14:28:39 PDT 2018


smeenai created this revision.
smeenai added reviewers: beanz, compnerd, dexonsmith, EricWF, mclow.lists.
Herald added subscribers: llvm-commits, christof, mgorny.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D48675

Files:
  libcxxabi/CMakeLists.txt


Index: libcxxabi/CMakeLists.txt
===================================================================
--- libcxxabi/CMakeLists.txt
+++ libcxxabi/CMakeLists.txt
@@ -116,6 +116,7 @@
         ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBCXX_INCLUDES}
         ${LIBCXXABI_LIBCXX_INCLUDE_DIRS}
         ${LLVM_INCLUDE_DIR}/c++/v1
+  NO_DEFAULT_PATH
   NO_CMAKE_FIND_ROOT_PATH
   )
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48675.153179.patch
Type: text/x-patch
Size: 367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180627/d658fd9d/attachment-0001.bin>


More information about the llvm-commits mailing list