|
From: Ronald C.F. A. <rc...@cu...> - 2007-03-03 18:22:20
|
Subject says it all. One question, though, that I don't get. In the kernel configuration's "Processor type and features" section, the "Math emulation" help states this: > CONFIG_MATH_EMULATION: > > Linux can emulate a math coprocessor (used for floating point > operations) if you don't have one. 486DX and Pentium processors > have a math coprocessor built in, 486SX and 386 do not, unless you > added a 487DX or 387, respectively. (The messages during boot time > can give you some hints here ["man dmesg"].) Everyone needs either > a coprocessor or this emulation. > > If you don't have a math coprocessor, you need to say Y here; if > you say Y here even though you have a coprocessor, the coprocessor > will be used nevertheless. (This behavior can be changed with the > kernel command line option "no387", which comes handy if your > coprocessor is broken. Try "man bootparam" or see the documentation > of your boot loader (lilo or loadlin) about how to pass options to > the kernel at boot time.) This means that it is a good idea to say > Y here if you intend to use this kernel on different machines. > > More information about the internals of the Linux math coprocessor > emulation can be found in <file:arch/i386/math-emu/README>. > > If you are not sure, say Y; apart from resulting in a 66 KB > biggerkernel, it won't hurt. > > Symbol: MATH_EMULATION [=y] > Prompt: Math emulation > Defined at arch/i386/Kconfig:676 > Location: > -> Processor type and features So if Linux automatically uses a math processor, if present, unless told to do so otherwise, then why on the one hand does the arch/i386/ Makefile specify in the standard kernel the -msoft-float compiler flag, and why do we bother removing it for the xbox if the standard kernel decides it's important to have that option? I mean, either the kernel does the right thing, even with this option, and uses the coprocessor if present, or it doesn't. Somehow, this seems somewhat contradictory to me. I then googled on the subject, and found this here: http://uwsg.iu.edu/hypermail/linux/kernel/0409.1/2266.html > On Wed, Sep 15, 2004 at 02:14:18AM +0600, Denis Zaitsev wrote: >> Why this kernel is always compiled with the FP emulation for x86? >> This is the line from the beginning of arch/i386/Makefile: >> >> CFLAGS += -pipe -msoft-float >> >> And it's hardcoded, it does not depend on CONFIG_MATH_EMULATION. So, >> is this just a typo or not? > > It catches bogus attempts to use floating point in the kernel by > making them error at link-time. So does this mean the kernel is not supposed to use floating point at all, and the -msoft-float forces the compiled to create references to libraries, which then aren't linked and hence cause a link error to catch this problem? If so, shouldn't we stop patching this, and leave the -msoft-float compiler flag where it is and reduce the size of the xbox-linux kernel patch a bit? Ronald |