Error building 520.56.06

Trying to build the 520.56.06 with clang/llvm 16.0.3 fails. I’m on kernel 6.1.28, Slackware64-current. Full log attached: (514.5 KB)

Sample of the errors:

   /tmp/selfgz9304/NVIDIA-Linux-x86_64-520.56.06/kernel/conftest/functions.h:97:2: error: wait_on_bit_lock() conftest failed!
   #error wait_on_bit_lock() conftest failed!
   /tmp/selfgz9304/NVIDIA-Linux-x86_64-520.56.06/kernel/common/inc/nv-linux.h:1231:9: error: call to undeclared function 'dma_is_direct'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
       if (dma_is_direct(get_dma_ops(dev)))

Despite not detecting llvm linker, even with all environment variables correctly set, this exact setup can compile a fully functional kernel module for all recent drivers though (530, 525 series).