/********************************************************************************
* I.MX6 linux kernel编译错误处理
* 声明:
* 本文仅仅是对I.MX6的linux内核编译出错,记录其对应的处理方法。
*
* 2015-10-15 晴 深圳 南山平山村 曾剑锋
*******************************************************************************/
参考文章:
. Android JB4..2_1.0.0 issue: MFG Firmware build does not compile
https://community.freescale.com/thread/307477
. honycomb-x86: build failed on ubuntu for traget-product 'vm'
https://code.google.com/p/android-x86/issues/detail?id=487
. AR1021In Production
http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en557224
一、编译错误:
LD init/built-in.o
LD .tmp_vmlinux1
drivers/built-in.o: In function `mxc_hdmi_remove':
clkdev.c:(.text+0x125e0): undefined reference to `switch_dev_unregister'
clkdev.c:(.text+0x125ec): undefined reference to `switch_dev_unregister'
drivers/built-in.o: In function `hotplug_worker':
clkdev.c:(.text+0x1445c): undefined reference to `switch_set_state'
clkdev.c:(.text+0x1446c): undefined reference to `switch_set_state'
clkdev.c:(.text+0x1466c): undefined reference to `switch_set_state'
clkdev.c:(.text+0x1467c): undefined reference to `switch_set_state'
drivers/built-in.o: In function `mxc_hdmi_probe':
clkdev.c:(.devinit.text+0x3c8): undefined reference to `switch_dev_register'
clkdev.c:(.devinit.text+0x3d4): undefined reference to `switch_dev_register'
sound/built-in.o: In function `usb_audio_disconnect':
last.c:(.text+0x16b20): undefined reference to `switch_set_state'
last.c:(.text+0x16b28): undefined reference to `switch_dev_unregister'
sound/built-in.o: In function `usb_audio_probe':
last.c:(.text+0x16f84): undefined reference to `switch_dev_register'
last.c:(.text+0x17008): undefined reference to `switch_set_state'
last.c:(.text+0x170e4): undefined reference to `switch_dev_register'
sound/built-in.o: In function `hp_jack_status_check':
last.c:(.text+0x368b0): undefined reference to `switch_set_state'
last.c:(.text+0x36944): undefined reference to `switch_set_state'
sound/built-in.o: In function `imx_wm8962_remove':
last.c:(.devexit.text+0x2b8): undefined reference to `switch_dev_unregister'
sound/built-in.o: In function `imx_wm8962_probe':
last.c:(.devinit.text+0x6e4): undefined reference to `switch_dev_register'
last.c:(.devinit.text+0x718): undefined reference to `switch_set_state'
make: *** [.tmp_vmlinux1] Error
解决方法:
主要是make menuconfig打开swith这个选项,详情参考文章1。
二、编译错误:
LD kernel/built-in.o
CC drivers/gpu/drm/drm_auth.o
In file included from include/drm/drmP.h::,
from drivers/gpu/drm/drm_auth.c::
include/drm/drm.h::: fatal error: sys/types.h: No such file or directory
compilation terminated.
make[]: *** [drivers/gpu/drm/drm_auth.o] Error
make[]: *** [drivers/gpu/drm] Error
make[]: *** [drivers/gpu] Error
make: *** [drivers] Error
解决方法:
由于采用了Android自带的编译器,本来就不能用Android的编译器,导致出现了这个问题,所以换成Linux Qt的编译器就行了。
三、编译错误:
CC [M] drivers/usb/gadget/audio.o
CC [M] drivers/usb/gadget/ether.o
drivers/usb/gadget/ether.c: In function 'rndis_do_config':
drivers/usb/gadget/ether.c::: error: too few arguments to function 'rndis_bind_config'
drivers/usb/gadget/f_rndis.c::: note: declared here
drivers/usb/gadget/ether.c::: warning: control reaches end of non-void function [-Wreturn-type]
make[]: *** [drivers/usb/gadget/ether.o] Error
make[]: *** [drivers/usb/gadget] Error
make[]: *** [drivers/usb] Error
make: *** [drivers] Error
解决方法:
make menuconfig 去掉这部分驱动也许就行了。目前本人通过选择一个能够编译通过的文件系统
Device Drivers --->
[*] USB support --->
<*> USB Gadget Support --->
<*> USB Gadget Drivers (Gadget Filesystem (EXPERIMENTAL)) --->
(X) Gadget Filesystem (EXPERIMENTAL)
四、编译错误:
Qt@aplex:~/kernel/linuxQt_kernel$ make uImage
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC drivers/input/touchscreen/ar1020-spi.o
drivers/input/touchscreen/ar1020-spi.c: In function 'ar1020_spi_probe':
drivers/input/touchscreen/ar1020-spi.c::: error: implicit declaration of function 'set_irq_type' [-Werror=implicit-function-declaration]
drivers/input/touchscreen/ar1020-spi.c::: warning: ignoring return value of 'request_irq', declared with attribute warn_unused_result [-Wunused-result]
cc1: some warnings being treated as errors
make[]: *** [drivers/input/touchscreen/ar1020-spi.o] Error
make[]: *** [drivers/input/touchscreen] Error
make[]: *** [drivers/input] Error
make: *** [drivers] Error
解决方法:
//set_irq_type(i, IRQ_TYPE_EDGE_RISING); // 将中断引发类型放在request_irq()中
if ( >= (ret=request_irq(i, test_irq_handler_func, IRQ_TYPE_EDGE_RISING,
"AR1020 IRQ", priv))){
......
}