public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Remove spinlock workaround for pre 2.95 gccs
@ 2003-06-19 21:18 Andi Kleen
  2003-06-20  3:00 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Andi Kleen @ 2003-06-19 21:18 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, linux-kernel, rusty


Remove the empty initializer workaround that was added for egcs 1.1.
Only 2.95+ is supported now, so all compilers should support empty
structures.

The if just checked for __GNUC__, which means that 2.95 got
the workaround (and the incompatibility) too even though it didn't need it.

Advantage is that gcc 2.95 and 3.x compiled kernels are now binary
compatible. Unfortunately module loading still checks the compiler
version, but I guess that could be taken out now. As far as I know
there should be no compiler related incompatibilities now.

-Andi

--- linux-2.5.72-work/include/linux/spinlock.h-RES	2003-06-14 23:43:05.000000000 +0200
+++ linux-2.5.72-work/include/linux/spinlock.h	2003-06-19 23:11:55.000000000 +0200
@@ -146,13 +146,8 @@
 /*
  * gcc versions before ~2.95 have a nasty bug with empty initializers.
  */
-#if (__GNUC__ > 2)
-  typedef struct { } spinlock_t;
-  #define SPIN_LOCK_UNLOCKED (spinlock_t) { }
-#else
-  typedef struct { int gcc_is_buggy; } spinlock_t;
-  #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
-#endif
+typedef struct { } spinlock_t;
+#define SPIN_LOCK_UNLOCKED (spinlock_t) { }
 
 /*
  * If CONFIG_SMP is unset, declare the _raw_* definitions as nops



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Remove spinlock workaround for pre 2.95 gccs
  2003-06-19 21:18 [PATCH] Remove spinlock workaround for pre 2.95 gccs Andi Kleen
@ 2003-06-20  3:00 ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2003-06-20  3:00 UTC (permalink / raw)
  To: Andi Kleen; +Cc: torvalds, akpm, linux-kernel

In message <20030619211819.GA12716@averell> you write:
> Advantage is that gcc 2.95 and 3.x compiled kernels are now binary
> compatible. Unfortunately module loading still checks the compiler
> version, but I guess that could be taken out now. As far as I know
> there should be no compiler related incompatibilities now.

Good point, Andi.  And if any particular arch has compiler version
issues it can add it back in the arch-specific part.

Patch is as trivial.  If noone else can think of any problems?
Cheers,
Rusty.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.72-bk2/include/linux/vermagic.h working-2.5.72-bk2-compiler-version/include/linux/vermagic.h
--- linux-2.5.72-bk2/include/linux/vermagic.h	2003-02-18 11:18:56.000000000 +1100
+++ working-2.5.72-bk2-compiler-version/include/linux/vermagic.h	2003-06-20 12:57:51.000000000 +1000
@@ -19,5 +19,4 @@
 #define VERMAGIC_STRING 						\
 	UTS_RELEASE " "							\
 	MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT 			\
-	MODULE_ARCH_VERMAGIC 						\
-	"gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__)
+	MODULE_ARCH_VERMAGIC

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-20  2:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-19 21:18 [PATCH] Remove spinlock workaround for pre 2.95 gccs Andi Kleen
2003-06-20  3:00 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox