Re: [PATCH] Makefile: LTO: have linker check -Wframe-larger-than

From: Kees Cook
Date: Mon May 24 2021 - 18:30:31 EST


On Thu, 11 Mar 2021 17:09:41 -0800, Nick Desaulniers wrote:
> -Wframe-larger-than= requires stack frame information, which the
> frontend cannot provide. This diagnostic is emitted late during
> compilation once stack frame size is available.
>
> When building with LTO, the frontend simply lowers C to LLVM IR and does
> not have stack frame information, so it cannot emit this diagnostic.
> When the linker drives LTO, it restarts optimizations and lowers LLVM IR
> to object code. At that point, it has stack frame information but
> doesn't know to check for a specific max stack frame size.
>
> [...]

Applied to for-linus/clang/features, thanks! This should be in -next
tomorrow and I'll send it on for -rc4 at the end of the week.

[1/1] Makefile: LTO: have linker check -Wframe-larger-than
https://git.kernel.org/kees/c/24845dcb170e

--
Kees Cook