2017-06-20 55 views
1

我正在編譯從源代碼的Android內核。但是在製作對象tspdrv.o時出現了一些錯誤,並且無法確定它從哪裏生成。以下是錯誤:從源代碼編譯內核。錯誤解釋。

CC  drivers/tspdrv/tspdrv.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 drivers/tspdrv/tspdrv.c:34: 
drivers/tspdrv/ImmVibeSPI.c: In function 'drv2604_write_reg_val': 
include/linux/dynamic_debug.h:61:16: error: implicit declaration of function 'KBUILD_STR' [-Werror=implicit-function-declaration] 
    static struct _ddebug __aligned(8)   \ 
     ^
include/linux/dynamic_debug.h:73:2: note: in expansion of macro 
'DEFINE_DYNAMIC_DEBUG_METADATA' 
    DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 
^
include/linux/printk.h:196:2: note: in expansion of macro 'dynamic_pr_debug' 
    dynamic_pr_debug(fmt, ##__VA_ARGS__) 
^
drivers/tspdrv/ImmVibeSPI.c:681:4: note: in expansion of macro 'pr_debug' 
pr_debug("drv2604 x5 write 0x%02x, 0x%02x", data[i], data[i + 1]); 
^ 
<command-line>:0:27: error: 'tspdrv' undeclared (first use in this function) 
include/linux/dynamic_debug.h:63:14: note: in expansion of macro 'KBUILD_MODNAME' 
    .modname = KBUILD_MODNAME, \ 
      ^
include/linux/dynamic_debug.h:73:2: note: in expansion of macro 'DEFINE_DYNAMIC_DEBUG_METADATA' 
    DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 
^
include/linux/printk.h:196:2: note: in expansion of macro 'dynamic_pr_debug' 
    dynamic_pr_debug(fmt, ##__VA_ARGS__) 
^
drivers/tspdrv/ImmVibeSPI.c:681:4: note: in expansion of macro 'pr_debug' 
    pr_debug("drv2604 x5 write 0x%02x, 0x%02x", data[i], data[i + 1]); 
    ^
<command-line>:0:27: note: each undeclared identifier is reported only once for each function it appears in 
include/linux/dynamic_debug.h:63:14: note: in expansion of macro 'KBUILD_MODNAME' 
    .modname = KBUILD_MODNAME, \ 
      ^
include/linux/dynamic_debug.h:73:2: note: in expansion of macro 'DEFINE_DYNAMIC_DEBUG_METADATA' 
    DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 
^
include/linux/printk.h:196:2: note: in expansion of macro 'dynamic_pr_debug' 
    dynamic_pr_debug(fmt, ##__VA_ARGS__) 
^
drivers/tspdrv/ImmVibeSPI.c:681:4: note: in expansion of macro 'pr_debug' 
    pr_debug("drv2604 x5 write 0x%02x, 0x%02x", data[i], data[i + 1]); 
    ^
drivers/tspdrv/ImmVibeSPI.c: In function 'drv2604_read_reg': 
<command-line>:0:27: error: 'tspdrv' undeclared (first use in this function) 
include/linux/dynamic_debug.h:63:14: note: in expansion of macro 'KBUILD_MODNAME' 
    .modname = KBUILD_MODNAME, \ 
      ^
include/linux/dynamic_debug.h:73:2: note: in expansion of macro 'DEFINE_DYNAMIC_DEBUG_METADATA' 
    DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 
^
include/linux/printk.h:196:2: note: in expansion of macro 'dynamic_pr_debug' 
    dynamic_pr_debug(fmt, ##__VA_ARGS__) 
^
drivers/tspdrv/ImmVibeSPI.c:732:2: note: in expansion of macro 'pr_debug' 
    pr_debug("drv2604 read addr:0x%x reg:0x%x data:0x%x res:%d", 
^
cc1: some warnings being treated as errors 
scripts/Makefile.build:306: *** [drivers/tspdrv/tspdrv.o] Error 1 

#0 drivers/tspdrv/tspdrv.o at 
/home/ozair/nougat_mi3/kernel/xiaomi/cancro/scripts/Makefile.build:306 
#1 drivers/tspdrv/built-in.o at 
/home/ozair/nougat_mi3/kernel/xiaomi/cancro/scripts/Makefile.build:374 
#2 __build at 
/home/ozair/nougat_mi3/kernel/xiaomi/cancro/scripts/Makefile.build:8 
Command-line invocation: 
    "remake -f scripts/Makefile.build obj=drivers/tspdrv" 
scripts/Makefile.build:442: *** [drivers/tspdrv] Error 2 

#0 drivers/tspdrv at 
/home/ozair/nougat_mi3/kernel/xiaomi/cancro/scripts/Makefile.build:442 
#1 drivers/pinctrl/built-in.o at 
/home/ozair/nougat_mi3/kernel/xiaomi/cancro/scripts/Makefile.build:361 
#2 drivers/built-in.o at 
/home/ozair/nougat_mi3/kernel/xiaomi/cancro/scripts/Makefile.build:374 
#3 __build at 
/home/ozair/nougat_mi3/kernel/xiaomi/cancro/scripts/Makefile.build:8 
Command-line invocation: 
    "remake -f scripts/Makefile.build obj=drivers" 
Makefile:949: *** [drivers] Error 2 

#0 drivers at 
/home/ozair/nougat_mi3/kernel/xiaomi/cancro/Makefile:949 
#1 arch/arm/kernel/vmlinux.lds at 
/home/ozair/nougat_mi3/kernel/xiaomi/cancro/Makefile:940 
#2 vmlinux at 
/home/ozair/nougat_mi3/kernel/xiaomi/cancro/Makefile:915 
#3 all at /home/ozair/nougat_mi3/kernel/xiaomi/cancro/Makefile:563 
#4 _all at /home/ozair/nougat_mi3/kernel/xiaomi/cancro/Makefile:111 
Command-line invocation: 
    " none 

我需要了解此錯誤的根源,因爲它不會引導我到任何地方。例如讓我們的錯誤

drivers/tspdrv/ImmVibeSPI.c: In function 'drv2604_write_reg_val': 
include/linux/dynamic_debug.h:61:16: error: implicit declaration of 
function 'KBUILD_STR' [-Werror=implicit-function-declaration] 
    static struct _ddebug __aligned(8)   \ 
     ^

沒有在include/linux/dynamic_debug.h:61:16

或我讀錯了叫KBUILD_STR這部分功能?

+0

我猜源代碼不完整。請再次下載android內核源碼並嘗試編譯它。 – Gaurav

+0

@GauravPathak不幸的是,對於不完整的源代碼,我只是下載了他們提供的東西。 :(並嘗試了很多次,但無濟於事。可以更換工具鏈嗎? –

回答

0

看起來像是從4.2到4.10之間的內核構建腳本中刪除了KBUILD_STR。

它看起來像驅動程序尚未更新匹配。