Skip to contentSkip to conversation

Link errors with CONFIG_VT=n, CONFIG_SYSRQ=y

PATCH Russell King 2 participants 2 messages Jul 17, 2002 – Jul 18, 2002 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

lkml, James,

When building 2.5.26 with CONFIG_VT=n and CONFIG_SYSRQ=y, the resulting kernel can't be linked:

drivers/built-in.o: In function `sysrq_handle_unraw':
drivers/built-in.o(.text+0x14694): undefined reference to fg_console' drivers/built-in.o(.text+0x14698): undefined reference to kbd_table'

The following is a work-around for this problem. There is probably a cleaner solution to this.

drivers/char/sysrq.c +2 -0
@@ -81,10 +81,12 @@
 static void sysrq_handle_unraw(int key, struct pt_regs *pt_regs,
 			       struct tty_struct *tty) 
 {
+#ifdef CONFIG_VT
 	struct kbd_struct *kbd = &kbd_table[fg_console];
 
 	if (kbd)
 		kbd->kbdmode = VC_XLATE;
+#endif
 }
 static struct sysrq_key_op sysrq_unraw_op = {
 	handler:	sysrq_handle_unraw,
Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#1 lore raw

Fixed :-)

. ---

   |o_o |
   |:_/ |   Give Micro$oft the Bird!!!!
  //   \ \  Use Linux!!!!
 (|     | )
 /'\_   _/`\

\___)=(___/

Quoted 32 lines · Russell King

lkml, James,

When building 2.5.26 with CONFIG_VT=n and CONFIG_SYSRQ=y, the resulting kernel can't be linked:

drivers/built-in.o: In function `sysrq_handle_unraw':
drivers/built-in.o(.text+0x14694): undefined reference to fg_console' drivers/built-in.o(.text+0x14698): undefined reference to kbd_table'

The following is a work-around for this problem. There is probably a cleaner solution to this.

drivers/char/sysrq.c +2 -1
@@ -81,10 +81,12 @@
 static void sysrq_handle_unraw(int key, struct pt_regs *pt_regs,
 			       struct tty_struct *tty)
 {
+#ifdef CONFIG_VT
 	struct kbd_struct *kbd = &kbd_table[fg_console];
 
 	if (kbd)
 		kbd->kbdmode = VC_XLATE;
+#endif
 }
 static struct sysrq_key_op sysrq_unraw_op = {
 	handler:	sysrq_handle_unraw,
 
--

Russell King ([email protected]) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html