Commit 554a8c64 authored by Mike Shal's avatar Mike Shal
Browse files

Bug 1563403 - disable LTO on --enable-profile-generate;...

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

--HG--
extra : moz-landing-system : lando
parent dfba5de9
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -160,15 +160,19 @@ js_option(env='MOZ_LD64_KNOWN_GOOD',

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.