When libomp is initialized, it creates a temp file in /dev/shm to store
registration flag. Some systems, like Android, don't have /dev/shm, then this
feature is disabled by the macro KMP_USE_SHM, though most Linux distributions
have that. However, some customized distribution, such as the one reported in
https://github.com/llvm/llvm-project/issues/53955, doesn't support it either.
It causes a core dump. In this patch, if it is the case, we will try to create a
temporary file in /tmp, and if it still doesn't make it, then we error out.
Note that we don't consider in this patch if the temporary directory has been
set to TMPDIR in this patch. If /tmp is not accessible, we error out.
Fix #53955.
Hmm, this should be removed. No idea where it comes from.