From: Mikael Pettersson <mikpe@csd.uu.se>

The spinlock consolidation patch that was included in 2.6.12-mm2 removed
the kernel's fixes for empty structure bugs in gcc-2.95.

This patch re-adds those fixes.  It also updates the corresponding comment
to state that the empty structure bug also is present in early gcc-2.96
versions.

Signed-off-by: Mikael Pettersson <mikpe@csd.uu.se>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 include/linux/spinlock_types_up.h |   14 ++++++++++++++
 1 files changed, 14 insertions(+)

diff -puN include/linux/spinlock_types_up.h~spinlock-consolidation-up-spinlocks-gcc-29x-fix include/linux/spinlock_types_up.h
--- 25/include/linux/spinlock_types_up.h~spinlock-consolidation-up-spinlocks-gcc-29x-fix	2005-06-29 14:59:25.000000000 -0700
+++ 25-akpm/include/linux/spinlock_types_up.h	2005-06-29 14:59:25.000000000 -0700
@@ -22,16 +22,30 @@ typedef struct {
 
 #else
 
+/*
+ * All gcc 2.95 versions and early versions of 2.96 have a nasty bug
+ * with empty initializers.
+ */
+#if (__GNUC__ > 2)
 typedef struct { } raw_spinlock_t;
 
 #define __RAW_SPIN_LOCK_UNLOCKED { }
+#else
+typedef struct { int gcc_is_buggy; } raw_spinlock_t;
+#define __RAW_SPIN_LOCK_UNLOCKED (raw_spinlock_t) { 0 }
+#endif
 
 #endif
 
+#if (__GNUC__ > 2)
 typedef struct {
 	/* no debug version on UP */
 } raw_rwlock_t;
 
 #define __RAW_RW_LOCK_UNLOCKED { }
+#else
+typedef struct { int gcc_is_buggy; } raw_rwlock_t;
+#define __RAW_RW_LOCK_UNLOCKED (raw_rwlock_t) { 0 }
+#endif
 
 #endif /* __LINUX_SPINLOCK_TYPES_UP_H */
_