Wednesday, November 26, 2008

PGO Patch

I have submitted a patch to for the bug 465592.

The Bug

Currently PGO doesn't work for Thunderbird. For Windows builds the compilation breaks in the LCMS module for the Mozilla core. If PGO is disable for this module then Thunderbird can be built with PGO enabled.

The Patch

After talking with David Humphrey and Ted Mielczarek I modified the Makefile.in in the module/lcms/src directory. To include the following lines.

ifndef MOZ_ENABLE_LIBXUL
NO_PROFILE_GUIDED_OPTIMIZE = 1
endif

The MOZ_ENABLE_LIBXUL flag is used to link libraries into a single xul.dll library. On Firefox this flag is used and a number of libraries are linked in the xul.dll, one of these libraries is the mozlcms.lib. This does not happen with Thunderbird. Instead the libraries are made into DLL's. The mozlcms.dll crashes during the optimization build for PGO.


Checking if the flag has not been set means that the mozlcms.lib will be made into a DLL. Since this will crash if PGO is enabled, the NO_PROFILE_GUIDED_OPTIMIZE is set to disable PGO for this one module.

The Result

Well, it works otherwise I would not have posted the patch. I am waiting on a review.

No comments: