Re: Floating point usage
Pavel Roskin wrote: Hello! I tried to compile the current grub on Fedora 9 for PowerPC, but it failed due to floating point usage in ls. Sorry, I don't have the exact message handy. Anyway, there are several references to float and double in the code, and I think it's wrong. GRUB should be able to work on systems with no floating point support and on systems where the floating point device needs to be activated. Even Linux kernel avoids using floating point. If everyone is fine, I'll try to remove all floating point stuff from the code. Hi Pavel, there is no need for hard-float support on the target machine. The libgcc provides all the software-emulation routines. Given that GRUB is linked against it. Which is likely as it is a necessity when compiling with gcc. Maybe your compilation is simply broken because of that one missing. Could you please post the error message? Jan ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Floating point usage
On Thu, 05 Jun 2008 17:23:00 +0200 Stefan Reinauer [EMAIL PROTECTED] wrote: Jan Kleinsorge wrote: Pavel Roskin wrote: Hello! I tried to compile the current grub on Fedora 9 for PowerPC, but it failed due to floating point usage in ls. Sorry, I don't have the exact message handy. Anyway, there are several references to float and double in the code, and I think it's wrong. GRUB should be able to work on systems with no floating point support and on systems where the floating point device needs to be activated. Even Linux kernel avoids using floating point. If everyone is fine, I'll try to remove all floating point stuff from the code. Hi Pavel, there is no need for hard-float support on the target machine. The libgcc provides all the software-emulation routines. Given that GRUB is linked against it. Which is likely as it is a necessity when compiling with gcc. Maybe your compilation is simply broken because of that one missing. Could you please post the error message? Nonetheless, using Floating Point operations in bootloaders and firmware is highly discouraged. If Floating Point is required for a bootloader (except, maybe, possibly, at all, for encryption) the bootloader is definitely broken, either in implementation or in design. Also keep in mind, most operating systems expect the FPU to be in power on state. Stefan The bootloader is broken if it uses floating point arithmetic? I think that while GRUB should not REQUIRE an FPU, it could use software floating point if there was a good reason to do so (and it would not be broken as long is it was done portably). Though I only have minimal knowledge of encryption algorithms, I don't think that floating point math is often used. I think that avoiding floating point math as Pavel Roskin suggested is good, though I don't agree that Stefan's assertion that any use of floating point math is necessarily broken -- it might be better to say that we'd prefer not to pull in softfloat libraries (necessary since many targets have no FPU); therefore it is desirable to avoid floating point math. Colin ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Floating point usage
Le Thursday 05 June 2008 17:12:26 Jan Kleinsorge, vous avez écrit : Given that GRUB is linked against it. Which is likely as it is a necessity when compiling with gcc. ...except if -nostdlib is given to gcc, which is the case in grub2. For the bootloader part at least, grub-emu is another question. And there is an except to this except: If -lgcc is specified it will be used, and it is for the following archs, as far as I can see: - powerpc-ieee1275 - i386-linuxbios - i386-ieee1275 So half the supported archs don't need libgcc, I think it's enough to try avoiding that dependency. -- Vincent Pelletier signature.asc Description: This is a digitally signed message part. ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Floating point usage
Pavel Roskin wrote: Hello! I tried to compile the current grub on Fedora 9 for PowerPC, but it failed due to floating point usage in ls. Sorry, I don't have the exact message handy. Anyway, there are several references to float and double in the code, and I think it's wrong. GRUB should be able to work on systems with no floating point support and on systems where the floating point device needs to be activated. Even Linux kernel avoids using floating point. If everyone is fine, I'll try to remove all floating point stuff from the code. Its only for printing units in human readable format. So its only small arithmetics to get it going nicely with integers. While you are there, can you modify it to use more proper units... MiB , KiB,... ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Floating point usage
On Thu, Jun 05, 2008 at 10:01:38PM +0200, Vincent Pelletier wrote: And there is an except to this except: If -lgcc is specified it will be used, and it is for the following archs, as far as I can see: - powerpc-ieee1275 - i386-linuxbios - i386-ieee1275 Why would i386-linuxbios and i386-ieee1275 need libgcc but i386-pc don't? IIRC the tendency is that CISC platforms tend not to need libgcc for floating point but RISC ones do. Did I make a mistake on these two ports? -- Robert Millan GPLv2 I know my rights; I want my phone call! DRM What good is a phone call… if you are unable to speak? (as seen on /.) ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Re: Floating point usage
Robert Millan wrote: Why would i386-linuxbios and i386-ieee1275 need libgcc but i386-pc don't? IIRC the tendency is that CISC platforms tend not to need libgcc for floating point but RISC ones do. Did I make a mistake on these two ports? Those platforms require libgcc even for double precision integer divisions. It's a bit nasty. -- coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br. Tel.: +49 761 7668825 • Fax: +49 761 7664613 Email: [EMAIL PROTECTED] • http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg • HRB 7656 Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866 ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel
Floating point usage
Hello! I tried to compile the current grub on Fedora 9 for PowerPC, but it failed due to floating point usage in ls. Sorry, I don't have the exact message handy. Anyway, there are several references to float and double in the code, and I think it's wrong. GRUB should be able to work on systems with no floating point support and on systems where the floating point device needs to be activated. Even Linux kernel avoids using floating point. If everyone is fine, I'll try to remove all floating point stuff from the code. -- Regards, Pavel Roskin ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel