Uvm make modules failed: CONFIG_RETPOLINE=y, but not supported by the compiler

I’am trying to run this GitHub - NVIDIA/open-gpu-kernel-modules: NVIDIA Linux open GPU kernel module source, but failed.
And I’ve tried to update gcc version, but also failed.
Maybe I should update my linux kernel to solve this problem?

make[1]: Entering directory `/usr/src/kernels/3.10.0-1160.42.2.el7.x86_64'
/usr/src/kernels/3.10.0-1160.42.2.el7.x86_64/arch/x86/Makefile:96: stack-protector enabled but compiler support broken
/usr/src/kernels/3.10.0-1160.42.2.el7.x86_64/arch/x86/Makefile:166: *** CONFIG_RETPOLINE=y, but not supported by the compiler. Compiler update recommended..  Stop.
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/usr/src/kernels/3.10.0-1160.42.2.el7.x86_64'
make: *** [modules] Error 2

Thanks for your help.

upup

https://bugzilla.redhat.com/show_bug.cgi?id=1566297

Thank you! I’ll have a try.

Actually my problem seems still unsolved…
I got the same problem at the end of this post:

@ Akemi Yagi @ Michael Savisko
Could u please be more specific about the “build environment was adjusted” “this was an installation issue, not compilation.”? We are experiencing the same failure on CentOS 7.9 and GCC version is already gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) that supports retpoline and it is the only gcc that has been installed.

Since my gcc version is also 4.8.5 20150623, and in this post it said:

Marek Polacek 2018-04-13 13:11:27 UTC
You have to use gcc-4.8.5-28.el7 or newer; older gccs don’t support -mindirect-branch= yet. Not a bug.