<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/144278>144278</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Compilation error when building llvm 20.1.7 on macOS that is older than 10.10 [patch included]
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ar-an-ribe
</td>
</tr>
</table>
<pre>
When building llvm 20.1.7 on macOS 10.9, the following compilation error is emitted:
```
[ 3%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Threading.cpp.o
In file included from «directory»/llvm-project-20.1.7.src/llvm/lib/Support/Threading.cpp:67:
«directory»/llvm-project-20.1.7.src/llvm/lib/Support/Unix/Threading.inc:25:10: fatal error: pthread/qos.h: No such file or directory
25 | #include <pthread/qos.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
gmake[3]: *** [lib/Support/CMakeFiles/LLVMSupport.dir/build.make:2193: lib/Support/CMakeFiles/LLVMSupport.dir/Threading.cpp.o] Error 1
```
The header `<pthread/qos.h>` and the pthread Quality of Service classes were first added to macOS in version 10.10, so this error would be emitted when building llvm 20.1.7 on any version of macOS that is older than 10.10. The attached patch for `llvm/lib/Support/Unix/Threading.inc` (in `diff` unified context format) will allow compilation on these versions of macOS.
If versions of llvm that are older than 20.1.7 are still being maintained, an analogous patch should also be applied to their respective versions of `llvm/lib/Support/Unix/Threading.inc` if those versions of this file also `#include <pthread/qos.h>` on macOS.
[llvm-20.1.7-patch.zip](https://github.com/user-attachments/files/20747416/llvm-20.1.7-patch.zip)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVUFv4zYT_TX0ZWCBoizZOuggOzGwwO73oci23SsljSx2KVIlqXjTQ397MbScjTdFiqAVBBgi6Zl5j-_NSO_VySBWLN-z_G4l5zBYV0m3lmbtVIOrxnZP1a8DGmhmpTtlTqD14wiCJ2myBWtglO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