Bug 169479 - www/firefox always adds -O0 to CFLAGS
Summary: www/firefox always adds -O0 to CFLAGS
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-gecko (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-27 10:20 UTC by vsjcfm
Modified: 2012-07-27 14:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vsjcfm 2012-06-27 10:20:06 UTC
www/firefox always adds -O0 to CFLAGS regardless of port options and flags defined in __MAKE_CONF


make.conf:
#
CPUTYPE?=core2
CFLAGS= -O2 -fno-strict-aliasing -pipe
COPTFLAGS= -O2 -pipe
WITHOUT_MODULES= xfs
MAKE_JOBS_NUMBER=5

.if ${.CURDIR:M*/ports/databases/ruby-bdb*}
NOPORTDOCS=
NOPORTEXAMPLES=
.endif

.if ${.CURDIR:M*/ports/print/freetype2*}
WITH_LCD_FILTERING=yes
.endif

.if ${.CURDIR:M*/ports/x11-fonts/webfonts*}
WITH_MSWINDOWS_LICENSE=yes
.endif

# added by use.perl 2012-06-24 13:46:59
PERL_VERSION=5.14.2


www/firefox options:
# This file is auto-generated by 'make config'.
# Options for firefox-13.0.1,1
_OPTIONS_READ=firefox-13.0.1,1
_FILE_COMPLETE_OPTIONS_LIST=DBUS PGO DEBUG LOGGING OPTIMIZED_CFLAGS
OPTIONS_FILE_SET+=DBUS
OPTIONS_FILE_UNSET+=PGO
OPTIONS_FILE_UNSET+=DEBUG
OPTIONS_FILE_UNSET+=LOGGING
OPTIONS_FILE_UNSET+=OPTIMIZED_CFLAGS

Configure log - http://pastebin.com/wDafjAm8

How-To-Repeat: set CFLAGS something like "-O2 -fno-strict-aliasing -pipe" in make.conf, set CPUTYPE to "core2", cd ports/www/firefox and run make configure
You will see:

checking whether the C compiler (cc -O2 -fno-strict-aliasing -pipe -march=core2  -O0    ) works... yes
	-O0? Where it comes from?

You can find "-O0" in:
.mozconfig
config.log
config.status
config/autoconf.mk

and in many other files in subdirectories
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-06-27 10:20:19 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gecko

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Niclas Zeising 2012-06-27 10:28:27 UTC
Currently, Firefox (and other mozilla ports) does not build with base
gcc on higher optimization levels.
Regards!
-- 
Niclas
Comment 3 vsjcfm 2012-06-27 11:15:51 UTC
> Currently, Firefox (and other mozilla ports) does not build with base gcc on higher optimization levels.
Thank you for info.
But this is absolute incorrect way. Ports must not force user to
change his own preferences and build settings.
I think that more correct way is add an option like following:
OPTIMIZATION   Support for optimization levels higher than O0 (needs gcc 4.6+)
And when user selects it, port must pull in required toolchain.
Comment 4 vsjcfm 2012-06-27 11:50:02 UTC
Also, i've removed EXTRA_CFLAGS from makefile and built firefox
successfully using base toolchain from 8.2-RELEASE
Configs above.
Comment 5 Florian Smeets freebsd_committer freebsd_triage 2012-07-27 14:30:31 UTC
State Changed
From-To: open->closed

This should not happen anymore with the latest version