I've tried now the patching approach. I had to patch in total three files: src/amd/common/ac_nir_to_llvm.c src/gallium/auxiliary/gallivm/lp_bld_init.c src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c Nevertheless the build still fails at linking stage (see fail_log attachment).