We are aborting a build in case when gcc doesn't support fentry on x86_64 (regs->ip modification can't really reliably work with mcount). This however breaks allmodconfig for people with older gccs that don't support -mfentry. Turn the build-time failure into runtime failure, resulting in the whole infrastructure not being initialized if CC_USING_FENTRY is unset.
Showing the changes to kernel/livepatch (1 of 2 files). Show all
Unified · Split
| @@ -911,6 +911,12 @@ static int klp_init(void) · 910 unmodified lines | |||
| 911 | { | 911 | { |
| 912 | int ret; | 912 | int ret; |
| 913 | 913 | ||
| 914 | ret = klp_check_compiler_support(); | ||
| 915 | if (ret) { | ||
| 916 | pr_info("Your compiler is too old; turning off.\n"); | ||
| 917 | return -EINVAL; | ||
| 918 | } | ||
| 919 | |||
| 914 | ret = register_module_notifier(&klp_module_nb); | 920 | ret = register_module_notifier(&klp_module_nb); |
| 915 | if (ret) | 921 | if (ret) |
| 916 | return ret; | 922 | return ret; |