当前位置: 技术问答>linux和unix
内核编译问题求教!
来源: 互联网 发布时间:2016-12-24
本文导语: 编译内核过程中出现一下错误: arch/arm/kernel/kernel.o: In function `setup_arch': arch/arm/kernel/kernel.o(.text.init+0x106c): undefined reference to `conswitchp' arch/arm/kernel/kernel.o(.text.init+0x1070): undefined reference to `dummy_con' arch/arm/kernel/ke...
编译内核过程中出现一下错误:
arch/arm/kernel/kernel.o: In function `setup_arch':
arch/arm/kernel/kernel.o(.text.init+0x106c): undefined reference to `conswitchp'
arch/arm/kernel/kernel.o(.text.init+0x1070): undefined reference to `dummy_con'
arch/arm/kernel/kernel.o(__ksymtab+0x80): undefined reference to `kd_mksound'
kernel/kernel.o: In function `panic':
kernel/kernel.o(.text+0x3020): undefined reference to `disable_console_blank'
drivers/char/char.o: In function `tty_open':
drivers/char/char.o(.text+0x2970): undefined reference to `fg_console'
drivers/char/char.o: In function `tty_ioctl':
drivers/char/char.o(.text+0x3798): undefined reference to `tioclinux'
drivers/char/char.o: In function `chr_dev_init':
drivers/char/char.o(.text.init+0xb0): undefined reference to `fbmem_init'
drivers/char/char.o: In function `console_init':
drivers/char/char.o(.text.init+0x134): undefined reference to `con_init'
drivers/char/char.o: In function `tty_init':
drivers/char/char.o(.text.init+0x21c): undefined reference to `con_init_devfs'
drivers/char/char.o(.text.init+0x2bc): undefined reference to `kbd_init'
drivers/char/char.o(.text.init+0x2c4): undefined reference to `vcs_init'
drivers/block/block.o: In function `device_init':
drivers/block/block.o(.text.init+0x13c): undefined reference to `console_map_init'
drivers/input/inputdrv.o: In function `emulate_raw':
drivers/input/inputdrv.o(.text+0xa30): undefined reference to `handle_scancode'
drivers/input/inputdrv.o(.text+0xa3c): undefined reference to `handle_scancode'
drivers/input/inputdrv.o(.text+0xa48): undefined reference to `handle_scancode'
drivers/input/inputdrv.o(.text+0xa84): undefined reference to `handle_scancode'
drivers/input/inputdrv.o(.text+0xa94): undefined reference to `handle_scancode'
drivers/input/inputdrv.o(.text+0xaa8): more undefined references to `handle_scancode' follow
drivers/input/inputdrv.o: In function `keybdev_event':
drivers/input/inputdrv.o(.text+0xbc0): undefined reference to `keyboard_tasklet'
drivers/input/inputdrv.o(.text+0xbc4): undefined reference to `keyboard_tasklet'
drivers/input/inputdrv.o: In function `keybdev_init':
drivers/input/inputdrv.o(.text.init+0x8c): undefined reference to `kbd_refresh_leds'
drivers/input/inputdrv.o(.text.init+0xec): undefined reference to `kbd_ledfunc'
/home/at91arm9200/source/VGA_LCD/Kernel/linux-2.4.27-AT91RM9200/lib/lib.a(bust_spinlocks.o): In function `bust_spinlocks':
bust_spinlocks.o(.text+0x28): undefined reference to `unblank_screen'
make: *** [vmlinux] Error 1
不知道有没有人知道问题出在什么地方?
arch/arm/kernel/kernel.o: In function `setup_arch':
arch/arm/kernel/kernel.o(.text.init+0x106c): undefined reference to `conswitchp'
arch/arm/kernel/kernel.o(.text.init+0x1070): undefined reference to `dummy_con'
arch/arm/kernel/kernel.o(__ksymtab+0x80): undefined reference to `kd_mksound'
kernel/kernel.o: In function `panic':
kernel/kernel.o(.text+0x3020): undefined reference to `disable_console_blank'
drivers/char/char.o: In function `tty_open':
drivers/char/char.o(.text+0x2970): undefined reference to `fg_console'
drivers/char/char.o: In function `tty_ioctl':
drivers/char/char.o(.text+0x3798): undefined reference to `tioclinux'
drivers/char/char.o: In function `chr_dev_init':
drivers/char/char.o(.text.init+0xb0): undefined reference to `fbmem_init'
drivers/char/char.o: In function `console_init':
drivers/char/char.o(.text.init+0x134): undefined reference to `con_init'
drivers/char/char.o: In function `tty_init':
drivers/char/char.o(.text.init+0x21c): undefined reference to `con_init_devfs'
drivers/char/char.o(.text.init+0x2bc): undefined reference to `kbd_init'
drivers/char/char.o(.text.init+0x2c4): undefined reference to `vcs_init'
drivers/block/block.o: In function `device_init':
drivers/block/block.o(.text.init+0x13c): undefined reference to `console_map_init'
drivers/input/inputdrv.o: In function `emulate_raw':
drivers/input/inputdrv.o(.text+0xa30): undefined reference to `handle_scancode'
drivers/input/inputdrv.o(.text+0xa3c): undefined reference to `handle_scancode'
drivers/input/inputdrv.o(.text+0xa48): undefined reference to `handle_scancode'
drivers/input/inputdrv.o(.text+0xa84): undefined reference to `handle_scancode'
drivers/input/inputdrv.o(.text+0xa94): undefined reference to `handle_scancode'
drivers/input/inputdrv.o(.text+0xaa8): more undefined references to `handle_scancode' follow
drivers/input/inputdrv.o: In function `keybdev_event':
drivers/input/inputdrv.o(.text+0xbc0): undefined reference to `keyboard_tasklet'
drivers/input/inputdrv.o(.text+0xbc4): undefined reference to `keyboard_tasklet'
drivers/input/inputdrv.o: In function `keybdev_init':
drivers/input/inputdrv.o(.text.init+0x8c): undefined reference to `kbd_refresh_leds'
drivers/input/inputdrv.o(.text.init+0xec): undefined reference to `kbd_ledfunc'
/home/at91arm9200/source/VGA_LCD/Kernel/linux-2.4.27-AT91RM9200/lib/lib.a(bust_spinlocks.o): In function `bust_spinlocks':
bust_spinlocks.o(.text+0x28): undefined reference to `unblank_screen'
make: *** [vmlinux] Error 1
不知道有没有人知道问题出在什么地方?
|
应该是什么.o或者库没有链接上,去看看你的那些undefined reference的东东,你生成的.o是不是加到Makefile中的Link命令中了。你添加了新的驱动,不是去直接编译就可以了,还有修改Makefile,将你要源码集成进去。
|
好像依赖关系没有处理好。
Symbol: HW_CONSOLE [=y]
Symbol: VT_HW_CONSOLE_BINDING[=n]
Prompt: Support for binding and unbinding console drivers
Defined at drivers/char Kconfig:68
│ Depends on: HW_CONSOLE
│ Location:
│ -> Device Drivers
│ -> Character devices
│ -> Virtual terminal (VT [=y])
这个 conswitchp 变量定义在 drivers/char/vt.c 文件,
依赖于 HW_CONSOLE 这个宏。
你看看你的配置 Virtual terminal (VT [=y]) 选上没有。
Symbol: HW_CONSOLE [=y]
Symbol: VT_HW_CONSOLE_BINDING[=n]
Prompt: Support for binding and unbinding console drivers
Defined at drivers/char Kconfig:68
│ Depends on: HW_CONSOLE
│ Location:
│ -> Device Drivers
│ -> Character devices
│ -> Virtual terminal (VT [=y])
这个 conswitchp 变量定义在 drivers/char/vt.c 文件,
依赖于 HW_CONSOLE 这个宏。
你看看你的配置 Virtual terminal (VT [=y]) 选上没有。
|
extern const struct consw *conswitchp;
你这是extern啊?建议你去查一下extern的含义,那只是声明这个变量在别的地方定义过,编译的时候不会当未定义变量,但是链接的时候还是要去需要找到定义的。你确信你的变量定义了吗?
你这是extern啊?建议你去查一下extern的含义,那只是声明这个变量在别的地方定义过,编译的时候不会当未定义变量,但是链接的时候还是要去需要找到定义的。你确信你的变量定义了吗?