diff options
author | Mark Mentovai <mark@mentovai.com> | 2022-09-11 13:48:17 -0400 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2022-10-20 09:53:23 +0200 |
commit | 802bfe080678b3a8a94868b717bd127afcabc5b7 (patch) | |
tree | 64f604113f761d7ee6987574eb77c9d00c15fcd5 /package/boot | |
parent | 5e31c82bb506bff9c60c4d01791bea7a29e4a020 (diff) | |
download | upstream-802bfe080678b3a8a94868b717bd127afcabc5b7.tar.gz upstream-802bfe080678b3a8a94868b717bd127afcabc5b7.tar.bz2 upstream-802bfe080678b3a8a94868b717bd127afcabc5b7.zip |
kernel: disable stack validation for external module builds as needed
c3e31b6a9b04 and 5f8e5872406d disable stack validation when the build
host is not running Linux, as the objtool kernel build tool required for
stack validation is not portable to other build host environments. This
was achieved by setting CONFIG_STACK_VALIDATION= in KERNEL_MAKEOPTS, and
by setting SKIP_STACK_VALIDATION=1 in the environment. KERNEL_MAKEOPTS
only has effect for the kernel build, not for external module builds,
but through kernel 5.14, SKIP_STACK_VALIDATION worked to disable this
feature too, so stack validation was disabled for external module builds
as well. Since kernel 0d989ac2c90b, the kernel build no longer considers
SKIP_STACK_VALIDATION, so the feature will be disabled for the kernel
build, but not for external module builds.
When building OpenWrt on a non-Linux build host targeting x86 (the only
target architecture for which OpenWrt enables the kernel
CONFIG_STACK_VALIDATION) and using kernel 5.15 (such as via
CONFIG_TESTING_KERNEL), this caused a build failure during any external
module build, such as kmod-button-hotplug. This manifested as build
errors such as:
make[4]: *** No rule to make target
'.../build_dir/target-x86_64_musl/linux-x86_64/button-hotplug/button-hotplug.o',
needed by
'.../build_dir/target-x86_64_musl/linux-x86_64/button-hotplug/button-hotplug.mod'.
Stop.
Although button-hotplug.c was present, the implicit rule to make
$(obj)/%.o from $(src)/%.c in the kernel's scripts/Makefile.build could
not be satisfied in this case, as it also depends on $(objtool_dep),
non-empty as a result of the failure to propagate disabling of stack
validation to external module builds, in a configuration where it is not
possible to build objtool.
KERNEL_MAKEOPTS is used for just the kernel build itself, while
KERNEL_MAKE_FLAGS is used for both the kernel build and for external
module builds. This restores the ability to build OpenWrt in such
configurations by moving the CONFIG_STACK_VALIDATION= make argument from
KERNEL_MAKEOPTS to KERNEL_MAKE_FLAGS where it is able to affect external
module builds properly.
Note that the kernel's objtool and related configuration have seen a
major overhaul since kernel 5.15, and may need more attention again
after 22922deae13f, in kernel 5.19.
Signed-off-by: Mark Mentovai <mark@mentovai.com>
Diffstat (limited to 'package/boot')
0 files changed, 0 insertions, 0 deletions