Make failed when installing with DKMS in a clang built kernel 6.4.0 environment. A "warning: stack frame size (420) exceeds limit (400) in 'func' [-Wframe-larger-than][-Werror] " occorred.
The root cause is clang spent more than 400bytes of stack frame, which triggered -Werror, -Wframe-larger-than=400 and failed. I checked both source code and found that gcc will only calculates the size of temporary variables in the code as the stack frame size. In contrast, clang calculates more objects such as stack pointer offsets, stack space allocated by alloc() func. So clang gets larger and more accurate results.
I don't understand the reason behind this 400bytes restriction, but since clang outputs a larger stack frame with the same code, is it reasonable to make a separate stack frame size limite for clang built kernel?
Make failed when installing with DKMS in a clang built kernel 6.4.0 environment. A "warning: stack frame size (420) exceeds limit (400) in 'func' [-Wframe-larger-than][-Werror] " occorred.
The root cause is clang spent more than 400bytes of stack frame, which triggered
-Werror, -Wframe-larger-than=400and failed. I checked both source code and found that gcc will only calculates the size of temporary variables in the code as the stack frame size. In contrast, clang calculates more objects such as stack pointer offsets, stack space allocated by alloc() func. So clang gets larger and more accurate results.I don't understand the reason behind this 400bytes restriction, but since clang outputs a larger stack frame with the same code, is it reasonable to make a separate stack frame size limite for clang built kernel?