From 6256ce3548d9f5f3e5dd67be2c8102e27fa0b2a9 Mon Sep 17 00:00:00 2001 From: Dezhen Wang Date: Sun, 4 Feb 2024 07:21:36 +0000 Subject: [PATCH] kernel6.6: support clang build for a4 and a5 [1/1] PD#SWPL-156726 Problem: support clang build for a4 and a5 Solution: fix build error Verify: a4 a5 Change-Id: I9aa3e06010344c9a313365d3dcdf1b10b4f75904 Signed-off-by: Dezhen Wang --- drivers/memory_debug/memory_ext/watch_point.c | 9 +++++++++ drivers/memory_ext/Makefile | 1 + scripts/amlogic/amlogic_smarthome_utils.sh | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/memory_debug/memory_ext/watch_point.c b/drivers/memory_debug/memory_ext/watch_point.c index 5c0de13f4..e49bdad57 100644 --- a/drivers/memory_debug/memory_ext/watch_point.c +++ b/drivers/memory_debug/memory_ext/watch_point.c @@ -81,6 +81,11 @@ struct aml_watch_points *awp; READ_WB_REG_CASE(OFF, 15, REG, VAL); \ } while (0) +#ifdef CONFIG_CC_IS_CLANG +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wimplicit-fallthrough" +#endif + static u64 read_wb_reg(int reg, int n) { u64 val = 0; @@ -97,6 +102,10 @@ static u64 read_wb_reg(int reg, int n) return val; } +#ifdef CONFIG_CC_IS_CLANG +#pragma clang diagnostic pop +#endif + /* Determine number of WRP registers available. */ static int aml_get_num_wrps(void) { diff --git a/drivers/memory_ext/Makefile b/drivers/memory_ext/Makefile index d8ca6b152..27cbc35f0 100644 --- a/drivers/memory_ext/Makefile +++ b/drivers/memory_ext/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: (GPL-2.0+ OR MIT) ccflags-y += -I$(srctree)/mm -I$(srctree)/drivers/iommu/arm/arm-smmu-v3 +KBUILD_CFLAGS += -Wframe-larger-than=2068 obj-$(CONFIG_AMLOGIC_PAGE_TRACE) += page_trace.o obj-$(CONFIG_AMLOGIC_SLAB_TRACE) += slab_trace.o diff --git a/scripts/amlogic/amlogic_smarthome_utils.sh b/scripts/amlogic/amlogic_smarthome_utils.sh index ae723455c..7c1c40e88 100644 --- a/scripts/amlogic/amlogic_smarthome_utils.sh +++ b/scripts/amlogic/amlogic_smarthome_utils.sh @@ -166,8 +166,8 @@ export -f only_build_dtb_for_smarthome function make_menuconfig_cmd_for_smarthome () { if [[ -n ${MENUCONFIG} ]]; then set -x - make ARCH=${ARCH} -C ${ROOT_DIR}/${KERNEL_DIR} O=${OUT_DIR} ${DEFCONFIG} - make ARCH=${ARCH} -C ${ROOT_DIR}/${KERNEL_DIR} O=${OUT_DIR} menuconfig + make ARCH=${ARCH} -C ${ROOT_DIR}/${KERNEL_DIR} O=${OUT_DIR} ${TOOL_ARGS} ${DEFCONFIG} + make ARCH=${ARCH} -C ${ROOT_DIR}/${KERNEL_DIR} O=${OUT_DIR} ${TOOL_ARGS} menuconfig set +x exit fi