[Linux kernel] unknown warning option: -Wframe-larger-than=2048
| Bugzilla Link | 4072 |
| Resolution | FIXED |
| Resolved on | Jun 06, 2014 16:05 |
| Version | unspecified |
| OS | Linux |
| Blocks | llvm/llvm-project#4440 |
| Reporter | LLVM Bugzilla Contributor |
| CC | @akyrtzi,@brycelelbach,@nlewycky,@qcolombet |
Extended Description
The Linux kernel makes use of the -Wframe-larger-than option, to warn at build time if a stack frame is distressingly large.
Fixed in clang r210293. Please file a new bug if you experience further issues.
I’ve made a step toward fixing this. In clang r200931, we can now emit stack size warning, promote then to errors, etc. All of this is achieved by using the -Wframe-larger-than switch (and the related -Werror, -Wno-<>, etc., tricks).
However, at this stage of the implementation you cannot specify the stack size through that switch: you have to use a backend option: -mllvm -warn-stack-size=
In other words, to get the warnings for a stack bigger than 2048, instead of doing -Wframe-larger-than=2048 You have to do -Wframe-larger-than -mllvm -warn-stack-size=2048
Note, that this is a transition step and that at some point the -warn-stack-size=
Note also that the current diagnostic does not demangle function names: http://llvm.org/bugs/show_bug.cgi?id=18759
r128560 silences the warning about unknown option Wframe-larger-than.
So the only "warning" user gets about LLVM generating too large stack frame for some function's code is the resulting kernel Oopsing at some point when it's run?
(I assume there are differences between how large stack frames GCC & LLVM generate from the same code, so LLVM relying on GCC catching these issues probably isn't enough.)
r128560 silences the warning about unknown option Wframe-larger-than.
This can be disabled in the Linux kernel configuration. Using menuconfig (make menuconfig from the top of the kernel), select "Kernel Hacking", then "Warn for stack frames larger than (needs gcc 4.4)". Set it to 0, and it will be disabled.
Ok.
The kernel isn't going to be unblocked for quite a while, I suspect. :)
How else does one associate together all the Linux kernel bugs?
Dropped block on bug 4068, this isn't "blocking" the linux kernel build, per se.
assigned to @qcolombet