465.31 Nvidia driver with Clang LTO enabled fails to load with 5.13

Compiling the Nvidia kernel modules of 465.31 with Clang LTO enabled under 5.12 works fine. The kernel as well as the Nividia modules were compiled with Clang LTO enabled. The modules load as expected under the active kernel with no known issues.

With the new 5.13 kernel does it produce depmod warnings and the modules will not load under the active kernel:

nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_jmp_rax
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_jmp_rcx
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_jmp_rdx
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_jmp_r10
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_jmp_r9
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_jmp_rsi
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_call_rax
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_call_r15
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_call_r11
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_call_rsi
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_call_r9
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_call_r8
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_call_r10
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_call_rdx
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_call_rcx
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_call_r12
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_call_r13
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_call_rbx
nvidia-modeset.ko needs unknown symbol __x86_indirect_alt_call_rbp
nvidia.ko needs unknown symbol __x86_indirect_alt_jmp_rax
nvidia.ko needs unknown symbol __x86_indirect_alt_jmp_r8
nvidia.ko needs unknown symbol __x86_indirect_alt_jmp_r10
nvidia.ko needs unknown symbol __x86_indirect_alt_jmp_rdx
nvidia.ko needs unknown symbol __x86_indirect_alt_jmp_rcx
nvidia.ko needs unknown symbol __x86_indirect_alt_jmp_r9
nvidia.ko needs unknown symbol __x86_indirect_alt_jmp_rdi
nvidia.ko needs unknown symbol __x86_indirect_alt_jmp_r11
nvidia.ko needs unknown symbol __x86_indirect_alt_jmp_rsi
nvidia.ko needs unknown symbol __x86_indirect_alt_jmp_r13
nvidia.ko needs unknown symbol __x86_indirect_alt_jmp_rbx
nvidia.ko needs unknown symbol __x86_indirect_alt_jmp_r12
nvidia.ko needs unknown symbol __x86_indirect_alt_call_rax
nvidia.ko needs unknown symbol __x86_indirect_alt_call_r9
nvidia.ko needs unknown symbol __x86_indirect_alt_call_rdx
nvidia.ko needs unknown symbol __x86_indirect_alt_call_rcx
nvidia.ko needs unknown symbol __x86_indirect_alt_call_r13
nvidia.ko needs unknown symbol __x86_indirect_alt_call_r10
nvidia.ko needs unknown symbol __x86_indirect_alt_call_r8
nvidia.ko needs unknown symbol __x86_indirect_alt_call_r12
nvidia.ko needs unknown symbol __x86_indirect_alt_call_r11
nvidia.ko needs unknown symbol __x86_indirect_alt_call_r14
nvidia.ko needs unknown symbol __x86_indirect_alt_call_r15
nvidia.ko needs unknown symbol __x86_indirect_alt_call_rbx
nvidia.ko needs unknown symbol __x86_indirect_alt_call_rsi

Update:

The issue is reproducible with driver 470.57.02 as well.

The 470 driver’s kernel modules compile with full Clang LTO enabled and load under kernel 5.12.19 without issues.

With kernel 5.13 does the 470 driver produce the above mentioned warnings and the driver’s kernel modules fail to load.