Mesa build fails with sbuild: "undefined reference to '_GUID const & __wsl_stud_uidof<IDxcLibrary>()'"
I am trying to build Mesa 22.0.5 for Jammy on Focal. I also tried the same on a Jammy host. But, I get the same error. I am using sbuild to create a jammy-amd64 chroot and build the mesa debs.
What baffles me is that the same machine was able to build it without fail 2 days ago.
Here is the relevant section where it fails:-
FAILED: src/gallium/targets/dri/libgallium_dri.so
c++ -o src/gallium/targets/dri/libgallium_dri.so src/gallium/targets/dri/libgallium_dri.so.p
.......
/usr/bin/ld: src/gallium/drivers/d3d12/libd3d12.a.p/d3d12_compiler.cpp.o: in function `d3d12_validation_tools::d3d12_validation_tools()':
./build/../src/gallium/drivers/d3d12/d3d12_compiler.cpp:1486: undefined reference to `_GUID const& __wsl_stub_uuidof<IDxcValidator>()'
/usr/bin/ld: ./build/../src/gallium/drivers/d3d12/d3d12_compiler.cpp:1502: undefined reference to `_GUID const& __wsl_stub_uuidof<IDxcLibrary>()'
/usr/bin/ld: ./build/../src/gallium/drivers/d3d12/d3d12_compiler.cpp:1508: undefined reference to `_GUID const& __wsl_stub_uuidof<IDxcCompiler>()'
collect2: error: ld returned 1 exit status
Here is the full relevant output - https://pastebin.com/vJ6NCqwS
Things I have tried to fix this:-
- Downloaded files afresh from Ubuntu packages and rebuilt.
- Tried to build on updated Ubuntu Jammy.
Any ideas regarding the error or any known fixes. I have Googled around but couldn't find this exact error mentioned anywhere.