Open ppenzin opened 3 months ago
@llvm/issue-subscribers-openmp
Author: Petr Penzin (ppenzin)
If the library doesn't exist, won't it cause link error if the source code is not guarded properly as what WASM did?
I don't think there are actual calls to pthread routines, it is simply checking that target environment has threads.
For RISC-V it is possible to make the build happy by pointing to Linux headers though.
OpenMP has a check for Wasm to disable searching for threading library:
https://github.com/llvm/llvm-project/blob/48aebd4cf88b3632e8c3ed6b976287c973628e14/openmp/runtime/cmake/config-ix.cmake#L157-L158
This would be true for other cross-builds as well, where sysroot doesn't contain a threading library. I've ran into it while doing RISC-V cross-compilation for #87026. I think the check can be expanded into a CMake cache variable.