Re: loader breaks with -O2 optimizations



Stephan F. Yaraghchi wrote:
On 10/31/07, Kris Kennaway <kris@xxxxxxxxxxx> wrote:
Stephan F. Yaraghchi wrote:
After making world on a freshly installed 7.0-BETA1
the system does not boot anymore due to a broken loader:


FreeBSD/i386 bootstrap loader, Revision 1.1
(root@bigblue, Tue Oct 30 11:26:32 CET 2007)
Can't work out which disk we are booting from.
Guessed BIOS device 0xffffffff not found by probes defaulting to disk0:

panic: free: guard1 fail@ 0x6ded4 from
/usr/src/sys/boot/i386/loader/../../common/module.c:959

--> Press a key on the console to reboot <--


I found out that the following line in my make.conf causes
the problem:

CFLAGS= -O2 -funroll-loops -pipe


After changing down to -O1 and making /usr/src/sys/boot again
the systems behaves properly at boot.

Is this behavior intended?
Maybe, what happens if you use just -O2 -pipe? -funroll-loops is not an
appropriate thing to be using globally anyway, unless your intention is
to randomly make some code slower.

Kris


Hi Kris,

I tried all possible combinations of these switches -- only -O2 led to
the described
behaviour.

Presumably you mean -O2 -funroll-loops, not -O2. Or are you saying the latter also breaks the loader?

Anyway, it's very interesting to hear that adding these optimizations
to make.conf
is not recommended, even that -funroll-loops is possibly slowing down
certain code.

I'm sure many people use it since it's a common tuning tip found on the web.
I read about it in Dru Lavigne's "BSD Hacks" (O'Reilly)...

Yes, unfortunately it's bogus advice. What does she say this option is good for?

Kris
_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: loader breaks with -O2 optimizations
    ... > the system does not boot anymore due to a broken loader: ... Does the loader still ... Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. ... Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: ...
    (freebsd-current)
  • Re: loader breaks with -O2 optimizations
    ... the system does not boot anymore due to a broken loader: ... FreeBSD/i386 bootstrap loader, Revision 1.1 ... "BSD Hacks" is a collection of hacks compiled by Dru. ...
    (freebsd-current)
  • Re: loader breaks with -O2 optimizations
    ... the system does not boot anymore due to a broken loader: ... FreeBSD/i386 bootstrap loader, Revision 1.1 ... "BSD Hacks" is a collection of hacks compiled by Dru. ...
    (freebsd-current)
  • Re: 5.2-rc1 Install
    ... >at least with the first boot volume. ... or loader itself is getting confused because of the ... >where X is the disk number, ... port 2 powered ...
    (freebsd-current)
  • Re: 5.2-rc1 Install
    ... >at least with the first boot volume. ... or loader itself is getting confused because of the ... >where X is the disk number, ... port 2 powered ...
    (freebsd-questions)