Compile problem of exi_driver.c

"Sebastien Lucas" <[email protected]> Thu, 24 Aug 2006 16:01:28 +0200
Newsgroups gmane.linux.ports.game-cube.devel
Message-ID <[email protected]>
Hi,

Since a few days I try to build my own gamecube kernel with uClib
toolchain. And today I came up with a problem when I compiled the
kernel 2.6.16.17 with gc patch applied.

gcc 4.1.1 didn't like the multiple declaration of exi_bus_devices,
exi_devices and exi_bus_type
 in exi_driver.c. So I had to apply the attached patch to make it compile.

Unfortunately my brother still have my gamecube so I can't test if my
kernel boot fine (to check if my fix is good).

Maybe the problem is on my side as I'm new to uClib toolchain.

Thanks for your amazing work on gc-linux.

Sebastien

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Gc-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gc-linux-devel
exi-compile-problem.diff (application/octet-stream, 1.7 KB)
diff -Naur linux-2.6.16.17/drivers/exi/exi-driver.c linux-2.6.16.17-mod/drivers/exi/exi-driver.c
--- linux-2.6.16.17/drivers/exi/exi-driver.c	2006-08-24 15:31:49.000000000 +0200
+++ linux-2.6.16.17-mod/drivers/exi/exi-driver.c	2006-08-24 15:46:52.000000000 +0200
@@ -30,8 +30,13 @@
 static char exi_driver_version[] = "3.1-isobel";
 
 
-extern struct device exi_bus_devices[EXI_MAX_CHANNELS];
-extern struct exi_device exi_devices[EXI_MAX_CHANNELS][EXI_DEVICES_PER_CHANNEL];
+static struct exi_device exi_devices[EXI_MAX_CHANNELS][EXI_DEVICES_PER_CHANNEL];
+
+static struct device exi_bus_devices[EXI_MAX_CHANNELS] = {
+        [0] = {.bus_id = "exi0"},
+        [1] = {.bus_id = "exi1"},
+        [2] = {.bus_id = "exi2"},
+};
 
 
 struct exi_map_id_to_name {
@@ -125,6 +130,11 @@
 	return 0;
 }
 
+static struct bus_type exi_bus_type = {
+        .name = "exi",
+        .match = exi_bus_match,
+};
+
 /*
  * Device release.
  */
@@ -371,19 +381,6 @@
 }
 
 
-static struct exi_device exi_devices[EXI_MAX_CHANNELS][EXI_DEVICES_PER_CHANNEL];
-
-static struct bus_type exi_bus_type = {
-	.name = "exi",
-	.match = exi_bus_match,
-};
-
-static struct device exi_bus_devices[EXI_MAX_CHANNELS] = {
-	[0] = {.bus_id = "exi0"},
-	[1] = {.bus_id = "exi1"},
-	[2] = {.bus_id = "exi2"},
-};
-
 extern void exi_channel_init(struct exi_channel *exi_channel,
 			     unsigned int channel);
 
diff -Naur linux-2.6.16.17/include/linux/exi.h linux-2.6.16.17-mod/include/linux/exi.h
--- linux-2.6.16.17/include/linux/exi.h	2006-08-24 15:31:49.000000000 +0200
+++ linux-2.6.16.17-mod/include/linux/exi.h	2006-08-24 15:47:30.000000000 +0200
@@ -21,7 +21,7 @@
 #include <asm/io.h>
 
 
-extern struct bus_type exi_bus_type;
+/*extern struct bus_type exi_bus_type;*/
 struct exi_channel;
 
 /*