Bug 1563403 - disable LTO on --enable-profile-generate; r=firefox-build-system-reviewers,chmanchester
authorMike Shal <mshal@mozilla.com>
Fri, 06 Dec 2019 01:03:25 +0000
changeset 567935 17c3d10bb8dd90b59f7a93099449856ac0ffd23a
parent 567934 e7a4f4ed6b1f87012737ed249f826cf85ae4ddd2
child 567936 ad679d570e5283c1375791dc8b1f84f43e535ad4
push id12493
push userffxbld-merge
push dateMon, 06 Jan 2020 15:38:57 +0000
treeherdermozilla-beta@63ae456b848d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfirefox-build-system-reviewers, chmanchester
bugs1563403
milestone73.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 1563403 - disable LTO on --enable-profile-generate; r=firefox-build-system-reviewers,chmanchester In automation this is normally handled by mozconfigs, but we should disable it automatically during the profile-generate stage for users if they have LTO enabled in their mozconfig while doing a 3-tier PGO build. Differential Revision: https://phabricator.services.mozilla.com/D50097
build/moz.configure/lto-pgo.configure
--- a/build/moz.configure/lto-pgo.configure
+++ b/build/moz.configure/lto-pgo.configure
@@ -155,25 +155,29 @@ js_option('--enable-lto',
           help='Enable LTO')
 
 js_option(env='MOZ_LD64_KNOWN_GOOD',
           nargs=1,
           help='Indicate that ld64 is free of symbol aliasing bugs.')
 
 imply_option('MOZ_LD64_KNOWN_GOOD', depends_if('MOZ_AUTOMATION')(lambda _: True))
 
-@depends('--enable-lto', c_compiler, 'MOZ_LD64_KNOWN_GOOD', target)
+@depends('--enable-lto', c_compiler, 'MOZ_LD64_KNOWN_GOOD', target, '--enable-profile-generate')
 @imports('multiprocessing')
-def lto(value, c_compiler, ld64_known_good, target):
+def lto(value, c_compiler, ld64_known_good, target, instrumented_build):
     cflags = []
     ldflags = []
     enabled = None
     rust_lto = False
 
     if value:
+        if instrumented_build:
+            log.warning('Disabling LTO because --enable-profile-generate is specified')
+            return
+
         enabled = True
         # `cross` implies `thin`, but with Rust code participating in LTO
         # as well.  Make that a little more explicit.
         if len(value) and value[0].lower() == 'cross':
             if c_compiler.type == 'gcc':
                 die('Cross-language LTO is not supported with GCC.')
 
             rust_lto = True