try: -b o -p linux64-pgo -t all -u none --rebuild-talos 10 draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 08 Aug 2018 11:08:48 +0900
changeset 1660840 b36c4452f91d975dc58e4d0a1b972fb4a78f2c32
parent 1660839 1de66d36ae58a85238102e765a253bb8fb826089
child 1881448 dbada66189d96d71a011783b407165a11394ced9
push id289846
push usermh@glandium.org
push dateWed, 08 Aug 2018 02:09:20 +0000
treeherdertry@b36c4452f91d [default view] [failures only]
milestone63.0a1
try: -b o -p linux64-pgo -t all -u none --rebuild-talos 10
Makefile.in
build/moz.configure/toolchain.configure
--- a/Makefile.in
+++ b/Makefile.in
@@ -307,17 +307,17 @@ package-generated-sources:
 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
 # No point in clobbering if PGO has been explicitly disabled.
 ifndef NO_PROFILE_GUIDED_OPTIMIZE
 maybe_clobber_profiledbuild: clean
 else
 maybe_clobber_profiledbuild:
 endif
 else
-ifdef CLANG_CL
+ifneq (,$(findstring clang,$(CC_TYPE)))
 maybe_clobber_profiledbuild: clean
 # 32-bit PGO is currently blocked by bug 1479800
 ifeq ($(CPU_ARCH),x86_64)
 	$(LLVM_PROFDATA) merge -o $(DEPTH)/merged.profdata $(DEPTH)/*.profraw
 endif
 else
 maybe_clobber_profiledbuild:
 	$(RM) $(DIST)/bin/*.pgc
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1245,36 +1245,41 @@ set_config('VISIBILITY_FLAGS', visibilit
 @depends(c_compiler, check_build_environment, target)
 @imports('multiprocessing')
 @imports(_from='__builtin__', _import='min')
 def pgo_flags(compiler, build_env, target):
     topobjdir = build_env.topobjdir
     if topobjdir.endswith('/js/src'):
         topobjdir = topobjdir[:-7]
 
-    if compiler.type in ('gcc', 'clang'):
+    if compiler.type == 'gcc':
         return namespace(
             gen_cflags=['-fprofile-generate'],
             gen_ldflags=['-fprofile-generate'],
             use_cflags=['-fprofile-use', '-fprofile-correction',
                         '-Wcoverage-mismatch'],
             use_ldflags=['-fprofile-use'],
         )
 
-    if compiler.type == 'clang-cl':
+    if compiler.type in ('clang-cl', 'clang'):
         profdata = os.path.join(topobjdir, 'merged.profdata')
         # 32-bit PGO is currently blocked by bug 1479800
         if target.cpu == 'x86_64':
-          return namespace(
-              gen_cflags=['-fprofile-instr-generate'],
-              gen_ldflags=['clang_rt.profile-x86_64.lib'],
-              use_cflags=['-fprofile-instr-use=%s' % profdata,
-                          '-Wno-error=profile-instr-unprofiled'],
-              use_ldflags=[],
-          )
+            if compiler.type == 'clang-cl':
+                gen_ldflags = ['clang_rt.profile-x86_64.lib']
+            else:
+                gen_ldflags = ['-fprofile-instr-generate']
+
+            return namespace(
+                gen_cflags=['-fprofile-instr-generate'],
+                gen_ldflags=gen_ldflags,
+                use_cflags=['-fprofile-instr-use=%s' % profdata,
+                            '-Wno-error=profile-instr-unprofiled'],
+                use_ldflags=[],
+            )
 
     if compiler.type == 'msvc':
         num_cores = min(8, multiprocessing.cpu_count())
         cgthreads = '-CGTHREADS:%s' % num_cores
 
         return namespace(
             gen_cflags=['-GL'],
             gen_ldflags=['-LTCG:PGINSTRUMENT', '-PogoSafeMode', cgthreads],