* [KJ] remove all content specific to GCC < 3.2??
@ 2007-06-07 16:17 Robert P. J. Day
2007-06-07 17:10 ` Adrian Bunk
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Robert P. J. Day @ 2007-06-07 16:17 UTC (permalink / raw)
To: kernel-janitors
is it relatively safe to strip the kernel tree of any content that
is conditional upon unacceptably old versions of GCC?
the header file linux/compiler.h already rejects the use of old gnu
compilers:
...
#if __GNUC__ >= 4
# include <linux/compiler-gcc4.h>
#elif __GNUC__ = 3 && __GNUC_MINOR__ >= 2
# include <linux/compiler-gcc3.h>
#else
# error Sorry, your compiler is too old/not recognized.
#endif
...
so clearly any gcc < 3.2 is dead in the water, which suggests that any
content dependent on that can be tossed as well. as a starting point,
one can search for the macro __GNUC_MINOR__ to find:
arch/arm/kernel/asm-offsets.c:#if (__GNUC__ = 3 && __GNUC_MINOR__ < 3)
arch/ia64/kernel/head.S:#if (__GNUC__ = 3 && __GNUC_MINOR__ < 3)
arch/ia64/kernel/ia64_ksyms.c:# if (__GNUC__ = 3 && __GNUC_MINOR__ < 3)
arch/ia64/oprofile/backtrace.c:#if (__GNUC__ = 3 && __GNUC_MINOR__ < 3)
include/asm-mips/compiler.h:#if __GNUC__ > 3 || (__GNUC__ = 3 && __GNUC_MINOR__ >= 4)
include/asm-alpha/compiler.h:#if __GNUC__ = 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3
include/asm-alpha/compiler.h:# if __GNUC__ = 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3
include/asm-s390/irqflags.h:#if __GNUC__ > 3 || (__GNUC__ = 3 && __GNUC_MINOR__ > 2)
include/asm-s390/bitops.h:#if __GNUC__ > 3 || (__GNUC__ = 3 && __GNUC_MINOR__ > 2)
include/asm-s390/bitops.h:#if __GNUC__ > 3 || (__GNUC__ = 3 && __GNUC_MINOR__ > 2)
include/asm-s390/spinlock.h:#if __GNUC__ > 3 || (__GNUC__ = 3 && __GNUC_MINOR__ > 2)
include/asm-s390/atomic.h:#if __GNUC__ > 3 || (__GNUC__ = 3 && __GNUC_MINOR__ > 2)
include/asm-s390/atomic.h:#if __GNUC__ > 3 || (__GNUC__ = 3 && __GNUC_MINOR__ > 2)
include/asm-s390/atomic.h:#if __GNUC__ > 3 || (__GNUC__ = 3 && __GNUC_MINOR__ > 2)
include/asm-s390/atomic.h:#if __GNUC__ > 3 || (__GNUC__ = 3 && __GNUC_MINOR__ > 2)
include/asm-s390/timex.h:#if __GNUC__ > 3 || (__GNUC__ = 3 && __GNUC_MINOR__ > 2)
include/asm-s390/timex.h:#if __GNUC__ > 3 || (__GNUC__ = 3 && __GNUC_MINOR__ > 2)
include/asm-sparc/bug.h: (__GNUC__ = 3 && __GNUC_MINOR__ > 3) || \
include/asm-sparc/bug.h: (__GNUC__ = 3 && __GNUC_MINOR__ = 3 && __GNUC_PATCHLEVEL__ >= 4)
include/asm-ia64/spinlock.h:#if (__GNUC__ = 3 && __GNUC_MINOR__ < 3)
include/asm-ia64/gcc_intrin.h:#if __GNUC__ >= 4 || (__GNUC__ = 3 && __GNUC_MINOR__ >= 4)
include/asm-ia64/module.h: "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__)
include/linux/compiler.h:#elif __GNUC__ = 3 && __GNUC_MINOR__ >= 2
include/linux/compiler-gcc3.h:#if __GNUC_MINOR__ >= 3
include/linux/compiler-gcc3.h:#if __GNUC_MINOR__ >= 4
include/asm-x86_64/bitops.h:#if __GNUC__ < 4 || (__GNUC__ = 4 && __GNUC_MINOR__ < 1)
init/main.c:#if (__GNUC__ < 3) || (__GNUC__ = 3 && __GNUC_MINOR__ < 2)
init/main.c:#if __GNUC__ = 4 && __GNUC_MINOR__ = 1 && __GNUC_PATCHLEVEL__ = 0
scripts/gcc-version.sh:MINOR=$(echo __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1)
seems like a lot of that can be removed. anyone want to deal with
that if it seems like a viable project?
rday
p.s. obviously, there might be more than what's listed above, i just
did a quick grep off the top of my head.
--
====================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
http://fsdev.net/wiki/index.php?title=Main_Page
====================================
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [KJ] remove all content specific to GCC < 3.2??
2007-06-07 16:17 [KJ] remove all content specific to GCC < 3.2?? Robert P. J. Day
@ 2007-06-07 17:10 ` Adrian Bunk
2007-06-07 17:29 ` Robert P. J. Day
2007-06-08 9:21 ` walter harms
2 siblings, 0 replies; 4+ messages in thread
From: Adrian Bunk @ 2007-06-07 17:10 UTC (permalink / raw)
To: kernel-janitors
On Thu, Jun 07, 2007 at 12:17:42PM -0400, Robert P. J. Day wrote:
>
> is it relatively safe to strip the kernel tree of any content that
> is conditional upon unacceptably old versions of GCC?
>
> the header file linux/compiler.h already rejects the use of old gnu
> compilers:
>...
> so clearly any gcc < 3.2 is dead in the water, which suggests that any
> content dependent on that can be tossed as well. as a starting point,
> one can search for the macro __GNUC_MINOR__ to find:
>...
> seems like a lot of that can be removed. anyone want to deal with
> that if it seems like a viable project?
None of the lines you have quoted could be removed because they'd deal
with gcc < 3.2 (the compiler.h and init/main.c #error's should stay).
I already removed all #ifdef's dealing with gcc < 3.2 when the gcc
requirement was raised to 3.2
> rday
>...
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
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [KJ] remove all content specific to GCC < 3.2??
2007-06-07 16:17 [KJ] remove all content specific to GCC < 3.2?? Robert P. J. Day
2007-06-07 17:10 ` Adrian Bunk
@ 2007-06-07 17:29 ` Robert P. J. Day
2007-06-08 9:21 ` walter harms
2 siblings, 0 replies; 4+ messages in thread
From: Robert P. J. Day @ 2007-06-07 17:29 UTC (permalink / raw)
To: kernel-janitors
On Thu, 7 Jun 2007, Adrian Bunk wrote:
> On Thu, Jun 07, 2007 at 12:17:42PM -0400, Robert P. J. Day wrote:
> >
> > is it relatively safe to strip the kernel tree of any content that
> > is conditional upon unacceptably old versions of GCC?
> >
> > the header file linux/compiler.h already rejects the use of old gnu
> > compilers:
> >...
> > so clearly any gcc < 3.2 is dead in the water, which suggests that any
> > content dependent on that can be tossed as well. as a starting point,
> > one can search for the macro __GNUC_MINOR__ to find:
> >...
> > seems like a lot of that can be removed. anyone want to deal with
> > that if it seems like a viable project?
>
> None of the lines you have quoted could be removed because they'd
> deal with gcc < 3.2 (the compiler.h and init/main.c #error's should
> stay).
ah, yes, you're right. i just saw all those comparisons and assumed
that some of them would represent old stuff. i didn't take the time
to look more closely.
however, i still think some of those errors could be updated. for
instance, consider this from arch/arm/kernel/asm-offsets.c:
...
#if (__GNUC__ = 3 && __GNUC_MINOR__ < 3)
#error Your compiler is too buggy; it is known to miscompile kernels.
#error Known good compilers: 3.3
#endif
...
it seems inconsistent that compiler.h *accepts* gcc-3.2, while this
source file *rejects* it. if gcc-3.2 is too buggy just for the ARM
architecture, then the error message should probably say that, rather
than suggest that it's too buggy *in general*.
also, from init/main.c, this looks like it can be tossed:
#if (__GNUC__ < 3) || (__GNUC__ = 3 && __GNUC_MINOR__ < 2)
#error Sorry, your GCC is too old. It builds incorrect kernels.
#endif
just being pedantic. :-)
rday
--
====================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
http://fsdev.net/wiki/index.php?title=Main_Page
====================================
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [KJ] remove all content specific to GCC < 3.2??
2007-06-07 16:17 [KJ] remove all content specific to GCC < 3.2?? Robert P. J. Day
2007-06-07 17:10 ` Adrian Bunk
2007-06-07 17:29 ` Robert P. J. Day
@ 2007-06-08 9:21 ` walter harms
2 siblings, 0 replies; 4+ messages in thread
From: walter harms @ 2007-06-08 9:21 UTC (permalink / raw)
To: kernel-janitors
Robert P. J. Day wrote:
> On Thu, 7 Jun 2007, Adrian Bunk wrote:
>
>> On Thu, Jun 07, 2007 at 12:17:42PM -0400, Robert P. J. Day wrote:
>>> is it relatively safe to strip the kernel tree of any content that
>>> is conditional upon unacceptably old versions of GCC?
>>>
>>> the header file linux/compiler.h already rejects the use of old gnu
>>> compilers:
>>> ...
>>> so clearly any gcc < 3.2 is dead in the water, which suggests that any
>>> content dependent on that can be tossed as well. as a starting point,
>>> one can search for the macro __GNUC_MINOR__ to find:
>>> ...
>>> seems like a lot of that can be removed. anyone want to deal with
>>> that if it seems like a viable project?
>> None of the lines you have quoted could be removed because they'd
>> deal with gcc < 3.2 (the compiler.h and init/main.c #error's should
>> stay).
>
> ah, yes, you're right. i just saw all those comparisons and assumed
> that some of them would represent old stuff. i didn't take the time
> to look more closely.
>
> however, i still think some of those errors could be updated. for
> instance, consider this from arch/arm/kernel/asm-offsets.c:
>
> ...
> #if (__GNUC__ = 3 && __GNUC_MINOR__ < 3)
> #error Your compiler is too buggy; it is known to miscompile kernels.
> #error Known good compilers: 3.3
> #endif
> ...
>
> it seems inconsistent that compiler.h *accepts* gcc-3.2, while this
> source file *rejects* it. if gcc-3.2 is too buggy just for the ARM
> architecture, then the error message should probably say that, rather
> than suggest that it's too buggy *in general*.
>
> also, from init/main.c, this looks like it can be tossed:
>
> #if (__GNUC__ < 3) || (__GNUC__ = 3 && __GNUC_MINOR__ < 2)
> #error Sorry, your GCC is too old. It builds incorrect kernels.
> #endif
>
> just being pedantic. :-)
there are no stupid questions just stupid answers :)
It is useful to have different architectures check for different gcc versions since some bugs may
be present in certain architectures only.
it *is* stupid to have a general gcc check ABOVE this level. Since linux will refuse to compile at all.
In general it is a question of policy since certain gcc version are still in use because they are known
to create good code for certain architecture (e.g. gcc-2.95 for arm).
Is there are table available gcc-version vs kernel vs architecture that evaluates this ?
This could be translated into a small code that checks the current
re,
wh
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-06-08 9:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-07 16:17 [KJ] remove all content specific to GCC < 3.2?? Robert P. J. Day
2007-06-07 17:10 ` Adrian Bunk
2007-06-07 17:29 ` Robert P. J. Day
2007-06-08 9:21 ` walter harms
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.