bug 1250971 - pass cgthreads with number of cores for Windows PGO builds. r?gps draft
authorTed Mielczarek <ted@mielczarek.org>
Wed, 24 Feb 2016 10:27:27 -0800
changeset 334351 11f4ec10f94338e7af283164dc1300e7cd96233b
parent 334172 8a2c2d8fc91f7014c701db6ee7d15b2a1b461b01
child 514887 f6463a9bc9a4892e3a843e8126c817d9f4457f20
push id11518
push usertmielczarek@mozilla.com
push dateWed, 24 Feb 2016 23:56:38 +0000
reviewersgps
bugs1250971
milestone47.0a1
bug 1250971 - pass cgthreads with number of cores for Windows PGO builds. r?gps MozReview-Commit-ID: Hf5QoDHXPUz
configure.in
--- a/configure.in
+++ b/configure.in
@@ -2187,28 +2187,30 @@ ia64*-hpux*)
         MOZ_FIX_LINK_PATHS=
         MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
         LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
         if test -z "$DEVELOPER_OPTIONS"; then
             LDFLAGS="$LDFLAGS -RELEASE"
         fi
         dnl For profile-guided optimization
         PROFILE_GEN_CFLAGS="-GL"
-        PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
+        num_cores=$($PYTHON -c 'import multiprocessing; print(min(8,multiprocessing.cpu_count()))')
+        cgthreads="-CGTHREADS${num_cores}"
+        PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT $cgthreads"
         dnl XXX: PGO builds can fail with warnings treated as errors,
         dnl specifically "no profile data available" appears to be
         dnl treated as an error sometimes. This might be a consequence
         dnl of using WARNINGS_AS_ERRORS in some modules, combined
         dnl with the linker doing most of the work in the whole-program
         dnl optimization/PGO case. I think it's probably a compiler bug,
         dnl but we work around it here.
         PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
         dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
         dnl Probably also a compiler bug, but what can you do?
-        PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
+        PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE $cgthreads"
         LDFLAGS="$LDFLAGS -DYNAMICBASE"
         RCFLAGS="-nologo"
         if test "$_CC_MAJOR_VERSION" = "18" -a "$_CC_BUILD_VERSION" = "31101"; then
             dnl Use MaxILKSize as a workaround for LNK1248 in VS2013update4
             dnl See https://connect.microsoft.com/VisualStudio/feedback/details/1044914/fatal-error-lnk1248
             LDFLAGS="$LDFLAGS -MaxILKSize:0x7FF00000"
         fi
         dnl Minimum reqiurement of Gecko is VS2010 or later which supports