<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">It looks like I just answered my question with this comment found in CC1:<div class=""><br class=""></div><div class=""><div class=""><font face="Monaco" class="">void InitHeaderSearch::AddDefaultIncludePaths(...</font><span style="font-family: Monaco;" class="">) {</span></div><div class=""><font face="Monaco" class=""> // NB: This code path is going away. All of the logic is moving into the</font></div><div class=""><font face="Monaco" class=""> // driver which has the information necessary to do target-specific</font></div><div class=""><font face="Monaco" class=""> // selections of default include paths. Each target which moves there will be</font></div><div class=""><font face="Monaco" class=""> // exempted from this logic here until we can delete the entire pile of code.</font></div><div class=""><font face="Monaco" class=""> ...</font></div><div class=""><br class=""></div><div class="">So it looks like this only happens on a few platforms (including Darwin), and this is just technical debt we need to get rid of. That makes sense to me and I'll try to take a stab at it.</div><div class=""><br class=""></div><div class="">Louis</div><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 22, 2019, at 16:21, Louis Dionne via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi,<br class=""><br class="">Here's my understanding of how include paths for the C++ Standard Library work in Clang (this assumes -stdlib=libc++):<br class=""><br class="">1. Based on the platform, the driver looks at various things like the installation path for Clang and passes `-internal-isystem <some-path>/c++/v1` to CC1.<br class="">2. The driver also passes -isysroot to CC1 if its own command-line contained -isysroot.<br class="">3. CC1 adds the path passed in -internal-isystem as the first search path in the search list.<br class="">4. CC1 looks at -isysroot and adds `<SYSROOT>/usr/include/c++/v1` to the header search paths (after whatever was specified in `-internal-isystem`). If no -isysroot was specified, `/` is used (and so `/usr/include/c++/v1` is added).<br class="">5. Any path that doesn't exist is removed from the list of search paths.<br class=""><br class="">Is this accurate? If so, I'm wondering why CC1 adds `<SYSROOT>/usr/include/c++/v1` to the search paths in (4) -- it seems like it should rely solely on the `-internal-isystem` path passed to it by the driver? Why isn't that the case?<br class=""><br class="">Thanks,<br class="">Louis<br class=""><br class="">_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev<br class=""></div></div></blockquote></div><br class=""></div></body></html>