Frank Hofmann - Solaris Sustaining writes: > [ ... ] > > Yes, I feel dumb for not including it, regardless of the docs. I > > should have remembered seeing it scroll by on FreeBSD and Linux > > compilations.. > > > If anybody is to blame, then it's the gcc folks, who have given people > the equivalent of a car airbag that explodes if you turn the steering > wheel at a time when the radio is switched on.
They have something of a history of doing that to me. The first driver I ever did was for Tru64 (then DEC OSF/1). When compiled with gcc & loaded on a machine, applications which used floating point started seriously misbehaving -- floating point exceptions, wrong answers, etc. It turned out that gcc used floating point registers as general purpose registers, so my driver was corrupting the state of the floating point registers (which OSF/1 did not save on kernel entry, since the kernel was not allowed to use floating point). That took weeks to track down & add -mno-fp-regs. > As said, gcc 3.4.4 has finally made "-mno-red-zone" implicit when > using "-mcmodel=kernel". There's some posting on the gcc developers > list by Andi Kleen of Suse, early last year, requesting exactly > that so that people wouldn't shoot themselves in the foot all the > time. I just can't find that posting right now ... > And as said, 3.4.4 came too late to be included as the compiler > that ships with S10 :( That's unfortunate. How do we get the docs at http://iforce.sun.com/protected/solaris10/adoptionkit/x86/techinfo.html updated so the next poor slob does not trip over this? It is hard to make this mistake on FreeBSD or on Linux 2.6, since both have automatic ways for out-of-tree drivers to get the correct kernel compiler flags. Maybe Sun could add something to getconf, so you could get KERNEL_CFLAGS or KERNEL_GCCFLAGS similar to how you can get LFS_CFLAGS.. Drew