I'm trying to compile my own custom kernel for Android using the toolchain from Android NDK r16b. I get the kernel source code at here. I never modified the source code of the kernel (specifically that part). And this is the problem I had while compiling it.
/root/custom-kernel/kernel/Xiaomi_Kernel_OpenSource-cactus-o-oss/drivers/misc/mediatek/base/power/mcdi/mcdi_v1/mtk_mcdi_profile.c: In function 'mcdi_profile_read':
/root/custom-kernel/kernel/Xiaomi_Kernel_OpenSource-cactus-o-oss/drivers/misc/mediatek/base/power/mcdi/mcdi_v1/mtk_mcdi_profile.c:239:2: error: missing braces around initializer [-Werror=missing-braces]
} cnt[2] = {0};
^
/root/custom-kernel/kernel/Xiaomi_Kernel_OpenSource-cactus-o-oss/drivers/misc/mediatek/base/power/mcdi/mcdi_v1/mtk_mcdi_profile.c:239:2: error: (near initialization for 'cnt[0].sec') [-Werror=missing-braces]
cc1: all warnings being treated as errors
This is the part of the code that produces the error. If you want to see the full kernel compilation log,you can check it in here. This is the steps that i do for compiling the kernel :
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=/root/custom-kernel/kernel/toolchain/bin/arm-linux-androideabi-
cd /root/custom-kernel/kernel/Xiaomi_Kernel_OpenSource-cactus-o-oss
make clean
make mrproper
mkdir ../out
make O=../out cereus_defconfig
cd ../out
make
I already try the solution from here and it's still doesn't fix it. Any answer/help is appreciated!