[Android Q&A, Help & Troubleshooting] tr4ne88:
Hello everyone!

It's quite a while that I'm trying to build an Android kernel (a Samsung I9505 kernel) but I'm always getting some error. I have tried different kernel sources with no success... I always tried to fix the problems by searching in forums or internet in general but since I have not solved the problem I decided to open a Thread by my self. I have tried to build the kernel first without changing the .config file just to test if it completes.

I have:

- Ubuntu 14.04 LTS running on a VM in Windows 10

- the kernel source from Lineage 16.0 github

- linaro toolchain arm-eabi 4.7

And this is what I get by following command procedure:

root@ciccio-VirtualBox:~/android_kernel_samsung_jf# export ARCH=arm
root@ciccio-VirtualBox:~/android_kernel_samsung_jf# export CROSS_COMPILE=/root/arm-eabi-4.7/bin/arm-eabi-
root@ciccio-VirtualBox:~/android_kernel_samsung_jf# make clean
CLEAN .
CLEAN arch/arm/kernel
CLEAN usr
CLEAN .tmp_versions
root@ciccio-VirtualBox:~/android_kernel_samsung_jf# make mrproper
CLEAN scripts/basic
CLEAN scripts/genksyms
CLEAN scripts/kconfig
CLEAN scripts/mod
CLEAN scripts/selinux/genheaders
CLEAN scripts/selinux/mdp
CLEAN scripts
CLEAN include/config include/generated arch/arm/include/generated
CLEAN .config .version include/generated/uapi/linux/version.h
root@ciccio-VirtualBox:~/android_kernel_samsung_jf# make VARIANT_DEFCONFIG=jf_eur_defconfig jf_defconfig SELINUX_DEFCONFIG=selinux_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
arch/arm/configs/jf_defconfig:135:warning: override: reassigning to symbol INET_ESP
arch/arm/configs/jf_defconfig:675:warning: override: reassigning to symbol RFKILL
arch/arm/configs/jf_defconfig:683:warning: override: reassigning to symbol GENLOCK
arch/arm/configs/jf_defconfig:684:warning: override: reassigning to symbol GENLOCK_MISCDEVICE
arch/arm/configs/jf_defconfig:685:warning: override: reassigning to symbol BLK_DEV_LOOP
arch/arm/configs/jf_defconfig:767:warning: override: reassigning to symbol CRYPTO_ANSI_CPRNG
KCONFIG_SELINUX(arch/arm/configs/selinux_defconfig)
arch/arm/configs/selinux_defconfig:1:warning: override: reassigning to symbol EXT2_FS_XATTR
arch/arm/configs/selinux_defconfig:2:warning: override: reassigning to symbol EXT2_FS_SECURITY
arch/arm/configs/selinux_defconfig:3:warning: override: reassigning to symbol EXT4_FS_XATTR
arch/arm/configs/selinux_defconfig:4:warning: override: reassigning to symbol EXT4_FS_SECURITY
arch/arm/configs/selinux_defconfig:5:warning: override: reassigning to symbol AUDIT
arch/arm/configs/selinux_defconfig:13:warning: symbol value 'y' invalid for SECURITY_SELINUX_CHECKREQPROT_VALUE
arch/arm/configs/selinux_defconfig:15:warning: override: reassigning to symbol NF_CONNTRACK_SECMARK
arch/arm/configs/selinux_defconfig:16:warning: override: reassigning to symbol NETFILTER_XT_TARGET_CONNSECMARK
arch/arm/configs/selinux_defconfig:18:warning: override: reassigning to symbol NETFILTER_XT_TARGET_SECMARK
arch/arm/configs/selinux_defconfig:19:warning: override: reassigning to symbol IP_NF_SECURITY
KCONFIG_LOG_SELINUX((null))
KCONFIG_VARIANT(arch/arm/configs/jf_eur_defconfig)
arch/arm/configs/jf_eur_defconfig:4:warning: override: reassigning to symbol FB_MSM_MIPI_SAMSUNG_OCTA_VIDEO_FULL_HD_PT_PANEL
arch/arm/configs/jf_eur_defconfig:5:warning: override: reassigning to symbol LCD_VDD3_BY_PMGPIO
KCONFIG_DEBUG((null))
#
# configuration written to .config
#
root@ciccio-VirtualBox:~/android_kernel_samsung_jf#

And then

root@ciccio-VirtualBox:~/android_kernel_samsung_jf# make
scripts/kconfig/conf --silentoldconfig Kconfig
WRAP arch/arm/include/generated/asm/auxvec.h
WRAP arch/arm/include/generated/asm/bitsperlong.h
WRAP arch/arm/include/generated/asm/cputime.h
WRAP arch/arm/include/generated/asm/emergency-restart.h
WRAP arch/arm/include/generated/asm/errno.h
WRAP arch/arm/include/generated/asm/ioctl.h
WRAP arch/arm/include/generated/asm/irq_regs.h
WRAP arch/arm/include/generated/asm/kdebug.h
WRAP arch/arm/include/generated/asm/local.h
WRAP arch/arm/include/generated/asm/local64.h
WRAP arch/arm/include/generated/asm/percpu.h
WRAP arch/arm/include/generated/asm/poll.h
WRAP arch/arm/include/generated/asm/resource.h
WRAP arch/arm/include/generated/asm/sections.h
WRAP arch/arm/include/generated/asm/siginfo.h
WRAP arch/arm/include/generated/asm/simd.h
WRAP arch/arm/include/generated/asm/sizes.h
WRAP arch/arm/include/generated/asm/unaligned.h
CHK include/generated/uapi/linux/version.h
UPD include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
Generating include/generated/mach-types.h
CC kernel/bounds.s
GEN include/generated/bounds.h
CC arch/arm/kernel/asm-offsets.s
GEN include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
HOSTCC scripts/genksyms/genksyms.o
SHIPPED scripts/genksyms/lex.lex.c
SHIPPED scripts/genksyms/keywords.hash.c
SHIPPED scripts/genksyms/parse.tab.h
HOSTCC scripts/genksyms/lex.lex.o
SHIPPED scripts/genksyms/parse.tab.c
HOSTCC scripts/genksyms/parse.tab.o
HOSTLD scripts/genksyms/genksyms
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/mod/modpost.o
HOSTCC scripts/mod/sumversion.o
HOSTLD scripts/mod/modpost
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/selinux/mdp/mdp
HOSTCC scripts/kallsyms
HOSTCC scripts/conmakehash
HOSTCC scripts/bin2c
CC init/main.o
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
CC init/do_mounts.o
CC init/do_mounts_rd.o
CC init/do_mounts_initrd.o
LD init/mounts.o
CC init/initramfs.o
CC init/calibrate.o
LD init/built-in.o
HOSTCC usr/gen_init_cpio
GEN usr/initramfs_data.cpio
AS usr/initramfs_data.o
LD usr/built-in.o
CC arch/arm/vfp/vfpmodule.o
AS arch/arm/vfp/entry.o
AS arch/arm/vfp/vfphw.o
CC arch/arm/vfp/vfpsingle.o
CC arch/arm/vfp/vfpdouble.o
LD arch/arm/vfp/vfp.o
LD arch/arm/vfp/built-in.o
CC arch/arm/kernel/elf.o
AS arch/arm/kernel/entry-armv.o
AS arch/arm/kernel/entry-common.o
CC arch/arm/kernel/irq.o
CC arch/arm/kernel/opcodes.o
CC arch/arm/kernel/process.o
CC arch/arm/kernel/ptrace.o
CC arch/arm/kernel/return_address.o
CC arch/arm/kernel/sched_clock.o
CC arch/arm/kernel/setup.o
CC arch/arm/kernel/signal.o
CC arch/arm/kernel/stacktrace.o
CC arch/arm/kernel/sys_arm.o
CC arch/arm/kernel/time.o
CC arch/arm/kernel/traps.o
CC arch/arm/kernel/cpuidle.o
CC arch/arm/kernel/armksyms.o
CC arch/arm/kernel/module.o
AS arch/arm/kernel/sleep.o
CC arch/arm/kernel/suspend.o
CC arch/arm/kernel/smp.o
CC arch/arm/kernel/smp_tlb.o
CC arch/arm/kernel/smp_scu.o
CC arch/arm/kernel/unwind.o
CC arch/arm/kernel/swp_emulate.o
CC arch/arm/kernel/hw_breakpoint.o
CC arch/arm/kernel/update_vsyscall_arm.o
CC arch/arm/kernel/pmu.o
CC arch/arm/kernel/perf_event.o
CC arch/arm/kernel/topology.o
CC arch/arm/kernel/io.o
LD arch/arm/kernel/built-in.o
AS arch/arm/kernel/head.o
CC arch/arm/kernel/init_task.o
LDS arch/arm/kernel/vmlinux.lds
CC arch/arm/mm/dma-mapping.o
CC arch/arm/mm/extable.o
CC arch/arm/mm/fault.o
CC arch/arm/mm/init.o
CC arch/arm/mm/iomap.o
CC arch/arm/mm/fault-armv.o
CC arch/arm/mm/flush.o
CC arch/arm/mm/idmap.o
CC arch/arm/mm/ioremap.o
CC arch/arm/mm/mmap.o
CC arch/arm/mm/pgd.o
CC arch/arm/mm/mmu.o
CC arch/arm/mm/vmregion.o
CC arch/arm/mm/proc-syms.o
CC arch/arm/mm/alignment.o
CC arch/arm/mm/highmem.o
AS arch/arm/mm/abort-ev7.o
AS arch/arm/mm/pabort-v7.o
AS arch/arm/mm/cache-v7.o
CC arch/arm/mm/copypage-v6.o
CC arch/arm/mm/context.o
AS arch/arm/mm/tlb-v7.o
AS arch/arm/mm/proc-v7.o
LD arch/arm/mm/built-in.o
CC arch/arm/common/gic.o
CC arch/arm/common/cpaccess.o
LD arch/arm/common/built-in.o
LD arch/arm/net/built-in.o
LD arch/arm/crypto/built-in.o
CC arch/arm/mach-msm/io.o
CC arch/arm/mach-msm/dma.o
CC arch/arm/mach-msm/memory.o
CC arch/arm/mach-msm/timer.o
CC arch/arm/mach-msm/clock.o
CC arch/arm/mach-msm/clock-voter.o
CC arch/arm/mach-msm/clock-dummy.o
CC arch/arm/mach-msm/modem_notifier.o
CC arch/arm/mach-msm/subsystem_map.o
CC arch/arm/mach-msm/acpuclock.o
CC arch/arm/mach-msm/perf_trace_counters.o
arch/arm/mach-msm/perf_trace_counters.c: In function 'tracectr_cpu_hotplug_notifier':
arch/arm/mach-msm/perf_trace_counters.c:32:18: error: 'CPU_TASKS_FROZEN' undeclared (first use in this function)
arch/arm/mach-msm/perf_trace_counters.c:32:18: note: each undeclared identifier is reported only once for each function it appears in
arch/arm/mach-msm/perf_trace_counters.c:32:40: error: 'CPU_STARTING' undeclared (first use in this function)
arch/arm/mach-msm/perf_trace_counters.c: In function 'init_tracecounters':
arch/arm/mach-msm/perf_trace_counters.c:173:2: error: implicit declaration of function 'register_cpu_notifier' [-Werror=implicit-function-declaration]
arch/arm/mach-msm/perf_trace_counters.c: In function 'exit_tracecounters':
arch/arm/mach-msm/perf_trace_counters.c:181:2: error: implicit declaration of function 'unregister_cpu_notifier' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mach-msm/perf_trace_counters.o] Errore 1
make: *** [arch/arm/mach-msm] Errore 2
root@ciccio-VirtualBox:~/android_kernel_samsung_jf#

Is it possible that there is a problem in the kernel source?:confused:

Please can somebody help me?