Skip to content

Make failed with clang built kernel 6.4.0 #67

@mzyx-hnu

Description

@mzyx-hnu

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions