<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/154139>154139</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
In clang, relocatable PCHs contain path to isysroot in `HEADER_SEARCH_OPTIONS`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jmcclellan-figma
</td>
</tr>
</table>
<pre>
Repro:
```
mkdir -p /tmp/pch-repro
cd /temp/pch-repro
touch header.h
clang -x c-header --relocatable-pch -isysroot /tmp/pch-repro/ header.h -o header.h.pch
llvm-bcanalyzer header.h.pch --dump | grep HEADER_SEARCH_OPTIONS
```
Note that this includes `/tmp/pch-repro`. This means that PCH builds depend on the absolute path to the isysroot, which can be a problem with build reproducibility/caching. AFAICT, this sysroot in `HEADER_SEARCH_OPTIONS` is never used for relocatable PCHs.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMU11P5CAU_TX05YamZdo689CH7mijL2rUd0PhTsGlQIDqzv76TTuj-6EPm5C0uZx7OIdz4THq0SK2pP5G6suMz0m50L5MQhg0hlt60OPEs8HJY_uAPjiy6UixrqY4r6KbvksdgHogrE-TJ6z3QtGw4otOyLWOnzaSm4UChVxiyNWCNNyOQH-AoKcqUBrQOMETHwxSLxRQHY8xOJe-Ooz1H3RA3cd_7sVCb8zrRAfBLTfHnxj-2gZK5Tx5IBd7GAN6uL7qLq8enh-vuof99fPd_dPN3e3jP75J0d26hJAUT5CUjqCtMLPECAvgs76myAGeFuCE3MZT4_3-GoZZGxlBokcrwVlICoEP0Zk5IXieFCS3Ft_tE7aHN6WFAsEtDAgcfHCDwQnedFInRliPlbPQgzY6HQnrBRdK2zEH6PruZv-08KzS369V20X81_abAnQEi68YYI4o4eAC_JHQ4iXmmWw3crfZ8Qzb8qKu6w0rmyZTbcU4liilKGSFByGlrPiO75phwG2zHQ6ZblnB6mJbbsu62rEm38qGCYYX26W1agpSFThxbfIly9yFMdMxztiWdVVudpnhA5q4TjNj6zQRxpbBDu0p_HmMpCqMjin-pkg6GWxvLJw79p8sgXA2cW0_ktD_d1vZHEyrUvJxeTesJ6wfdVLzkAs3EdYvEs4f6oN7QZEI61dLkbD-7Oq1Zb8CAAD__3GTMCU">