Open
Description
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.