Re: loader breaks with -O2 optimizations

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Josh Carroll
Date: Wednesday, October 31, 2007 - 7:02 am

> Maybe, what happens if you use just -O2 -pipe? -funroll-loops is not an

I encountered the same thing in 7.0-BETA1 and resolved it with an edit
to make.conf, specifically:

.if ! ${.CURDIR:M*/boot/i386/boot2*}
CFLAGS+=-O2 -pipe
CXXFLAGS+=-O2 -pipe
.endif

That way, everything else in world is built with -O2 (which I have
never had a problem with, by the way), but loader's CFLAGS are
retained.

The crux of the problem is that gcc takes the LAST -O option as the
effective one. That is:

gcc -Os ... -O2

is the equivalent of:

gcc -O2 ...

Which is exactly what's happening in this case (the loader Makefile
sets CFLAGS to include -Os to optimize for size).

Short of finding a way to prepend to CFLAGS so that a Makefile's
CFLAGS are appended to what is defined in make.conf, I don't see
another way around this. The make.conf hack seems to work, though.

Regards,
Josh
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
loader breaks with -O2 optimizations, Stephan F. Yaraghchi, (Tue Oct 30, 7:32 am)
Re: loader breaks with -O2 optimizations, Jeremy Chadwick, (Tue Oct 30, 10:36 pm)
Re: loader breaks with -O2 optimizations, Kris Kennaway, (Wed Oct 31, 2:43 am)
Re: loader breaks with -O2 optimizations, Stephan F. Yaraghchi, (Wed Oct 31, 3:03 am)
Re: loader breaks with -O2 optimizations, Dag-Erling Smørgrav, (Wed Oct 31, 6:35 am)
Re: loader breaks with -O2 optimizations, Josh Carroll, (Wed Oct 31, 7:02 am)
Re: loader breaks with -O2 optimizations, Jeremy Chadwick, (Wed Oct 31, 7:30 am)
Re: loader breaks with -O2 optimizations, Oliver Fromme, (Wed Oct 31, 7:52 am)
Re: loader breaks with -O2 optimizations, Kris Kennaway, (Wed Oct 31, 2:31 pm)
Re: loader breaks with -O2 optimizations, Josh Carroll, (Wed Oct 31, 2:35 pm)
Re: loader breaks with -O2 optimizations, Stephan F. Yaraghchi, (Thu Nov 1, 12:19 am)
Re: loader breaks with -O2 optimizations, Stephan F. Yaraghchi, (Thu Nov 1, 12:27 am)
Re: loader breaks with -O2 optimizations, Kris Kennaway, (Thu Nov 1, 2:20 am)
Re: loader breaks with -O2 optimizations, Kris Kennaway, (Thu Nov 1, 2:23 am)
Re: loader breaks with -O2 optimizations, Kris Kennaway, (Thu Nov 1, 2:23 am)
Re: loader breaks with -O2 optimizations, Dag-Erling Smørgrav, (Thu Nov 1, 4:53 am)
Re: loader breaks with -O2 optimizations, Dag-Erling Smørgrav, (Thu Nov 1, 4:53 am)
Re: loader breaks with -O2 optimizations, bruce, (Thu Nov 1, 5:27 am)
Re: loader breaks with -O2 optimizations, Oliver Fromme, (Mon Nov 12, 11:15 am)