I noticed that linux/arch/i386/Makefile says:
ifdef CONFIG_MK7
CFLAGS += -march=i686 -malign-functions=4
endif
Why not -march=athlon? Is this just for compatibility with old gcc?
If so, can't we fix it with an ifdef?
On Monday, 17 December 2001, [email protected] wrote:
> I noticed that linux/arch/i386/Makefile says:
>
> ifdef CONFIG_MK7
> CFLAGS += -march=i686 -malign-functions=4
> endif
Hm. As long as I can remember, 2.4 has always had this:
ifdef CONFIG_MK7
CFLAGS += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; else echo "-march=i686 -malign-functions=4"; fi)
endif
Perhaps you're describing a 2.2 kernel?
--
"The Universe doesn't give you any points for doing things that are easy."
-- Sheridan to Garibaldi in Babylon 5:"The Geometry of Shadows"
Dominik 'Rathann' Mierzejewski <rathann(at)we.are.one.pl>
* [email protected] <[email protected]> on Mon, Dec 17, 2001:
> I noticed that linux/arch/i386/Makefile says:
>
> ifdef CONFIG_MK7
> CFLAGS += -march=i686 -malign-functions=4
> endif
>
>
> Why not -march=athlon? Is this just for compatibility with old gcc?
The recommend kernel compiler is gcc 2.95.x, which doesn't support
"-march=athlon".
> If so, can't we fix it with an ifdef?
Can you fix it? You'd have to parse the output of `gcc -v`, I think
kbuild 2.5 does this, so start there first.
M. R.
"M. R. Brown" <[email protected]> writes:
> * [email protected] <[email protected]> on Mon, Dec 17, 2001:
>
> > I noticed that linux/arch/i386/Makefile says:
> >
> > ifdef CONFIG_MK7
> > CFLAGS += -march=i686 -malign-functions=4
> > endif
> >
> >
> > Why not -march=athlon? Is this just for compatibility with old gcc?
>
> The recommend kernel compiler is gcc 2.95.x, which doesn't support
> "-march=athlon".
But gcc-2.95,x _supports_ "-march=k6", and we should use that instead of
"-march-i686".
Obvious patch for 2.4.16 :
--- linux-2.4.16/arch/i386/Makefile Thu Apr 12 21:20:31 2001
+++ linux-2.4.16-bpc/arch/i386/Makefile Sun Dec 16 15:44:06 2001
@@ -63,7 +63,7 @@
endif
ifdef CONFIG_MK7
-CFLAGS += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; else echo "-march=i686 -malign-functions=4"; fi)
+CFLAGS += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; elif $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6 -malign-functions=4"; else echo "-march=i686 -malign-functions=4"; fi)
endif
ifdef CONFIG_MCRUSOE
I have tested this change, using 3 steps of the ChorusOS compilation
as benchmarks (The test first bootstrap gcc, then compiles various
cross-compilers in parallel and then uses them to build ChorusOS for
various architectures). On my XP1800+, it gives :
before the patch :
1017.92user 261.80system 24:39.89elapsed 86%CPU
706.33user 160.79system 16:23.61elapsed 88%CPU
1787.38user 418.76system 43:35.97elapsed 84%CPU
after the patch :
1018.42user 253.85system 24:44.68elapsed 85%CPU
704.89user 151.76system 16:16.14elapsed 87%CPU
1786.96user 410.76system 43:05.32elapsed 85%CPU
The improvement in system time is nice.
-- Benoit
* Benoit Poulot-Cazajous <[email protected]> on Wed, Dec 19, 2001:
>
> But gcc-2.95,x _supports_ "-march=k6", and we should use that instead of
> "-march-i686".
>
No, k6 != athlon. IIRC, the i686 optimization is closer to the Athlon than
the k6 opt.
>
> before the patch :
> 1017.92user 261.80system 24:39.89elapsed 86%CPU
> 706.33user 160.79system 16:23.61elapsed 88%CPU
> 1787.38user 418.76system 43:35.97elapsed 84%CPU
>
> after the patch :
> 1018.42user 253.85system 24:44.68elapsed 85%CPU
> 704.89user 151.76system 16:16.14elapsed 87%CPU
> 1786.96user 410.76system 43:05.32elapsed 85%CPU
>
> The improvement in system time is nice.
>
Er, there's not much difference...
Curious, what happens when you compile using gcc 3.0.1 against
-march=athlon?
M. R.
>>>>> "M" == M R Brown <[email protected]> writes:
M> Curious, what happens when you compile using gcc 3.0.1 against
M> -march=athlon?
Is it safe to use gcc-3.0.2 to compile the kernel?
* [email protected] <[email protected]> on Wed, Dec 19, 2001:
> >>>>> "M" == M R Brown <[email protected]> writes:
>
>
> M> Curious, what happens when you compile using gcc 3.0.1 against
> M> -march=athlon?
>
> Is it safe to use gcc-3.0.2 to compile the kernel?
Absolutely not. There was at least one reported ICE (internal compiler
error) with drivers/net/8139too.c. Stick to the 2.95.x series.
M. R.
"M. R. Brown" wrote:
> * [email protected] <[email protected]> on Wed, Dec 19, 2001:
>
> > Is it safe to use gcc-3.0.2 to compile the kernel?
>
> Absolutely not. There was at least one reported ICE (internal compiler
> error) with drivers/net/8139too.c. Stick to the 2.95.x series.
BTW 2.96 is fine also -
cu
jjs
On approximately Wed, Dec 19, 2001 at 10:52:40AM -0800, J Sloan wrote:
> "M. R. Brown" wrote:
>
> > * [email protected] <[email protected]> on Wed, Dec 19, 2001:
> >
> > > Is it safe to use gcc-3.0.2 to compile the kernel?
Just another side note, gcc-3.0.3 prerelease is out, and it compiles kernels fine here so far.
Josh
--
Linux, the choice | Ever feel like life was a game and you had
of a GNU generation -o) | the wrong instruction book?
Kernel 2.4.17-rc2 /\ |
on a i586 _\_v |
|
"M. R. Brown" wrote:
> There is no 2.96 except the Red Hat maintained version of GCC
IIRC mandrake ships it also -
> but if
> you're saying that Red Hat's compiler works, more power to you.
Not only me, but such notables as Alan Cox -
It's a fine compiler, and I'm a bit puzzled at the
anti-gcc-2.96 hysteria - aside from some initial
bugs (quickly fixed) in the old guiness release.
Here's a heads-up for those interested -
http://www.bero.org/gcc296.html
Regards,
jjs
* J Sloan <[email protected]> on Wed, Dec 19, 2001:
> "M. R. Brown" wrote:
>
> > * [email protected] <[email protected]> on Wed, Dec 19, 2001:
> >
> > > Is it safe to use gcc-3.0.2 to compile the kernel?
> >
> > Absolutely not. There was at least one reported ICE (internal compiler
> > error) with drivers/net/8139too.c. Stick to the 2.95.x series.
>
> BTW 2.96 is fine also -
>
There is no 2.96 except the Red Hat maintained version of GCC, but if
you're saying that Red Hat's compiler works, more power to you.
M. R.
On Wednesday 19 December 2001 19:39, [email protected] wrote:
> >>>>> "M" == M R Brown <[email protected]> writes:
>
> M> Curious, what happens when you compile using gcc 3.0.1 against
> M> -march=athlon?
>
> Is it safe to use gcc-3.0.2 to compile the kernel?
>
If it compiles.. Otherwise use gcc-3.0.3(prerelease), it has fixes that makes
the _current_ kernel compile.
<sarcasm>
Obviously it's still full of bugs, it wouldn't really be gcc if it wasn't.
</sarcasm>
I am currently running a linux-2.4.16-gcc3, where the only changed part is
the use of the gcc-3.0 compiler, and a -foptimize-siblings-calls flag. It's
running smoothly, although I havn't done any performance test yet.
Btw. I havent found anything that compiles with gcc-3.1 yet.
Hello all :))
>> Is it safe to use gcc-3.0.2 to compile the kernel?
>If it compiles.. Otherwise use gcc-3.0.3(prerelease), it has fixes that makes
>the _current_ kernel compile.
I've using gcc-3.0.1 to compile the kernel since it was released
and my linux 2.4.16 runs without problems. In my experience, the only
problem is the ICE raised by the 8139too driver, although this seems
to have been corrected on gcc-3.0.2 (I haven't updated my compiler
yet). I haven't found any bug yet running my linux box, but this
doesn't mean that gcc-3.0 is safe for the kernel. It's safe for my
configuration of the kernel, at least.
Ra?l
"M. R. Brown" <[email protected]> writes:
> * Benoit Poulot-Cazajous <[email protected]> on Wed, Dec 19, 2001:
>
> >
> > But gcc-2.95,x _supports_ "-march=k6", and we should use that instead of
> > "-march-i686".
> >
>
> No, k6 != athlon. IIRC, the i686 optimization is closer to the Athlon than
> the k6 opt.
In theory, you may be right. But gcc-2.95.3 may not follow the theory.
> > before the patch :
> > 1017.92user 261.80system 24:39.89elapsed 86%CPU
> > 706.33user 160.79system 16:23.61elapsed 88%CPU
> > 1787.38user 418.76system 43:35.97elapsed 84%CPU
> >
> > after the patch :
> > 1018.42user 253.85system 24:44.68elapsed 85%CPU
> > 704.89user 151.76system 16:16.14elapsed 87%CPU
> > 1786.96user 410.76system 43:05.32elapsed 85%CPU
> >
> > The improvement in system time is nice.
> >
>
> Er, there's not much difference...
>From 261.80 to 253.85 => -3%
>From 160.79 to 151.76 => -6%
>From 418.76 to 410.76 => -2%
So the kernel looks between 2 and 6% faster. Not so bad for a one-line
patch ;-)
> Curious, what happens when you compile using gcc 3.0.1 against
> -march=athlon?
Yep, I will try with gcc 3.0.3.
-- Benoit
Ra?l N??ez de Arenas Coronado wrote:
>
> Hello all :))
>
> >> Is it safe to use gcc-3.0.2 to compile the kernel?
> >If it compiles.. Otherwise use gcc-3.0.3(prerelease), it has fixes that makes
> >the _current_ kernel compile.
>
> I've using gcc-3.0.1 to compile the kernel since it was released
> and my linux 2.4.16 runs without problems. In my experience, the only
> problem is the ICE raised by the 8139too driver, although this seems
> to have been corrected on gcc-3.0.2 (I haven't updated my compiler
> yet). I haven't found any bug yet running my linux box, but this
> doesn't mean that gcc-3.0 is safe for the kernel. It's safe for my
> configuration of the kernel, at least.
Been compiling my kernel with 3.0.2 since the day it was out and have
found no bugs so far. Raul's disclaimer applies in my case too - of
course.
--alessandro
"we live as we dream alone / to break the spell we mix with the others
we were not born in isolation / but sometimes it seems that way"
(R.E.M., live intro to 'World Leader Pretend')