C 从源代码编译内核。错误解释。

C 从源代码编译内核。错误解释。,c,kernel,C,Kernel,我正在从源代码编译一个android内核。但是在生成对象时遇到了一些错误,无法确定它是从哪里生成的。错误如下: 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 includ

我正在从源代码编译一个android内核。但是在生成对象时遇到了一些错误,无法确定它是从哪里生成的。错误如下:

  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
include/linux/dynamic\u debug.h:61:16


或者我读错了?

看起来KBUILD_STR是在4.2和4.10之间从内核构建脚本中删除的


看起来驱动程序没有更新以匹配。

看起来KBUILD_STR已从4.2和4.10之间的内核构建脚本中删除


看起来驱动程序没有更新以匹配。

我猜源代码不完整。请重新下载android内核源代码并尝试编译。@不幸的是,GauravPathak对不完整的源代码无能为力,我只是下载了他们提供的源代码:(并且已经尝试了很多次,但都没有效果。更改工具链是否有效?我猜源代码不完整。请重新下载android内核源代码并尝试编译。@GauravPathak不幸的是,对不完整的源代码无能为力,我只是下载了他们提供的源代码。:(并且已经尝试了很多次,但都没有效果。更换工具链能起作用吗?
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)          \
         ^