GCC 4.4 on x86 is able to successfully build Firefox with profile guided
optimization. From my experience so far GCC 4.4 is the only version and
x86 is the only platform where we can do this at the moment.
GCC 4.5 and x86-64 (on 4.4 and 4.5) have some gcc bugs that need fixing.
Since PGO gives us a significant startup performance boost(1) and helps
with other benchmarks, I filed a bug
https://bugzilla.mozilla.org/show_bug.cgi?id=559964 to setup gcc 4.4 on
our build VMs with the aim of enabling pgo in our x86 Linux builds.
Are those bugs filed and planned to be fixed in 4.5.x? One of my secondary
priorities for this quarter is to run static analysis as part of our
standard builds, which is why we switched to GCC 4.3 fairly recently with
plugin support. Since GCC 4.4 doesn't have plugin support, and treehydra
doesn't work ith GCC 4.5 yet, it seems like this change is at odds with that.
We could of course build the debug builds with static analysis on GCC 4.3
and the release builds without static analysis on GCC 4.4, but if we can do
a little work and get all the way to GCC 4.5, we can have both and can avoid
switching compiler yet again later.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43773 is the 4.5 pgo bug.I
haven't filed the x86_64 issues.
> We could of course build the debug builds with static analysis on GCC
> 4.3 and the release builds without static analysis on GCC 4.4, but if we
> can do a little work and get all the way to GCC 4.5, we can have both
> and can avoid switching compiler yet again later.
That would be nice. I think we should be able to port the static
analysis libraries over by the end of summer. I think GCC 4.5.0 is a
huge step forward for GCC and as such it might have more bugs than usual
to iron out, so I'm not in a big rush.
The reason I'm advocating a 4.4 switch is because it makes a huge
difference to real users now. I'd like to deploy x86 pgo now so we learn
of any potential downsides (and communicate them upstream to gcc) asap.
Once x86 is done, mobile should be the next pgo frontier as the benefits
should be even greater there.
Yeah ok. Turns out we can build with PGO on gcc 4.5(for x86 and x86_64)
with a few source changes(bug 560897). Then another workaround is needed
to avoid linking against new libstdc++ features (bug 559964).
Lets get 4.5 deployed!
I also fixed up Treehydra to compile with gcc 4.5. It still needs a lot
of tlc to make all of the tests pass(ie porting of ESP, etc to updated
For profile guided optimization builds, does it only help Firefox
application (i.e. firefox-bin)?
Or it will optimize Gecko (e.g. libxul.so) so that 3rd party
application which embeds Gecko will benefit from it?