When running script/headless.py reftest from gfx/wr/wrench in mozilla-unified, I run into a known build issue for mesa listed here when building osmesa-src if LLVM has version >= 15. I managed to fix this by redirecting my /usr/bin/llvm-config symlink so that it points to the path for llvm-config-14. This build issue has been fixed upstream in mesa, but mesa-src here predates that fix.