]> code.ossystems Code Review - openembedded-core.git/commit
kernel-yocto: conditionally enable stack protection checking on x86-64
authorBruce Ashfield <bruce.ashfield@gmail.com>
Tue, 23 Nov 2021 21:57:31 +0000 (16:57 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 24 Nov 2021 09:55:05 +0000 (09:55 +0000)
commit0ad2b69dace6ac851c1f0bdae6a3c41045fc2d1d
tree676855f1ebd423f5bfa3466b1c6e9469a8ba71e3
parent3356c5e7acc86be2e1584819a70e984d984b0d9c
kernel-yocto: conditionally enable stack protection checking on x86-64

The kernel Makfile uses pkgconfig to check for libelf when enabling
CONFIG_STACK_VALIDATION. We already have libelf in our DEPENDS, but
the kernel Makefiles hardcode 'pkgconfig', so fail to pick up our
pkgconfig-native binary that would report the correct flags and paths
for libelf support.

Rather than patching the kernel Makefile's to use pkgconfig-native,
we can use the KERNEL_EXTRA_ARGS variable to pass the definition of
HOST_LIBELF_LIBS via the kernel build commmand line.

We conditionally set HOST_LIBELF_LIBS based on "stack" being in
a newly introduced variable KERNEL_DEBUG_OPTIONS. The value of
HOST_LIBELF_LIBS is the same as pkgconfig-native would set in a
kernel build (but we cannot call pkgconfig at the point this
variable is set).

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-kernel/linux/linux-yocto.inc