Got errors while compiling Android kernel - android

I wanted to enable KVM on the kernel I use, reached to the kernel source and enabled KVM by adding some lines to defconfig file. But whenever I want to compile, I got these error messages. I could not fix that. Could someone help me please?
C arch/arm64/kvm/../../../virt/kvm/vfio.o
CC arch/arm64/kvm/../../../arch/arm/kvm/arm.o
CC arch/arm64/kvm/../../../arch/arm/kvm/mmu.o
AS arch/arm64/crypto/poly-hash-ce-core.o
CC arch/arm64/crypto/aes-ce-cipher.o
CC arch/arm64/mm/flush.o
In file included from ../arch/arm64/kvm/../../../arch/arm/kvm/arm.c:42:
../arch/arm64/include/asm/kvm_mmu.h:309:70: error: too few arguments to function call, expected 3, have 2
return (cpuid_feature_extract_field(reg, ID_AA64MMFR1_VMIDBITS_SHIFT) == 2) ? 16 : 8;
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
make[2]: *** [../scripts/Makefile.build:285: arch/arm64/kvm/../../../arch/arm/kvm/arm.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CC arch/arm64/crypto/aes-ce-ccm-glue.o
In file included from ../arch/arm64/kvm/../../../arch/arm/kvm/mmu.c:27:
../arch/arm64/include/asm/kvm_mmu.h:309:70: error: too few arguments to function call, expected 3, have 2
return (cpuid_feature_extract_field(reg, ID_AA64MMFR1_VMIDBITS_SHIFT) == 2) ? 16 : 8;
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
make[2]: *** [../scripts/Makefile.build:285: arch/arm64/kvm/../../../arch/arm/kvm/mmu.o] Error 1
AS arch/arm64/crypto/aes-ce-ccm-core.o
CC arch/arm64/crypto/aes-glue-ce.o
make[1]: *** [/home/gorkemoji/android/kernel/Makefile:1034: arch/arm64/kvm] Error 2
make[1]: *** Waiting for unfinished jobs....

Related

How to build LibVLC for Android

I am trying to compile the libVLC so that I can use the VLC library for RTSP viewing on Android TV.
Here are the logs from the current execution.
libmysofa-0.5.tar.gz: OK337175/396660)
touch .sum-mysofa
2 6090k 2 172k 0 0 11160 0 0:09:18 0:00:15 0:09:03 0
curl: (18) transfer closed with 6059638 bytes remaining to read
make: *** [../../contrib/tarballs/libarchive-3.3.2.tar.gz] Error 18
make: *** Deleting file `../../contrib/tarballs/libarchive-3.3.2.tar.gz'
make: *** Waiting for unfinished jobs....
Resolving deltas: 100% (396660/396660), done.
From http://git.videolan.org/git/ffmpeg
* branch HEAD -> FETCH_HEAD
contribs: make fetch failed

Error "function 'nop'" when building android kernel

I am making the android kernel for the first time and after few errors(which I have overcome) I am getting below error log:
casual#Casual-PC:/media/casual/USB/android_kernel_yotaphone2-DKernel$
make O=../out -j4
GEN /media/casual/USB/out/Makefile
CHK include/linux/version.h
Using /media/casual/USB/android_kernel_yotaphone2-DKernel as source for kernel
CHK include/generated/utsrelease.h
make[2]: «include/generated/mach-types.h» не требует обновления. (dont need update)
CC arch/arm/kernel/asm-offsets.s
GEN include/generated/asm-offsets.h
CALL /media/casual/USB/android_kernel_yotaphone2- DKernel/scripts/checksyscalls.sh
CC arch/arm/common/vic.o
CC arch/arm/mm/dma-mapping.o
CC init/main.o
CC arch/arm/common/timer-sp.o
AS arch/arm/kernel/entry-armv.o
AS arch/arm/kernel/entry-common.o
LD arch/arm/common/built-in.o
CHK include/generated/compile.h
CC arch/arm/kernel/process.o
CC arch/arm/mm/init.o
LD arch/arm/net/built-in.o
CC arch/arm/kernel/ptrace.o
CC init/do_mounts.o
CC init/do_mounts_rd.o
/media/casual/USB/android_kernel_yotaphone2-DKernel/arch/arm/mm/init.c: In function 'mem_init':
/media/casual/USB/android_kernel_yotaphone2-DKernel/arch/arm/mm/init.c:921:6: warning: format '%d' expects argument of
type 'int', but argument 7 has type 'long int' [-Wformat]
error, forbidden warning: init.c:921
/media/casual/USB/android_kernel_yotaphone2-DKernel/scripts/Makefile.build:307: recipe for target 'arch/arm/mm/init.o' failed
make[2]: *** [arch/arm/mm/init.o] Error 1
/media/casual/USB/android_kernel_yotaphone2-DKernel/Makefile:957: recipe for target 'arch/arm/mm' failed
make[1]: *** [arch/arm/mm] Error 2
make[1]: *** Ожидание завершения заданий…
CC arch/arm/kernel/sched_clock.o
CC init/do_mounts_initrd.o
CC init/do_mounts_md.o
CC arch/arm/kernel/signal.o
CC arch/arm/kernel/armksyms.o
CC arch/arm/kernel/bios32.o
LD init/mounts.o
LD init/built-in.o
CC arch/arm/kernel/isa.o
AS arch/arm/kernel/sleep.o
CC arch/arm/kernel/machine_kexec.o
CC arch/arm/kernel/io.o
CC arch/arm/kernel/crash_dump.o
/media/casual/USB/android_kernel_yotaphone2-DKernel/arch/arm/kernel/io.c: In function '_memcpy_fromio':
/media/casual/USB/android_kernel_yotaphone2-DKernel/arch/arm/kernel/io.c:14:3: error: implicit declaration of function 'nop' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
/media/casual/USB/android_kernel_yotaphone2-DKernel/scripts/Makefile.build:307: recipe for target 'arch/arm/kernel/io.o' failed
make[2]: *** [arch/arm/kernel/io.o] Error 1
make[2]: *** Ожидание завершения заданий…
/media/casual/USB/android_kernel_yotaphone2-DKernel/Makefile:957: recipe for target 'arch/arm/kernel' failed
make[1]: *** [arch/arm/kernel] Error 2
Makefile:130: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
(sry for bad code blocks)
So, I have found similar questions, but I didn't understand the answer:
android kernel build (first time)
when i make it throw
`LC_ALL=C make O=../out`
it gives me(spoiler - LC_ALL=C don't work how i thought, so i translated it(as #) by myself):
casual#Casual-PC:/media/casual/USB/android_kernel_yotaphone2-DKernel$ LC_ALL=C make O=../out
Using /media/casual/USB/android_kernel_yotaphone2-DKernel as source for kernel
GEN /media/casual/USB/out/Makefile
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[2]: «include/generated/mach-types.h» не требует обновления. #dont need updates
CALL /media/casual/USB/android_kernel_yotaphone2-DKernel/scripts/checksyscalls.sh
CHK include/generated/compile.h
CC arch/arm/kernel/io.o
/media/casual/USB/android_kernel_yotaphone2-DKernel/arch/arm/kernel/io.c: In function '_memcpy_fromio':
/media/casual/USB/android_kernel_yotaphone2-DKernel/arch/arm/kernel/io.c:14:3: error: implicit declaration of function 'nop' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
/media/casual/USB/android_kernel_yotaphone2-DKernel/scripts/Makefile.build:307: recipe for target 'arch/arm/kernel/io.o' failed
make[2]: *** [arch/arm/kernel/io.o] Error 1
/media/casual/USB/android_kernel_yotaphone2-DKernel/Makefile:957: recipe for target 'arch/arm/kernel' failed
make[1]: *** [arch/arm/kernel] Error 2
Makefile:130: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

kernel build failed due to .config

I'm trying to build an Android kernel for the arm architecture, but it fails all the time and it gives me this error:
Using /home/build/tommolini_android/omap-android-kernel as source for kernel
/home/build/tommolini_android/omap-android-kernel is not clean, please run 'make mrproper'
in the '/home/build/tommolini_android/omap-android-kernel' directory.
make[1]: *** [prepare3] Error 1
make[1]: *** Waiting for unfinished jobs....
HOSTLD scripts/mod/modpost
make[1]: *** wait: No child processes. Stop.
make: *** [sub-make] Error 2
If I run make mrproper inside that directory and do again make ARCH=arm -j8 it says that it doesn't find .config file:
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[3]: *** [silentoldconfig] Error 1
make[2]: *** [silentoldconfig] Error 2
make[1]: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'. Stop.
make: *** [sub-make] Error 2
The commands I execute are:
make ARCH=arm distclean
make ARCH=arm platformX4_defconfig
make ARCH=arm -j8
How can I solve this problem? Any ideas?

Android 7.1.1 kernel compile errors (tool chain)

The build environment is ubuntu 16.04 with latest gcc 5.4.0 and GNU Make 3.82. My target is an am335x custom board which can run android 4.4. I am going to support it for android 7.1.1.
The project is fetched from google android manifest tag android-7.1.1_r46 and the kernel is from msm tag android-7.1.1_r0.63. The cross compiler I am using is from prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin.
That is the environment information. I haven't installed the NDK or SDK yet because I saw the api level for android 7.1.1 is 25 while the newest NDK only support up to 24, so I get a bit confused what to do.
If I run the command: m -j8 uboot linux
The uboot compiles fine, but there are a lot of errors when compiling the linux kernel.
/media/yangjiel/disk2/android/kernel/arch/arm/mach-omap2/prm_common.c: In function 'omap_prcm_register_chain_handler':
/media/yangjiel/disk2/android/kernel/arch/arm/mach-omap2/prm_common.c:293:2: warning: passing argument 2 of 'irq_set_chained_handler' from incompatible pointer type [enabled by default]
error, forbidden warning: prm_common.c:293
make[2]: *** [arch/arm/mach-omap2/prm_common.o] Error 1
make[1]: *** [arch/arm/mach-omap2] Error 2
make[1]: *** Waiting for unfinished jobs....
/media/yangjiel/disk2/android/kernel/kernel/sysctl_binary.c:141:13: error: 'KERN_BOOT_REASON' undeclared here (not in a function)
{ CTL_INT, KERN_BOOT_REASON, "boot_reason" },
^
/media/yangjiel/disk2/android/kernel/kernel/sysctl_binary.c:528:13: error: 'NET_IPV6_ACCEPT_RA_PREFIX_ROUTE' undeclared here (not in a function)
{ CTL_INT, NET_IPV6_ACCEPT_RA_PREFIX_ROUTE, "accept_ra_prefix_route" },
^
/media/yangjiel/disk2/android/kernel/kernel/sysctl_binary.c:528:2: error: initializer element is not constant
{ CTL_INT, NET_IPV6_ACCEPT_RA_PREFIX_ROUTE, "accept_ra_prefix_route" },
^
/media/yangjiel/disk2/android/kernel/kernel/sysctl_binary.c:528:2: error: (near initialization for 'bin_net_ipv6_conf_var_table[24].ctl_name')
make[2]: *** [kernel/sysctl_binary.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [kernel] Error 2
make: *** [sub-make] Error 2
make: Leaving directory `/media/yangjiel/disk2/android/kernel'
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
make: Leaving directory `/media/yangjiel/disk2/android'
If I drop the lines in that file which causing this error, the error above is resolved but I would get another
/media/yangjiel/disk2/android/kernel/kernel/cgroup.c: In function 'subsys_cgroup_allow_attach':
/media/yangjiel/disk2/android/kernel/kernel/cgroup.c:2138:37: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
if (current != task && cred->euid != tcred->uid &&
^
/media/yangjiel/disk2/android/kernel/kernel/cgroup.c:2139:18: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
cred->euid != tcred->suid)
^
make[2]: *** [kernel/cgroup.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CC kernel/trace/power-traces.o
CC kernel/trace/rpm-traces.o
CC kernel/trace/trace_probe.o
LD kernel/trace/libftrace.o
LD kernel/trace/built-in.o
make[1]: *** [kernel] Error 2
make: *** [sub-make] Error 2
make: Leaving directory `/media/yangjiel/disk2/android/kernel'
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
make: Leaving directory `/media/yangjiel/disk2/android'
There are more errors behind.
I have googled around and most of the people say this is a tool chain problem. But I don't find a lot of instruction about how to install the tool chain properly especially for 7.1.1. There seems to be no tool chain needed for the android 4.4 kernel. I fetch the custom android 4.4 kernel and it compiles fine.
The problem above is because I downloaded a wrong version of Android kernel. What I downloaded is https://android.googlesource.com/kernel/msm/+/android-7.1.1_r0.63, and this is kernel v3.10.
Obviously this is not for Android 7.1.1 (which should be using kernel v4.4). So when I am trying to compile "old" kernel with the "new" cross compiler from the prebuilt, it generated whole bunch errors that the "old" compiler won't. I end up using the kernel from https://android.googlesource.com/kernel/common/+/upstream-linux-4.4.y upstream-linux-4.4.y branch, it is compatible with Android 7.0 to 7.1.2.
I have no idea why google name it as android-7.1.1_r0.63, but that definitely not for Android 7.1.1 to use. Hope nobody has the same problem as I did.

Syntax error: Unterminated quoted string [Makefile]

Not able to find the problem:
make PLATFORM=android
make[2]: Entering directory `/home/debian/Downloads/nonemaioq3'
CC code/client/cl_cgame.c
/prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: 4: /prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Syntax error: Unterminated quoted string
make[2]: *** [build/release-android-arm/client/cl_cgame.o] Error 2
make[2]: Leaving directory `/home/debian/Downloads/nonemaioq3'
make[1]: *** [targets] Error 2
make[1]: Leaving directory `/home/debian/Downloads/nonemaioq3'
make: *** [release] Error 2
and this is the Makefile I got:
http://pastebin.com/QYZYVvTn
I don't find any problem there :S Help please.
The line
CC code/client/cl_cgame.c
starts the compiler (C Compiler or CC). The error message is after the CC and doesn't start with make, so it relates to the compiler, not the Makefile.
/prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: 4: /prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Syntax error: Unterminated quoted string
gcc is the GNU C compiler. The error is in the file /prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc, on line 4.
In view of your comment, "arm-linux" means that version of GCC is meant to run on ARM processors. If you are running this on a PC, you want a gcc with "x86" or "x64" in place of "arm." That would be a cross-compiling situation; see here for links on how to set that up.

Categories

Resources