Skip to contentSkip to conversation

UML: Fix another build error

PATCH In review WANG Cong 2 participants 3 messages Apr 12, 2008 – Apr 16, 2008 User-mode Linux (UML)

lore
Share & tools
lore

WANG Cong

author
#0 lore raw

PATCH 1/1 UML: Fix another build error

This patch fixes the following build error.

CC arch/um/drivers/mconsole_kern.o
/home/wangcong/projects/linux-2.6/arch/um/drivers/mconsole_kern.c:337: error: redefinition of ‘mconsole_register_dev’ /home/wangcong/projects/linux-2.6/arch/um/include/mconsole_kern.h:47: error: previous definition of ‘mconsole_register_dev’ was here make[2]: *** [arch/um/drivers/mconsole_kern.o] Error 1
make[1]: *** [arch/um/drivers/mconsole_kern.ko] Error 2
make: *** [sub-make] Error 2

Compile testing passed.

---
 arch/um/drivers/mconsole_kern.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
arch/um/drivers/mconsole_kern.c +5 -1
index 19d579d..e94ccb8 100644
@@ -330,9 +330,12 @@ void mconsole_stop(struct mc_request *req)
 	mconsole_reply(req, "", 0, 0);
 }
 
-static DEFINE_SPINLOCK(mc_devices_lock);
 static LIST_HEAD(mconsole_devices);
 
+#ifdef CONFIG_MCONSOLE
+
+static DEFINE_SPINLOCK(mc_devices_lock);
+
 void mconsole_register_dev(struct mc_device *new)
 {
 	spin_lock(&mc_devices_lock);
@@ -340,6 +343,7 @@ void mconsole_register_dev(struct mc_device *new)
 	list_add(&new->list, &mconsole_devices);
 	spin_unlock(&mc_devices_lock);
 }
+#endif
 
 static struct mc_device *mconsole_find_dev(char *name)
 {
Signature · 11 lines
1.5.2.4

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#1 lore raw
Quoted 9 lines · WANG Cong

This patch fixes the following build error.

CC arch/um/drivers/mconsole_kern.o
/home/wangcong/projects/linux-2.6/arch/um/drivers/mconsole_kern.c:337: error: redefinition of ‘mconsole_register_dev’ /home/wangcong/projects/linux-2.6/arch/um/include/mconsole_kern.h:47: error: previous definition of ‘mconsole_register_dev’ was here make[2]: *** [arch/um/drivers/mconsole_kern.o] Error 1
make[1]: *** [arch/um/drivers/mconsole_kern.ko] Error 2
make: *** [sub-make] Error 2

This one is fishy. For one thing, it looks like you reproduce this with !CONFIG_MCONSOLE, but I just successfully built a !CONFIG_MCONSOLE UML.

Second, the arch/um/drivers/Makefile looks to me (and the build log confirms) that mconsole_kern.c isn't compiled with !CONFIG_MCONSOLE.

Third, you should ask yourself if there might be a deeper problem that needs fixing if you find yourself putting #ifdef CONFIG_FOO in files which implement FOO.

Jeff

Signature · 11 lines
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
author
#2 lore raw

From: Jeff Dike <[email protected]>
Date: Mon, 14 Apr 2008 11:43:42 -0400

Quoted 15 lines · WANG Cong
Quoted 9 lines

This patch fixes the following build error.

CC arch/um/drivers/mconsole_kern.o
/home/wangcong/projects/linux-2.6/arch/um/drivers/mconsole_kern.c:337: error: redefinition of ‘mconsole_register_dev’ /home/wangcong/projects/linux-2.6/arch/um/include/mconsole_kern.h:47: error: previous definition of ‘mconsole_register_dev’ was here make[2]: *** [arch/um/drivers/mconsole_kern.o] Error 1
make[1]: *** [arch/um/drivers/mconsole_kern.ko] Error 2
make: *** [sub-make] Error 2

This one is fishy. For one thing, it looks like you reproduce this with !CONFIG_MCONSOLE, but I just successfully built a !CONFIG_MCONSOLE UML.

Quoted 6 lines

Second, the arch/um/drivers/Makefile looks to me (and the build log confirms) that mconsole_kern.c isn't compiled with !CONFIG_MCONSOLE.

Third, you should ask yourself if there might be a deeper problem that needs fixing if you find yourself putting #ifdef CONFIG_FOO in files which implement FOO.

Thanks for teaching this!

I will try if it's possible to reproduce this.

Cong
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel