[Q] Driver error while compiling kernel - LG G2 Mini

So guys, I've tried to build my own kernel from johns github sources based on his kool-aid kernel. This happens with the msm8226_defconfig makefile
So I got my sources synced set up this linaro toolchain https://github.com/Christopher83/arm-cortex_a7-linux-gnueabihf-linaro_4.9, got the path set up in bashrc
Code:
#Android Toolchain PATH
export ARCH=arm
export CCOMPILE=$CROSS_COMPILE
export CROSS_COMPILE=arm-cortex_a7-linux-gnueabihf
export PATH=$PATH:/home/steffen/toolchain/bin"
When running
Code:
make ARCH=arm CROSS_COMPILE=arm-cortex_a7-linux-gnueabihf-
It starts compiling and everything seems fine, when it gets to this last part
Code:
CC [M] drivers/mmc/card/mmc_block_test.o
CC drivers/mmc/core/core.o
CC drivers/mmc/core/bus.o
CC drivers/mmc/core/host.o
CC drivers/mmc/core/mmc.o
drivers/mmc/core/mmc.c:1869:12: warning: initialization from incompatible pointer type
error, forbidden warning: mmc.c:1869
make[3]: *** [drivers/mmc/core/mmc.o] Error 1
make[2]: *** [drivers/mmc/core] Error 2
make[1]: *** [drivers/mmc] Error 2
make: *** [drivers] Error 2
It seems to run into a problem with the drivers, tried searching up on the
Code:
drivers/mmc/core/mmc.c:1869:12: warning: initialization from incompatible pointer type
error
part, and only thing actually coming up has been some pastebins etc with the same error log as I got (almost), hoped someone could help out with this?
Also when I try using the g2m_global_com_defconfig instead, I get this at the end
Code:
AR lib/lib.a
LD vmlinux.o
MODPOST vmlinux.o
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
LD .tmp_vmlinux1
drivers/built-in.o: In function `video_open':
/home/steffen/kernel_lge_msm8226_g2m/drivers/media/radio/radio-iris.c:5083: undefined reference to `hci_fm_smd_register'
drivers/built-in.o: In function `iris_remove':
/home/steffen/kernel_lge_msm8226_g2m/drivers/media/radio/radio-iris.c:5219: undefined reference to `hci_fm_smd_deregister'
make: *** [.tmp_vmlinux1] Error 1
[email protected]:~/kernel_lge_msm8226_g2m$
Help anyone?

Sorry for this post, got it fixed myself anyways
Sent from my LG-D620 using xda Forum

steffenbakke said:
Sorry for this post, got it fixed myself anyways
Sent from my LG-D620 using xda Forum
Click to expand...
Click to collapse
How you fix it????

Related

[Q] Trouble trying to compile the DNA kernel

Hi guys,
I've really been having a hard time trying to compile a kernel for the Droid DNA. I've downloaded the kernel source from the HTC dev site, and within the download there is a readme which suggests to download this toolchain "git clone https://android.googlesource.com/platform/prebuilt." I have tried the toolchains included in this, but they never finish the compiling process. It's weird because it looks like it is processing nicely, and even runs for several minutes, but it just stops abrubtly and does not produce the zimage. I have also tried toolchains from the official Android NDK and even a custom one I found, with no luck. Most of the other toolchains just crap out with a bunch of errors, which looks like it is missing some library files, so I don't know what to do there.
Do you actually need to install the toolchain somehow, or can you just do an export CROSS_COMPILE=~/toolchain/bin/arm-linux-androideabi- to handle this? I would be more than greatful to get any sort of assistance with this, as it is starting to drive me nuts! lol. I also uploaded some of the errors and final output from my last compile.
stevedub40 said:
Hi guys,
I've really been having a hard time trying to compile a kernel for the Droid DNA. I've downloaded the kernel source from the HTC dev site, and within the download there is a readme which suggests to download this toolchain "git clone https://android.googlesource.com/platform/prebuilt." I have tried the toolchains included in this, but they never finish the compiling process. It's weird because it looks like it is processing nicely, and even runs for several minutes, but it just stops abrubtly and does not produce the zimage. I have also tried toolchains from the official Android NDK and even a custom one I found, with no luck. Most of the other toolchains just crap out with a bunch of errors, which looks like it is missing some library files, so I don't know what to do there.
Do you actually need to install the toolchain somehow, or can you just do an export CROSS_COMPILE=~/toolchain/bin/arm-linux-androideabi- to handle this? I would be more than greatful to get any sort of assistance with this, as it is starting to drive me nuts! lol. I also uploaded some of the errors and final output from my last compile.
Click to expand...
Click to collapse
Hmm, it doesn't look like my file uploaded. Here it is in code tags:
Code:
net/netfilter/xt_mark.c:16:37: error: linux/netfilter/xt_mark.h: No such file or directory
net/netfilter/xt_mark.c: In function 'mark_tg':
net/netfilter/xt_mark.c:32: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c:32: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c: In function 'mark_mt':
net/netfilter/xt_mark.c:41: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c:41: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c:41: error: dereferencing pointer to incomplete type
net/netfilter/xt_mark.c: At top level:
net/netfilter/xt_mark.c:49: error: invalid application of 'sizeof' to incomplete type 'struct xt_mark_tginfo2'
net/netfilter/xt_mark.c:58: error: invalid application of 'sizeof' to incomplete type 'struct xt_mark_mtinfo1'
make[2]: *** [net/netfilter/xt_mark.o] Error 1
make[1]: *** [net/netfilter] Error 2
make[1]: *** Waiting for unfinished jobs....
drivers/mfd/pm8921-core.c:211: error: resources_pwrkey causes a section type conflict
drivers/mfd/pm8921-core.c:211: error: resources_pwrkey causes a section type conflict
drivers/mfd/pm8921-core.c:165: error: adc_cell_resources causes a section type conflict
drivers/mfd/pm8921-core.c:165: error: adc_cell_resources causes a section type conflict
make[2]: *** [drivers/mfd/pm8921-core.o] Error 1
make[1]: *** [drivers/mfd] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [net] Error 2
make: *** Waiting for unfinished jobs....
CC drivers/media/video/msm/wfd/enc-subdev.o
CC drivers/media/video/msm/sensors/imx175_v4l2.o
CC drivers/media/video/msm/sensors/ov8838_v4l2.o
CC drivers/media/video/msm/sensors/s5k3h2yx_v4l2.o
CC drivers/media/video/msm/rawchip/Yushan_Platform_Specific.o
CC drivers/media/video/msm/wfd/vsg-subdev.o
CC drivers/media/video/msm/msm_gesture.o
CC drivers/media/video/msm/rawchip/Yushan_HTC_Functions.o
CC drivers/media/video/msm/sensors/ar0260_v4l2.o
CC drivers/media/video/msm/wfd/wfd-ioctl.o
CC drivers/media/video/msm/msm_axi_qos.o
CC drivers/media/video/msm/sensors/s5k3l1yx.o
CC drivers/media/video/msm/flash.o
CC drivers/media/video/msm/sensors/ov2722_v4l2.o
CC drivers/media/video/msm/wfd/wfd-util.o
CC drivers/media/video/msm/msm_io_8960.o
LD drivers/media/video/msm/sensors/built-in.o
CC drivers/media/video/msm/msm_vfe32.o
CC drivers/media/video/msm/rawchip/yushan_reg.o
LD drivers/media/video/msm/wfd/built-in.o
CC drivers/media/video/msm/msm_vpe.o
CC drivers/media/video/msm/rawchip/yushan_u_code_r2.o
CC drivers/media/video/msm/rawchip/yushan_u_code_r3.o
CC drivers/media/video/msm/rawchip/yushan_reg_s5k3h2yx.o
CC drivers/media/video/msm/rawchip/yushan_reg_imx175.o
CC drivers/media/video/msm/rawchip/yushan_reg_ov8838.o
CC drivers/media/video/msm/rawchip/yushan_reg_ar0260.o
CC drivers/media/video/msm/rawchip/yushan_reg_ov2722.o
LD drivers/media/video/msm/rawchip/built-in.o
LD drivers/media/video/msm/built-in.o
LD drivers/media/video/videodev.o
LD drivers/media/video/built-in.o
LD drivers/media/built-in.o
make: *** [drivers] Error 2
[email protected] ~/android/kernel/linux $
Talk to DSB9938 or Elkay, they work on kernels for our phone.
orangechoochoo said:
Talk to DSB9938 or Elkay, they work on kernels for our phone.
Click to expand...
Click to collapse
Will do. Thanks for the reply.
Alright, I have discovered my problem. It looks like I was in fact missing the xt_mark.h file. For some reason, the HTC kernel source only includes xt_MARK.h. I downloaded the kernel source for the Nexus 4 and pulled the necessary header files. I was missing a couple others, which I don't recall off hand. What has me baffled is that I seem to be the only one with this issue. I downloaded the HTC source again just to make sure, and just as I suspected it was missing some header files. Has anyone else experienced this?
EDIT: I just tested with a couple different toolchains and they all compile perfectly now. That is so strange that my problem this whole time has been missing header files from HTC.

Kernel Compiling Error

Code:
CC net/netfilter/xt_qtaguid.o
CC net/netfilter/xt_quota.o
CC net/netfilter/xt_quota2.o
CC net/netfilter/xt_socket.o
In file included from include/linux/kernel.h:23:0,
from include/linux/cache.h:4,
from include/linux/time.h:7,
from include/linux/stat.h:60,
from include/linux/module.h:10,
from net/netfilter/xt_socket.c:13:
net/netfilter/xt_socket.c: In function 'xt_socket_get4_sk':
include/linux/dynamic_debug.h:75:21: warning: 'protocol' may be used uninitialized in this function [-Wmaybe-uninitialized]
error, forbidden warning: dynamic_debug.h:75
make[2]: *** [net/netfilter/xt_socket.o] Error 1
make[1]: *** [net/netfilter] Error 2
make: *** [net] Error 2
[email protected]:~/kernel$
Original file here.
I'm using ndk gcc 4.8. This error is present also on gcc 4.7. The only way to get rid of this error is to use toolchain 4.6. I need to compile it using a newer toolchain, that's why I request your help.
Any ideas?
Kernel Compilation
srsdani said:
Code:
CC net/netfilter/xt_qtaguid.o
CC net/netfilter/xt_quota.o
CC net/netfilter/xt_quota2.o
CC net/netfilter/xt_socket.o
In file included from include/linux/kernel.h:23:0,
from include/linux/cache.h:4,
from include/linux/time.h:7,
from include/linux/stat.h:60,
from include/linux/module.h:10,
from net/netfilter/xt_socket.c:13:
net/netfilter/xt_socket.c: In function 'xt_socket_get4_sk':
include/linux/dynamic_debug.h:75:21: warning: 'protocol' may be used uninitialized in this function [-Wmaybe-uninitialized]
error, forbidden warning: dynamic_debug.h:75
make[2]: *** [net/netfilter/xt_socket.o] Error 1
make[1]: *** [net/netfilter] Error 2
make: *** [net] Error 2
[email protected]:~/kernel$
Original file here.
I'm using ndk gcc 4.8. This error is present also on gcc 4.7. The only way to get rid of this error is to use toolchain 4.6. I need to compile it using a newer toolchain, that's why I request your help.
Click to expand...
Click to collapse
I guess you are looking on another file.
Code:
error, forbidden warning: dynamic_debug.h:75
I guess there is a problem in dynamic_debug.h in line 75. I guess you need to initialise something.
Here is dynamic_debug.h but I can't find the problem.
I will appreciate any opinion.
Try this method!
srsdani said:
Here is dynamic_debug.h but I can't find the problem.
Click to expand...
Click to collapse
I am not much used to kernel related development but I analysed your dynamic_debug.h and found the problem (maybe a problem):
Normally, a do-while loop syntax is this:
Code:
do
{
Statement1;
Statement2;
...
}while(condition);
But I don't see a semicolon in the end of those loops in your code. This maybe a syntax error.
Also analyse these codes:
Code:
#if defined(CONFIG_DYNAMIC_DEBUG)
extern int ddebug_remove_module(const char *mod_name);
extern __printf(2, 3)
int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...);
struct device;
extern __printf(3, 4)
int __dynamic_dev_dbg(struct _ddebug *descriptor, const struct device *dev,
const char *fmt, ...);
struct net_device;
extern __printf(3, 4)
int __dynamic_netdev_dbg(struct _ddebug *descriptor,
const struct net_device *dev,
const char *fmt, ...);
Every intialisation has 4 protocols but the first initialisation contain only 3.
Try the above things and tell me back if it works or not.
So, the problem was in Makefile and .config. I compared and added some flags from Mako (from franco) and it worked. I still have some warning/s, some breakpoints but at least now it's working. Anyway, this thread may be useful for all of us. Thanks a lot for help.
Now, another problem.
Code:
CC fs/proc/loadavg.o
CC fs/proc/meminfo.o
fs/proc/meminfo.c: In function ‘meminfo_proc_show’:
fs/proc/meminfo.c:175:1: internal compiler error: in optimize_sc, at modulo-sched.c:1069
}
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.launchpad.net/gcc-linaro> for instructions.
make[2]: *** [fs/proc/meminfo.o] Error 1
make[1]: *** [fs/proc] Error 2
make: *** [fs] Error 2
[email protected]:~/kernel2$
With linaro 4.8.3 => OK;
linaro 4.8.3 + A15 optimize=> fail, error above. meminfo.c it's exactly like the one from nexus 4.
FIX: compiler bug;
srsdani said:
Code:
CC net/netfilter/xt_qtaguid.o
CC net/netfilter/xt_quota.o
CC net/netfilter/xt_quota2.o
CC net/netfilter/xt_socket.o
In file included from include/linux/kernel.h:23:0,
from include/linux/cache.h:4,
from include/linux/time.h:7,
from include/linux/stat.h:60,
from include/linux/module.h:10,
from net/netfilter/xt_socket.c:13:
net/netfilter/xt_socket.c: In function 'xt_socket_get4_sk':
include/linux/dynamic_debug.h:75:21: warning: 'protocol' may be used uninitialized in this function [-Wmaybe-uninitialized]
error, forbidden warning: dynamic_debug.h:75
make[2]: *** [net/netfilter/xt_socket.o] Error 1
make[1]: *** [net/netfilter] Error 2
make: *** [net] Error 2
[email protected]:~/kernel$
Original file here.
I'm using ndk gcc 4.8. This error is present also on gcc 4.7. The only way to get rid of this error is to use toolchain 4.6. I need to compile it using a newer toolchain, that's why I request your help.
Click to expand...
Click to collapse
Hey sarsdani Apologies that I'm quoting you 12 month later. I am getting an identical error in the same file/address as you had when you posted this question. Im compiling stock HTC m7 Android L kernel with Google tool chain 4.8 - android 5.1 r1
You mentioned later on that you changed the Makefile and .config to fix the [-Wmaybe-uninitialized] error. Can you please detail what those changes were or point me to an example ( if you can remember ) I could just change Wmaybe in Makefile to Wno but turning the flag off altogether seems dangerous.
@Joeisgood99 there are two ways to solve this.
1. using a "hack". So, you need to add in makefile (in root folder from kernel source) at KBUILD_CFLAGS: -Wno-maybe-uninitialized \
2. Open that file with the error and asign a value to protocol.
The first option is not dangerous. Why? Because only the toolchain say this. In gcc 4.6, the reason why you don't get this error is because it assign a value automatically to that "protocol", usualy random value but not always. In gcc 4.7/4.8/4.9(or 4.10) this is threated as warning/error.
/home/austin/cm11/kernel/lge/w3c/net/ipv4/ipconfig.c:264: undefined reference to `msecs_to_jiffies'
/home/austin/cm11/kernel/lge/w3c/Makefile:877: recipe for target '.tmp_vmlinux1' failed
make[2]: *** [.tmp_vmlinux1] Error 1
Makefile:130: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory '/home/austin/cm11/kernel/lge/w3c'
build/core/tasks/kernel.mk:188: recipe for target 'TARGET_KERNEL_BINARIES' failed
make: *** [TARGET_KERNEL_BINARIES] Error 2
Any ideas what this could be? I'm a bit stumped i've never seen an error like this before
It's okay i retired the project as of now since trying to modify the kernel source code isn't do anything but causing more errors. I do appreciate any help when everyone has a chance

[Q] Developers: Trouble Compiling CM11 Kernel

So I've done some work on boot images before, but not much, and I wanted to try building a kernel for AOSP KitKat on the EVO 4G LTE. (Why not Lollipop? Data and roaming issues.) But I'm hitting camera-related errors when I try to compile it. Here's the relevant output in the make process:
Code:
CC arch/arm/mach-msm/board-8064-gpiomux.o
CC arch/arm/mach-msm/board-8064-camera.o
In file included from arch/arm/mach-msm/include/mach/camera.h:26:0,
from arch/arm/mach-msm/board-8064-camera.c:19:
include/media/msm_camera.h:1543:6: warning: "CONFIG_HTC_CAMERA_HAL_VERSION" is not defined [-Wundef]
error, forbidden warning: msm_camera.h:1543
make[1]: *** [arch/arm/mach-msm/board-8064-camera.o] Error 1
make: *** [arch/arm/mach-msm] Error 2
I tried to fix it by adding the HTC_CAMERA_HAL_VERSION config to Kconfig, but then I get this error instead:
Code:
CC arch/arm/mach-msm/board-8064-gpiomux.o
CC arch/arm/mach-msm/board-8064-camera.o
In file included from arch/arm/mach-msm/board-8064-camera.c:19:0:
arch/arm/mach-msm/include/mach/camera.h:682:33: warning: 'struct msm_camera_csi_params' declared inside parameter list
error, forbidden warning: camera.h:682
make[1]: *** [arch/arm/mach-msm/board-8064-camera.o] Error 1
make: *** [arch/arm/mach-msm] Error 2
Any ideas?

[HELP] Compiling Kernel : Makefile errors

Hi,
I'm trying to compile the kernel source from @flar2
I didn't find a specific build instructions so followed the usual method
After pointing to toolchain folder
Kernel source: https://github.com/korom42/ocean
My working setup:
Information about my OS:
Virtualization: oracle
OS: Ubuntu 16.04 Fedora 28 (Workstation Edition)
Kernel: Linux 4.17.17-200.fc28.x86_64
CPU: Intel Core i5-7200u @ 2x 2.7GHz [50.0°C]
GPU: intel
RAM: 2048MiB
Prepare :
Code:
export CROSS_COMPILE=/home/korom42/aarch64-linux-android-4.9/bin/aarch64-linux-android-
export ARCH=arm64
export SUBARCH=arm64
export USE_CCACHE=1
make elementalx_defconfig
make /or make O=out
Compile issue:
http://prntscr.com/kl1gyi
lib/Makefile:17: *** recipe commences before first target. Stop.
Makefile:1213: recipe for target '_clean_lib' failed
make: *** [_clean_lib] Error 2
Update: I changed my building environment to Fedora 28 and that problem is fixed now. But, I am getting another error I guess it is related to the source code , I found a similar issue here
Code:
[...]
CC drivers/base/module.o
CC drivers/base/soc.o
CC drivers/base/pinctrl.o
CC drivers/base/platform-msi.o
LD drivers/base/built-in.o
CC drivers/block/brd.o
CC drivers/block/loop.o
CC drivers/block/zram/zcomp_lzo.o
CC drivers/block/zram/zcomp.o
CC drivers/block/zram/zram_drv.o
CC drivers/block/zram/zcomp_lz4.o
LD drivers/block/zram/zram.o
LD drivers/block/zram/built-in.o
LD drivers/block/built-in.o
CC drivers/bluetooth/bluetooth-power.o
CC drivers/bluetooth/btfm_slim.o
drivers/bluetooth/btfm_slim.c:26:23: fatal error: btfm_slim.h: No such file or directory
#include <btfm_slim.h>
^
compilation terminated.
make[2]: *** [scripts/Makefile.build:264: drivers/bluetooth/btfm_slim.o] Error 1
make[1]: *** [scripts/Makefile.build:408: drivers/bluetooth] Error 2
make: *** [Makefile:966: drivers] Error 2
I also tried
Code:
make O=out clean
And got the same error
Update:
Possibly similar issue here
I guess it is source code related ? Any ideas how to fix that

[HELP] Errors while compiling Android kernel

Hey guys,
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?
Code:
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....
Thanks!
Best regards
Device: Redmi Note 7
Kernel source: https://github.com/LineageOS/android_kernel_xiaomi_sdm660
Up.
Anyone?

Categories

Resources