<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/119793>119793</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] clang should rely on gentoo config file for stdc++ headers location
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
MagicalTux
</td>
</tr>
</table>
<pre>
There are a number of references to gentoo in https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Gnu.cpp
Specifically, location of both gcc and stdc++ are detected using some magic paths, and for gcc config if a gentoo-like config file is found in `<sysroot>/etc/env.d/gcc/` it will be used for gcc configuration, which is great for people working on systems with non-standard paths.
Yet, while the configuration file also contains the location of stdc++ on gentoo, it is ignored and instead a non-standard path is also tested with a comment about "Gentoo is weird and places its headers inside the GCC install".
Instead using `STDCXX_INCDIR` from the gentoo config file that is parsed for detecting stdc++ headers location would be both cleaner, future proof (for example if gentoo decides to store stdc++ includes somewhere else the config) and would also help me greatly to direct clang to the right paths without using symlinks everywhere.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVE9z6jYQ_zTishPGloGEgw8JlEwO7aEvh9dTR5bWthpZ8khreHz7zsqm4eXQmXcARkLa_f3TqpRs5xFrsX0R2-NKTdSHWP-uOquVe59-rJpgrvV7jxFB8Qf8NDQYIbQQscWIXmMCCtChpxDAeuiJxiSqZyFPQp46S_3UrHUYhDw5d779PIwx_IOahDw1LjRCngZlvZAn7ZTv-JDlzWO0Z4xCnt5DcIdeWZ-EPL36aa3HURTPonj-NqK2LQN2VyEP4IJWZINnjE2gHjqtQXkDiYwW8kXIl8zFIKEmNDAl6ztIYUAYmDmMivrEpfhWG2KuoINvbQe2BbWQfXD2A2_7rXUINkEbJm9YBrErRHVI1xRDIFH9JuQJSfO3P68NK6N5JXYFWIKLdQ4ahCnh15ZTzHQYz6W3uucuXURF-dyIY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