Bug 1473436 - Disable elfhack on local builds. r=chmanchester
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 05 Jul 2018 09:23:56 +0900
changeset 425264 bf4739550b9ddd556dd0f606496b31fbfcdb5954
parent 425263 de7abe2c2b3e8713aef98947b8cb784e4628c009
child 425265 dbeb248015ccd9779e4c9625c2086afd31d7970f
push id34241
push userebalazs@mozilla.com
push dateFri, 06 Jul 2018 09:45:16 +0000
treeherdermozilla-central@80d8f267abd8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1473436, 1423822
milestone63.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 1473436 - Disable elfhack on local builds. r=chmanchester Because of bug 1423822, we can't enable elfhack and lld at the same time. OTOH, elfhack is not really useful on local builds: it's only used on `make package`. Since we're going to make lld the default if it's available, let's just completely disable elfhack by default on local builds. While here, hide the configure flag when compile environment is disabled.
toolkit/moz.configure
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -1173,26 +1173,32 @@ def enable_asan_reporter(value):
         return True
 
 set_config('MOZ_ASAN_REPORTER', enable_asan_reporter)
 set_define('MOZ_ASAN_REPORTER', enable_asan_reporter)
 add_old_configure_assignment('MOZ_ASAN_REPORTER', enable_asan_reporter)
 
 # Elfhack
 # ==============================================================
-@depends(host, target)
-def has_elfhack(host, target):
-    return target.kernel == 'Linux' and host.kernel == 'Linux' and \
-           target.cpu in ('arm', 'x86', 'x86_64')
+with only_when('--enable-compile-environment'):
+    @depends(host, target)
+    def has_elfhack(host, target):
+        return target.kernel == 'Linux' and host.kernel == 'Linux' and \
+               target.cpu in ('arm', 'x86', 'x86_64')
 
-with only_when(has_elfhack):
-    option('--disable-elf-hack', help='Disable elf hacks')
+    @depends('--enable-release')
+    def default_elfhack(release):
+        return bool(release)
 
-    set_config('USE_ELF_HACK',
-               depends_if('--enable-elf-hack')(lambda _: True))
+    with only_when(has_elfhack):
+        option('--disable-elf-hack', default=default_elfhack,
+               help='Disable elf hacks')
+
+        set_config('USE_ELF_HACK',
+                   depends_if('--enable-elf-hack')(lambda _: True))
 
 
 @depends(check_build_environment)
 def idl_roots(build_env):
     return namespace(ipdl_root=os.path.join(build_env.topobjdir, 'ipc', 'ipdl'),
                      webidl_root=os.path.join(build_env.topobjdir,
                                               'dom', 'bindings'))