Bug 1555346 - require llvm-profdata when using pgo with clang{,-cl}; r=dmajor
☠☠ backed out by af3b6cb90e03 ☠ ☠
authorNathan Froyd <froydnj@mozilla.com>
Wed, 29 May 2019 15:59:18 +0000
changeset 476079 f593f5a5bfa3b1b32488eaeaefb6638c0c6c06e7
parent 476078 4c3805e7eb8bfd6ecdb03fa93c773f6d07d6e781
child 476080 c6c250b477a0fb9ce3f61f0b5067c49f79cc8a2c
push id36084
push usershindli@mozilla.com
push dateWed, 29 May 2019 21:50:20 +0000
treeherdermozilla-central@4b3431481d55 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor
bugs1555346
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1555346 - require llvm-profdata when using pgo with clang{,-cl}; r=dmajor Detecting problems earlier is better than detecting them later. Differential Revision: https://phabricator.services.mozilla.com/D33013
build/moz.configure/checks.configure
build/moz.configure/toolchain.configure
--- a/build/moz.configure/checks.configure
+++ b/build/moz.configure/checks.configure
@@ -120,20 +120,21 @@ def check_prog(var, progs, what=None, in
         option(env=var, nargs=1, when=when,
                help='Path to %s' % (what or 'the %s program' % var.lower()))
         input = var
     what = what or var.lower()
 
     # Trick to make a @depends function out of an immediate value.
     progs = dependable(progs)
     paths = dependable(paths)
+    allow_missing = dependable(allow_missing)
 
-    @depends_if(input, progs, paths, when=when)
+    @depends_if(input, progs, paths, allow_missing, when=when)
     @checking('for %s' % what, lambda x: quote(x) if x else 'not found')
-    def check(value, progs, paths):
+    def check(value, progs, paths, allow_missing):
         if progs is None:
             progs = ()
 
         if not isinstance(progs, (tuple, list)):
             configure_error('progs must resolve to a list or tuple!')
 
         if paths_have_priority:
             for path in paths:
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1451,18 +1451,28 @@ set_config('PREPROCESS_OPTION', preproce
 def is_windows(target, host):
     return host.kernel == 'WINNT' and target.kernel == 'WINNT'
 
 
 include('windows.configure', when=is_windows)
 
 # PGO
 # ==============================================================
-llvm_profdata = check_prog('LLVM_PROFDATA', ['llvm-profdata'],
-                           allow_missing=True,
+@depends('MOZ_PGO', c_compiler)
+def allow_missing_llvm_profdata(pgo, compiler):
+    if not pgo:
+        return True
+
+    if compiler.type in ('clang', 'clang-cl'):
+        return False
+
+    return True
+
+llvm_profdata = check_prog('LLVM_PROFDATA', ['llvm-profdata'], what='llvm-profdata',
+                           allow_missing=allow_missing_llvm_profdata,
                            paths=toolchain_search_path)
 
 js_option('--enable-profile-generate',
           help='Build a PGO instrumented binary')
 
 imply_option('MOZ_PGO',
              depends_if('--enable-profile-generate')(lambda _: True))