public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc and the kernel
@ 2008-12-29 20:38 Brian O'Mahoney
  2008-12-30  1:54 ` Steven Bosscher
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Brian O'Mahoney @ 2008-12-29 20:38 UTC (permalink / raw)
  To: gcc; +Cc: opensuse, gcc-help

OK, there are a few more things to say about gcc, and the kernel, and 
distributions (also the way patches to both work, to both).

Stipulations: (a) I always try to run the current stable kernel, released by
the 'stable-team' led by GKH. But he is getting too good, stable is
2.6.27.10 but I am running 2.6.27.7 and 2.6.28 is too bleeding edge.
(b) I am running a very heavily patched SuSE 11.0 but I have the 'SuSE
build factory' in my Yast list so for lots of things I am actually executing
SuSE 11.2 alpha code. My system gcc is:

gcc -v
Using built-in specs.
Target: x86_64-suse-linux
Configured 
with: ../configure --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3 --enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE 
Linux' --disable-libgcj --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --program-suffix=-4.3 --enable-version-specific-runtime-libs --enable-linux-futex --without-system-libunwind --with-cpu=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.3.2 20080715 (prerelease) [gcc-4_3-branch revision 137837]
 (SUSE Linux)

ie not to shabby, but __NOT__ too new either, and note it is a SuSE special: 
4.3.2 20080715 (prerelease) [gcc-4_3-branch revision 137837], and you would
need to look at the (s)rpm in the 11.0 source repository to see what they
changed, ... but also see below.

But I happen, right now, to need the VERY latest gcc, 
so /opt/gcc-4.4-20081219/bin/gcc is a recent snapshot and I can select it
either in my PATH or with 'export GCC=/opt/gcc-4.4-20081219/bin/gcc' etc

SO

(1) The kernel dosn't use the latest gcc, and even quite old gcc's compile the 
kernel

(2) Kernel space code is not the same, ie the same (binary)API as user space 
and gets interrupts, so some user space optimizations are always turned off 
in the kernel, grep lkml/google for Tovolds+alias to read an old flame-war.

(3) if a gcc compiles 2.6.x it will normally compile 2.6.x.y ie the patch 
releases.

(4) I think there is someone on the Debian integration team who tries to build 
the latest kernels with the latest gcc, he finds lots of problems and submits 
bugs to both camps. I dont envy him.

Last, a word to the wise, compiler developers, are by nature fairly agressive 
but, unless you want to work on gcc itself, it is wise to stay a bit behind 
the bleeding edge, and, unless your systems are excellently backed up,
___DONT_BUILD_THE_KERNEL___ with and untested gcc. I mean a kernel you are 
going to try to run. For an example of why not see the 'ix68 string 
direction' fiasco noting that an interrupt can happen anywhere and that the 
CPU x flag is a non-deterministic (to the interrupt code) part of the 
interrupted context. Oh what fun!

[snip from LWN.NET]

"Since version 4.3, gcc changed its behaviour concerning the x86/x86-64 
ABI and the direction flag, that is it now assumes that the direction 
flag is cleared at the entry of a function and it doesn't clear once 
more if needed.

This causes some problems with the Linux kernel which does not clear
the direction flag when entering a signal handler. The small code below
(for x86-64) demonstrates that. ..." If you dont know see www.lwn.net.

-- 
Greetings, Brian

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

* Re: gcc and the kernel
  2008-12-29 20:38 gcc and the kernel Brian O'Mahoney
@ 2008-12-30  1:54 ` Steven Bosscher
  2008-12-30  9:57 ` Andi Kleen
  2008-12-30 10:01 ` Andrew Haley
  2 siblings, 0 replies; 4+ messages in thread
From: Steven Bosscher @ 2008-12-30  1:54 UTC (permalink / raw)
  To: Brian O'Mahoney; +Cc: gcc, opensuse, gcc-help

On Mon, Dec 29, 2008 at 9:22 PM, Brian O'Mahoney <omb@bluewin.ch> wrote:
> OK, there are a few more things to say about gcc, and the kernel, and
> distributions (also the way patches to both work, to both).
>
> Stipulations: (a) I always try to run the current stable kernel, released by
> the 'stable-team' led by GKH. But he is getting too good, stable is
> 2.6.27.10 but I am running 2.6.27.7 and 2.6.28 is too bleeding edge.
> (b) I am running a very heavily patched SuSE 11.0 but I have the 'SuSE
> build factory' in my Yast list so for lots of things I am actually executing
> SuSE 11.2 alpha code. My system gcc is:
>
> gcc -v
> Using built-in specs.
> Target: x86_64-suse-linux
> Configured
> with: ../configure --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3 --enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE
> Linux' --disable-libgcj --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --program-suffix=-4.3 --enable-version-specific-runtime-libs --enable-linux-futex --without-system-libunwind --with-cpu=generic --build=x86_64-suse-linux
> Thread model: posix
> gcc version 4.3.2 20080715 (prerelease) [gcc-4_3-branch revision 137837]
>  (SUSE Linux)
>
> ie not to shabby, but __NOT__ too new either, and note it is a SuSE special:
> 4.3.2 20080715 (prerelease) [gcc-4_3-branch revision 137837], and you would
> need to look at the (s)rpm in the 11.0 source repository to see what they
> changed, ... but also see below.
>
> But I happen, right now, to need the VERY latest gcc,
> so /opt/gcc-4.4-20081219/bin/gcc is a recent snapshot and I can select it
> either in my PATH or with 'export GCC=/opt/gcc-4.4-20081219/bin/gcc' etc
>
> SO
>
> (1) The kernel dosn't use the latest gcc, and even quite old gcc's compile the
> kernel
>
> (2) Kernel space code is not the same, ie the same (binary)API as user space
> and gets interrupts, so some user space optimizations are always turned off
> in the kernel, grep lkml/google for Tovolds+alias to read an old flame-war.
>
> (3) if a gcc compiles 2.6.x it will normally compile 2.6.x.y ie the patch
> releases.
>
> (4) I think there is someone on the Debian integration team who tries to build
> the latest kernels with the latest gcc, he finds lots of problems and submits
> bugs to both camps. I dont envy him.
>
> Last, a word to the wise, compiler developers, are by nature fairly agressive
> but, unless you want to work on gcc itself, it is wise to stay a bit behind
> the bleeding edge, and, unless your systems are excellently backed up,
> ___DONT_BUILD_THE_KERNEL___ with and untested gcc. I mean a kernel you are
> going to try to run. For an example of why not see the 'ix68 string
> direction' fiasco noting that an interrupt can happen anywhere and that the
> CPU x flag is a non-deterministic (to the interrupt code) part of the
> interrupted context. Oh what fun!
>
> [snip from LWN.NET]
>
> "Since version 4.3, gcc changed its behaviour concerning the x86/x86-64
> ABI and the direction flag, that is it now assumes that the direction
> flag is cleared at the entry of a function and it doesn't clear once
> more if needed.
>
> This causes some problems with the Linux kernel which does not clear
> the direction flag when entering a signal handler. The small code below
> (for x86-64) demonstrates that. ..." If you dont know see www.lwn.net.
>
> --
> Greetings, Brian
>

So, after all these words (congrats on your nice system), what did you
want to say?

Gr.
Steven

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

* Re: gcc and the kernel
  2008-12-29 20:38 gcc and the kernel Brian O'Mahoney
  2008-12-30  1:54 ` Steven Bosscher
@ 2008-12-30  9:57 ` Andi Kleen
  2008-12-30 10:01 ` Andrew Haley
  2 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2008-12-30  9:57 UTC (permalink / raw)
  To: Brian O'Mahoney; +Cc: gcc, opensuse, gcc-help

"Brian O'Mahoney" <omb@bluewin.ch> writes:
>
> Last, a word to the wise, compiler developers, are by nature fairly agressive 
> but, unless you want to work on gcc itself, it is wise to stay a bit behind 
> the bleeding edge, and, unless your systems are excellently backed up,
> ___DONT_BUILD_THE_KERNEL___ with and untested gcc. I mean a kernel you are 
> going to try to run. For an example of why not see the 'ix68 string 
> direction' fiasco noting that an interrupt can happen anywhere and that the 
> CPU x flag is a non-deterministic (to the interrupt code) part of the 
> interrupted context. Oh what fun!

This particular problem has nothing to do with the compiler that built the
kernel.

-Andi
-- 
ak@linux.intel.com

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

* Re: gcc and the kernel
  2008-12-29 20:38 gcc and the kernel Brian O'Mahoney
  2008-12-30  1:54 ` Steven Bosscher
  2008-12-30  9:57 ` Andi Kleen
@ 2008-12-30 10:01 ` Andrew Haley
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Haley @ 2008-12-30 10:01 UTC (permalink / raw)
  To: Brian O'Mahoney; +Cc: gcc-help

Brian O'Mahoney wrote:

Please don't cross-post to gcc- and gcc-help

> "Since version 4.3, gcc changed its behaviour concerning the x86/x86-64 
> ABI and the direction flag, that is it now assumes that the direction 
> flag is cleared at the entry of a function and it doesn't clear once 
> more if needed.
> 
> This causes some problems with the Linux kernel which does not clear
> the direction flag when entering a signal handler. The small code below
> (for x86-64) demonstrates that. ..." If you dont know see www.lwn.net.

Just to save everyone's time: this kernel bug is long (well, since March)
fixed.

Andrew.

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

end of thread, other threads:[~2008-12-30  9:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-29 20:38 gcc and the kernel Brian O'Mahoney
2008-12-30  1:54 ` Steven Bosscher
2008-12-30  9:57 ` Andi Kleen
2008-12-30 10:01 ` Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).