[Q]building kernel error lg g2 mini - Android Q&A, Help & Troubleshooting

so ive been trying for a couple of days to build my own kernel for our lg g2 mini (d620R) devices since we just unlocked bootloader and got custom recovery. so we need a custom kernel to build custom roms.
ive been trying alot and ive gotten so far i got pass making the .config file and got into the menuconfig and saved it. now im trying to compile the new kernel
and this is what i get.
and i have no clue what to do.
hope someone can help me out.
should be realy great to have custom roms on the lg g2 mini asap
Code:
[email protected]:~/android/kernel/kernel$ make -j4 -Wsizeof-pointer-memaccess ARCH=arm CROSS_COMPILE=arm-linux-androideabi-
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
make[1]: Nothing to be done for `arch/arm/boot/dtbs'.
CHK include/generated/compile.h
CHK kernel/config_data.h
objcopy: '.ihex': No such file
/home/john/android/kernel/kernel/firmware/Makefile:328: target `/home/john/android/kernel/kernel/firmware/melfas/' given more than once in the same rule.
IHEX firmware/atmel/E2A47P1_2_04.fw
IHEX firmware/atmel/E2A47P2_2_04.fw
IHEX firmware/atmel/E4A47P1_2_04.fw
IHEX firmware/atmel/E4A47P2_2_04.fw
IHEX firmware/atmel/E4A47P2_2_05.fw
IHEX firmware/atmel/E7_0210.fw
IHEX firmware/atmel/E7_0214.fw
IHEX firmware/atmel/Jaguar01.fw
IHEX firmware/atmel/Jaguar02.fw
IHEX firmware/atmel/S0A47P1_2_05.fw
IHEX firmware/atmel/S0A47P1_2_06.fw
IHEX firmware/atmel/S0A47P1_2_07.fw
IHEX firmware/atmel/S2A47P1_2_05.fw
IHEX firmware/atmel/S2A47P1_2_06.fw
AS firmware/melfas/mms100a_core54_v01.mfsb.gen.o
AS firmware/atmel/E2A47P1_2_04.fw.gen.o
AS firmware/atmel/E2A47P2_2_04.fw.gen.o
AS firmware/atmel/E4A47P1_2_04.fw.gen.o
AS firmware/atmel/E4A47P2_2_04.fw.gen.o
AS firmware/atmel/E4A47P2_2_05.fw.gen.o
AS firmware/atmel/E7_0210.fw.gen.o
CC net/bluetooth/hci_conn.o
AS firmware/atmel/E7_0214.fw.gen.o
AS firmware/atmel/Jaguar01.fw.gen.o
AS firmware/atmel/Jaguar02.fw.gen.o
AS firmware/atmel/S0A47P1_2_05.fw.gen.o
AS firmware/atmel/S0A47P1_2_06.fw.gen.o
AS firmware/atmel/S0A47P1_2_07.fw.gen.o
AS firmware/atmel/S2A47P1_2_05.fw.gen.o
AS firmware/atmel/S2A47P1_2_06.fw.gen.o
LD firmware/built-in.o
net/bluetooth/hci_conn.c: In function 'hci_le_ltk_reply':
net/bluetooth/hci_conn.c:407:28: warning: argument to 'sizeof' in 'memcpy' call is the same pointer type '__u8 *' as the destination; expected '__u8' or an explicit length [-Wsizeof-pointer-memaccess]
error, forbidden warning: hci_conn.c:407
make[2]: *** [net/bluetooth/hci_conn.o] Error 1
make[1]: *** [net/bluetooth] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [net] Error 2
make: *** Waiting for unfinished jobs....
[email protected]:~/android/kernel/kernel$

Please copy here the line 407 from file net/bluetooth/hci_conn.c
That line does not compile because of argument -Wsizeof-pointer-memaccess in your 'make' command. Try to compile without that argument, or copy the line here, so that we see what needs to be fixed in that line.
Edit:
It seems to be a issue/change in GCC 4.8:
https://gcc.gnu.org/gcc-4.8/porting_to.html

rpul said:
Please copy here the line 407 from file net/bluetooth/hci_conn.c
That line does not compile because of argument -Wsizeof-pointer-memaccess in your 'make' command. Try to compile without that argument, or copy the line here, so that we see what needs to be fixed in that line.
Edit:
It seems to be a issue/change in GCC 4.8:
https://gcc.gnu.org/gcc-4.8/porting_to.html
Click to expand...
Click to collapse
oh thanks. got passed that error though. i use toolchain arm-linux-androideabi-4.9 to compile.
ive tried arm-none-eabi-4.8 and arm-eabi-4.7 the 4.9 seems to work best.
im compiing right at this point ill edit if i get errors again.

Related

[Q] New Kernel Compilation Error ???

I am trying to compile the new kernel and keep getting this error:
Code:
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CC arch/arm/kernel/asm-offsets.s
In file included from include/linux/dma-mapping.h:93,
from arch/arm/kernel/asm-offsets.c:15:
/home/smokin/kernel/arch/arm/include/asm/dma-mapping.h: In function 'dma_cache_post_ops':
/home/smokin/kernel/arch/arm/include/asm/dma-mapping.h:442: error: implicit declaration of function 'arch_has_speculative_dfetch'
make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
I am new to kernel dev and can't seem to track this one down. Anyone know how to fix it ?
smokin1337 said:
I am trying to compile the new kernel and keep getting this error:
Code:
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CC arch/arm/kernel/asm-offsets.s
In file included from include/linux/dma-mapping.h:93,
from arch/arm/kernel/asm-offsets.c:15:
/home/smokin/kernel/arch/arm/include/asm/dma-mapping.h: In function 'dma_cache_post_ops':
/home/smokin/kernel/arch/arm/include/asm/dma-mapping.h:442: error: implicit declaration of function 'arch_has_speculative_dfetch'
make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
I am new to kernel dev and can't seem to track this one down. Anyone know how to fix it ?
Click to expand...
Click to collapse
It is said here in the Forums, that the uploaded Files are corrupted and Not able to be compiled...have to wait until HTC fixes this.
Sent from my HTC EVO 3D X515m using xda premium
smokin1337 said:
I am trying to compile the new kernel and keep getting this error:
Code:
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CC arch/arm/kernel/asm-offsets.s
In file included from include/linux/dma-mapping.h:93,
from arch/arm/kernel/asm-offsets.c:15:
/home/smokin/kernel/arch/arm/include/asm/dma-mapping.h: In function 'dma_cache_post_ops':
/home/smokin/kernel/arch/arm/include/asm/dma-mapping.h:442: error: implicit declaration of function 'arch_has_speculative_dfetch'
make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
I am new to kernel dev and can't seem to track this one down. Anyone know how to fix it ?
Click to expand...
Click to collapse
simple answer: as posted above, if it doesn't compile properly from HTC, as the last kernel release from them also didn't, it probably won't be an *easy* fix.
warning: the technical method i suggest might only lead deeper and deeper, but it is a generally good strategy to research and resolve compiling issues.
technical research method: without having looked at this kernel source or researched the error, i would start searching for the implicit declarion of function 'arch_has_speculative_dfetch' in the dma-mapping.h file at line 442. it should be declared and setup in some file, so i'd grep through the files for it. grep -irs arch_has_speculative_dfetch /home/smokin/kernel/arch/arm/include/asm/*
depending on the results, the grep search might have to be expanded so i'd move up a level. might have a lot of results to search through but it is usually a great learning experience.
as a beginner, i would suggest watching http://github.com/toastcfh as toastcfh does a great job fixing the error laden kernel source code HTC releases. generally, toastcfh's patched kernels are used by all the popular kernel releases and will more than likely be the base kernel used by cm7.
hope that helps!
Thanks !! That helps alot, considering i wasn't sure if i had the toolchain setup right. I appreciate it.
smokin1337 said:
Thanks !! That helps alot, considering i wasn't sure if i had the toolchain setup right. I appreciate it.
Click to expand...
Click to collapse
ah, you didnt mention that before!
if you want to test your toolchain, i'd clone/fork toastcfh's repo for the previous evo 3d kernel release. it should cleanly compile, no issues. that'll be a great test for your toolchain and to give you some confidence in compiling the kernel with *proper* source code.
toastcfh worked some magic to fix htc's last borked kernel release code by pulling files from caf (code aurora forum - code contributor) and probably lots of other complicated coding/compiling tweaks.
hope that helps at least get you ready for the next proper kernel source code!
I took your advice and got toastcfh source and i got the same error with crc. I guess i'm missing something, probably a stupid dependency.
HTC jetstream error
smokin1337 said:
I took your advice and got toastcfh source and i got the same error with crc. I guess i'm missing something, probably a stupid dependency.
Click to expand...
Click to collapse
I am getting same error for htc jetstream source code and i am not able to figure out which toastcfh to use. So can you help me with the same
/puccini_lte_att_wwe_hc-32-crc-2.6.35/arch/arm/include/asm/dma-mapping.h: In function 'dma_cache_post_ops':
/puccini_lte_att_wwe_hc-32-crc-2.6.35/arch/arm/include/asm/dma-mapping.h:442: error: implicit declaration of function 'arch_has_speculative_dfetch'
make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
Can you please let me know how to get the fix for this one.
-Khushboo

[Q] Compile L9 kernel

I have difficulty to compile the L9 kernel. The terminal output "include/lge/lge_blocking_monitor.h: No such file or directory".
Here is the whole compile log:
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
SKIPPED include/generated/compile.h
CC arch/arm/mach-omap2/lge/lge_blocking_monitor.o
arch/arm/mach-omap2/lge/lge_blocking_monitor.c:21:46: error: include/lge/lge_blocking_monitor.h: No such file or directory
make[2]: *** [arch/arm/mach-omap2/lge/lge_blocking_monitor.o] Error 1
make[1]: *** [arch/arm/mach-omap2/lge] Error 2
make: *** [arch/arm/mach-omap2] Error 2
Anyone can give me some help?
amnik said:
I have difficulty to compile the L9 kernel. The terminal output "include/lge/lge_blocking_monitor.h: No such file or directory".
Here is the whole compile log:
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
SKIPPED include/generated/compile.h
CC arch/arm/mach-omap2/lge/lge_blocking_monitor.o
arch/arm/mach-omap2/lge/lge_blocking_monitor.c:21:46: error: include/lge/lge_blocking_monitor.h: No such file or directory
make[2]: *** [arch/arm/mach-omap2/lge/lge_blocking_monitor.o] Error 1
make[1]: *** [arch/arm/mach-omap2/lge] Error 2
make: *** [arch/arm/mach-omap2] Error 2
Anyone can give me some help?
Click to expand...
Click to collapse
Does the file exist? Look into the path mentioned. Which toolchain are you using?
Sent from my LG-P760 using xda app-developers app
N00BY0815 said:
Does the file exist? Look into the path mentioned. Which toolchain are you using?
Sent from my LG-P760 using xda app-developers app
Click to expand...
Click to collapse
Should the path " include/lge/lge_blocking_monitor.h" under kernel or somewhere?
I am following the instruction inside the P760 V20B source.
2. Kernel Build
- Untar using following command at the android folder:
tar xvzf LGP760_JB_Kernel.tar.gz
- change directory to kernel root
cd kernel
- make configuration:
make u2_p760_defconfig ARCH=arm
- make kernel zImage:
make ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- zImage
amnik said:
I have difficulty to compile the L9 kernel. The terminal output "include/lge/lge_blocking_monitor.h: No such file or directory".
Here is the whole compile log:
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
SKIPPED include/generated/compile.h
CC arch/arm/mach-omap2/lge/lge_blocking_monitor.o
arch/arm/mach-omap2/lge/lge_blocking_monitor.c:21:46: error: include/lge/lge_blocking_monitor.h: No such file or directory
make[2]: *** [arch/arm/mach-omap2/lge/lge_blocking_monitor.o] Error 1
make[1]: *** [arch/arm/mach-omap2/lge] Error 2
make: *** [arch/arm/mach-omap2] Error 2
Anyone can give me some help?
Click to expand...
Click to collapse
Edit files that give you errors like leg_blocking_monitor.c
Lookup "include/lge/lge_blocking_monitor.h"
and change that to "../include/lge/lge_blocking_monitor.h" or it may be ../../
Several files will have to be modified
edit : #include <../include/lge/lge_blocking_monitor.h>

Syntax error after repo sync

Hey,
I'm struggling with syntax error after last repo sync of CM11. I didn't have this problem before:
[...]
Using /home/lozohcum/CM11/kernel/sony/msm7x27a as source for kernel
GEN /home/lozohcum/CM11/out/target/product/jlo/obj/KERNEL_OBJ/Makefile
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[3]: `include/generated/mach-types.h' is up to date.
/bin/sh: Syntax error: "(" unexpected
make[3]: *** [kernel/bounds.s] Error 2
make[2]: *** [prepare0] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Opuszczenie katalogu `/home/lozohcum/CM11/kernel/sony/msm7x27a'
make: *** [TARGET_KERNEL_BINARIES] Error 2
[email protected]:~/CM11$
Click to expand...
Click to collapse
do you know where is the fine which causes syntax error? I understand that there is randomly added "(" but dunno where I can find it.
Solved:
I was using linaro-4.7-13.04 toolchain to build kernel and that caused the problem.
Can you only explain me why? I want to use linaro toolchains for whole rom

First time compiling kernel with a governor and I got errors.

I am trying to compile a kernel for my device(kyleprods or GT-S7582 or Galaxy S duos 2) because I havent found any custom kernel out here. Im compiling from source. I tried compiling WITHOUT any tweaks or such, just plain compile after downloading the source, and it compiled successfully. I tried adding smartassv2 but I got these errors after running "make -j1" twice. Can anybody help/guide me? It is really my first time doing these things, because I'm very interested.
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
Creating rdb link for Hawaii
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CHK kernel/config_data.h
CC drivers/cpufreq/cpufreq_smartass2.o
drivers/cpufreq/cpufreq_smartass2.c:175:10: error: ‘THIS_MODULE’ undeclared here (not in a function)
.owner = THIS_MODULE,
^
drivers/cpufreq/cpufreq_smartass2.c: In function ‘cpufreq_smartass_timer’:
drivers/cpufreq/cpufreq_smartass2.c:295:1: error: implicit declaration of function ‘cputime64_sub’ [-Werror=implicit-function-declaration]
delta_idle = cputime64_sub(now_idle, this_smartass->time_in_idle);
^
drivers/cpufreq/cpufreq_smartass2.c: At top level:
drivers/cpufreq/cpufreq_smartass2.c:869:16: error: expected declaration specifiers or ‘...’ before string constant
MODULE_AUTHOR ("Erasmux");
^
drivers/cpufreq/cpufreq_smartass2.c:870:21: error: expected declaration specifiers or ‘...’ before string constant
MODULE_DESCRIPTION ("'cpufreq_smartass2' - A smart cpufreq governor");
^
drivers/cpufreq/cpufreq_smartass2.c:871:17: error: expected declaration specifiers or ‘...’ before string constant
MODULE_LICENSE ("GPL");
^
cc1: some warnings being treated as errors
make[2]: *** [drivers/cpufreq/cpufreq_smartass2.o] Error 1
make[1]: *** [drivers/cpufreq] Error 2
make: *** [drivers] Error 2
SORRY I DONT KNOW WHERE TO POST.
diskie said:
I am trying to compile a kernel for my device(kyleprods or GT-S7582 or Galaxy S duos 2) because I havent found any custom kernel out here. Im compiling from source. I tried compiling WITHOUT any tweaks or such, just plain compile after downloading the source, and it compiled successfully. I tried adding smartassv2 but I got these errors after running "make -j1" twice. Can anybody help/guide me? It is really my first time doing these things, because I'm very interested.
-snip-
Click to expand...
Click to collapse
Part of the errors can be fixed by adding:
#include <linux/module.h>
at the top. I don't know about the rest, but @xpirt or @InfinityShooter once fixed this problem for the desire x, perhaps he can help? I want to know it myself as well
@diskie
https://github.com/ProtoU/neXusKERNEL/commit/8c77e8a4b1962bb6fbb41732aba5ded40007876a
Look in drivers/cpufreq/cpufreq_ondemand.c and include/linux/cpufreq.h for fix
xpirt
xpirt said:
@diskie
https://github.com/ProtoU/neXusKERNEL/commit/8c77e8a4b1962bb6fbb41732aba5ded40007876a
Look in drivers/cpufreq/cpufreq_ondemand.c and include/linux/cpufreq.h for fix
xpirt
Click to expand...
Click to collapse
Thanks a lot :good:

Help compiling my first kernel

I've been trying to build a modified kernel and decided to start out by building the kernel I'm currently using on my device from the dev's github.
without modifying anything, I followed this guide: http://forum.xda-developers.com/android/software/ultimate-guide-compile-android-kernel-t2871276
I get to the point where I type "make -j<cores>"(in step 6) and I get this:
Code:
[email protected]:~/android/kernel# make
make: /root/android/kernel/arm-eabi-4.4.3/bin/arm-eabi-gcc: Command not found
scripts/kconfig/conf --silentoldconfig Kconfig
make: /root/android/kernel/arm-eabi-4.4.3/bin/arm-eabi-gcc: Command not found
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
/bin/sh: 1: /root/android/kernel/arm-eabi-4.4.3/bin/arm-eabi-gcc: not found
/root/android/kernel/./Kbuild:35: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 127
Makefile:958: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
I dont know what I'm doing wrong, I've tried compiling with Kali Linux and Ubuntu.
I just can't get past this part.
Eventually I want to replace the wifi drivers with a modified one to allow the device to enter monitor mode.
Could someone please help?
Thank you.

Categories

Resources