All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6.27 patch] #error for gcc 4.1.{0,1}
@ 2008-08-13 20:44 Adrian Bunk
  2008-08-13 20:57 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2008-08-13 20:44 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

gcc 4.1.0 and 4.1.1 are known to miscompile the kernel:
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27781

Usage of weak functions has become a common pattern in the kernel, and 
usages get added in each kernel version increasing the probability of 
bugs with each kernel release.

This miscompilation of weak functions can result in subtle runtime 
errors.

#error for gcc 4.1.0 and 4.1.1 to prevent users from running into
this bug.

Note:
We already printed a #warning for gcc 4.1.0 due to a different bug.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

This patch has been sent on:
- 6 Aug 2008
- 26 Jun 2008

ee78871a1d85fe60958748c208389adb4031fefe diff --git a/init/main.c b/init/main.c
index f7fb200..bede344 100644
--- a/init/main.c
+++ b/init/main.c
@@ -76,8 +76,9 @@
  * trouble.
  */
 
-#if __GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ == 0
-#warning gcc-4.1.0 is known to miscompile the kernel.  A different compiler version is recommended.
+/*  due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27781  */
+#if __GNUC__ == 4 && __GNUC_MINOR__ == 1 && (__GNUC_PATCHLEVEL__ == 0 || __GNUC_PATCHLEVEL__ == 1)
+#error gcc 4.1.0 and 4.1.1 are known to miscompile the kernel.
 #endif
 
 static int kernel_init(void *);



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

* Re: [2.6.27 patch] #error for gcc 4.1.{0,1}
  2008-08-13 20:44 [2.6.27 patch] #error for gcc 4.1.{0,1} Adrian Bunk
@ 2008-08-13 20:57 ` Andrew Morton
  2008-08-13 21:22   ` Adrian Bunk
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2008-08-13 20:57 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel, Vegard Nossum

On Wed, 13 Aug 2008 23:44:45 +0300
Adrian Bunk <bunk@kernel.org> wrote:

> gcc 4.1.0 and 4.1.1 are known to miscompile the kernel:
>   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27781
> 
> Usage of weak functions has become a common pattern in the kernel, and 
> usages get added in each kernel version increasing the probability of 
> bugs with each kernel release.
> 
> This miscompilation of weak functions can result in subtle runtime 
> errors.
> 
> #error for gcc 4.1.0 and 4.1.1 to prevent users from running into
> this bug.
> 
> Note:
> We already printed a #warning for gcc 4.1.0 due to a different bug.

I've been hiding from this because it would wreck a lot of my
cross-compilers, which quite a few other people are using as well.

Vegard, save us!

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

* Re: [2.6.27 patch] #error for gcc 4.1.{0,1}
  2008-08-13 20:57 ` Andrew Morton
@ 2008-08-13 21:22   ` Adrian Bunk
  0 siblings, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2008-08-13 21:22 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Vegard Nossum

On Wed, Aug 13, 2008 at 01:57:49PM -0700, Andrew Morton wrote:
> On Wed, 13 Aug 2008 23:44:45 +0300
> Adrian Bunk <bunk@kernel.org> wrote:
> 
> > gcc 4.1.0 and 4.1.1 are known to miscompile the kernel:
> >   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27781
> > 
> > Usage of weak functions has become a common pattern in the kernel, and 
> > usages get added in each kernel version increasing the probability of 
> > bugs with each kernel release.
> > 
> > This miscompilation of weak functions can result in subtle runtime 
> > errors.
> > 
> > #error for gcc 4.1.0 and 4.1.1 to prevent users from running into
> > this bug.
> > 
> > Note:
> > We already printed a #warning for gcc 4.1.0 due to a different bug.
> 
> I've been hiding from this because it would wreck a lot of my
> cross-compilers, which quite a few other people are using as well.

We are talking about runtime breakages, with new breakages added in each 
kernel release.

Which is not nice for users.

And my patch is the result of developers spending time on debugging and 
working around a real-life bug caused by this compiler bug.

If you insist on keeping your 4.1.0 compilers I can prepare a patch that 
removes the fatal __weak usages.

> Vegard, save us!

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

end of thread, other threads:[~2008-08-13 21:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-13 20:44 [2.6.27 patch] #error for gcc 4.1.{0,1} Adrian Bunk
2008-08-13 20:57 ` Andrew Morton
2008-08-13 21:22   ` Adrian Bunk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.