HEADS UP: Ports are not ready for CFLAGS=-O2 in 6.0

Kris Kennaway kris at obsecurity.org
Fri Nov 5 14:07:52 PST 2004


On Fri, Nov 05, 2004 at 04:56:03PM -0500, Michael Johnson wrote:
> 
> On Nov 5, 2004, at 4:52 PM, Kris Kennaway wrote:
> 
> >On Fri, Nov 05, 2004 at 09:19:08AM +0100, Bjarne Wichmann Petersen 
> >wrote:
> >>On Wednesday 03 November 2004 23:49, Michael Johnson wrote:
> >>>On Wed, 2004-11-03 at 15:47 -0700, Jie Gao wrote:
> >>>>I just wonder if it is safe to use -O2 -pipe for kernel + world on
> >>>>5-STABLE now.
> >>>works okay for me
> >>
> >>And ports on 5-STABLE?
> 
> >Same as on 6.x - the bugs are in the ports themselves.  Don't do it if
> >you want your ports to work correctly.
> 
> Is there a list of what's broke with -O2 in ports anywhere?

Some of the bugs are probably silent.  For example, different versions
of gcc sometimes have bugs at higher optimization levels or with
certain CPUTYPE values.

gcc 3.4 will warn about aliasing bugs (grep for "type-punning" in the
logs) with -O2.  I don't know if it always warns, or if you have to
enable the warning with -Wmumble.  In the last 6.0 build there were
about 360 packages that emitted such warnings.

-O2 will also cause build errors in other ways, e.g. if functions in a
library are improperly declared static and not referenced internally
(but are referenced externally by another application trying to link
with the library), since -O2 may optimize them out completely.

Kris


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20041105/44797f1f/attachment.bin


More information about the freebsd-current mailing list