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
This commit is contained in:
Mike Shal 2019-12-06 01:03:25 +00:00
Родитель dfba5de9ef
Коммит 554a8c6462
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -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.