From f9acd1cc96c643e26f2edf0f5b3227a8d997bd8f Mon Sep 17 00:00:00 2001 From: ColorfulRhino <131405023+ColorfulRhino@users.noreply.github.com> Date: Sat, 30 Mar 2024 15:18:17 +0100 Subject: [PATCH] meson-s4t7: Enable DEBUG_KERNEL to work around issues with Khadas common_drivers --- config/kernel/linux-meson-s4t7-legacy.config | 15 +++++++++++---- config/sources/families/meson-s4t7.conf | 10 +++++++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/config/kernel/linux-meson-s4t7-legacy.config b/config/kernel/linux-meson-s4t7-legacy.config index 6a387fbb49..ba8500c7ff 100644 --- a/config/kernel/linux-meson-s4t7-legacy.config +++ b/config/kernel/linux-meson-s4t7-legacy.config @@ -2,14 +2,14 @@ # Automatically generated file; DO NOT EDIT. # Linux/arm64 5.15.119 Kernel Configuration # -CONFIG_CC_VERSION_TEXT="aarch64-linux-gnu-gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0" +CONFIG_CC_VERSION_TEXT="aarch64-linux-gnu-gcc (Ubuntu 13.2.0-19ubuntu1) 13.2.0" CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=110400 +CONFIG_GCC_VERSION=130200 CONFIG_CLANG_VERSION=0 CONFIG_AS_IS_GNU=y -CONFIG_AS_VERSION=23800 +CONFIG_AS_VERSION=24200 CONFIG_LD_IS_BFD=y -CONFIG_LD_VERSION=23800 +CONFIG_LD_VERSION=24200 CONFIG_LLD_VERSION=0 CONFIG_CC_CAN_LINK=y CONFIG_CC_CAN_LINK_STATIC=y @@ -420,6 +420,7 @@ CONFIG_HZ=250 CONFIG_SCHED_HRTICK=y CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_HW_PERF_EVENTS=y +CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_PARAVIRT=y CONFIG_PARAVIRT_TIME_ACCOUNTING=y # CONFIG_KEXEC is not set @@ -700,6 +701,7 @@ CONFIG_HAVE_ARCH_STACKLEAK=y CONFIG_HAVE_STACKPROTECTOR=y CONFIG_STACKPROTECTOR=y CONFIG_STACKPROTECTOR_STRONG=y +CONFIG_ARCH_SUPPORTS_SHADOW_CALL_STACK=y CONFIG_ARCH_SUPPORTS_LTO_CLANG=y CONFIG_ARCH_SUPPORTS_LTO_CLANG_THIN=y CONFIG_LTO_NONE=y @@ -8238,7 +8240,12 @@ CONFIG_LSM="lockdown,yama,integrity,apparmor" # # Memory initialization # +CONFIG_CC_HAS_AUTO_VAR_INIT_PATTERN=y +CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO_BARE=y +CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y CONFIG_INIT_STACK_NONE=y +# CONFIG_INIT_STACK_ALL_PATTERN is not set +# CONFIG_INIT_STACK_ALL_ZERO is not set CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y diff --git a/config/sources/families/meson-s4t7.conf b/config/sources/families/meson-s4t7.conf index 4a9ed9edf5..29c87d71e2 100644 --- a/config/sources/families/meson-s4t7.conf +++ b/config/sources/families/meson-s4t7.conf @@ -111,7 +111,8 @@ function build_custom_uboot__meson_s4t7_build_custom_uboot() { declare -g EXTENSION_BUILT_UBOOT=yes } -function armbian_kernel_config__add_khadas_common_drivers() { +function custom_kernel_config__add_khadas_common_drivers() { + # viraniac: The kernel config hooks are always called twice, once without being in kernel directory and once with current directory being the kernel work directory. if [[ ! -f .config ]]; then display_alert "$BOARD" "Fetching khadas common drivers git info" "info" @@ -126,6 +127,13 @@ function armbian_kernel_config__add_khadas_common_drivers() { # Hack to ensure that we will recreate kernel if common_drivers source changes kernel_config_modifying_hashes+=( "khadas_common_drivers=${GIT_INFO_COMMON_DRIVERS[SHA1]}" ) + else + # Unfortunately, debug kernel has to be enabled to make khadas_common_drivers compile + display_alert "Enabling kernel config" "DEBUG_KERNEL=y, EXPERT=y, EMBEDDED=y to fix khadas_common_drivers compilation" "info" + kernel_config_modifying_hashes+=("CONFIG_DEBUG_KERNEL=y" "CONFIG_EXPERT=y" "CONFIG_EMBEDDED=y") + kernel_config_set_y DEBUG_KERNEL + kernel_config_set_y EXPERT + kernel_config_set_y EMBEDDED fi }