Bug 1457482 Add an LTO Build Target draft
authorTom Ritter <tom@mozilla.com>
Fri, 13 Apr 2018 15:36:12 -0500
changeset 789168 b328964fe03864f799d9ee4898efe5277b12b5c5
parent 789167 8c937ff5f6289e898136870cb39948f14baddebf
child 789169 399e56bfd9ed393f40290374a5688ba761d7d54d
push id108208
push userbmo:tom@mozilla.com
push dateFri, 27 Apr 2018 18:43:07 +0000
bugs1457482
milestone61.0a1
Bug 1457482 Add an LTO Build Target This build target doesn't have LTO enabled on it (yet) MozReview-Commit-ID: 56tAHMyvH7o
browser/config/mozconfigs/linux64/debug-lto
build/unix/mozconfig.lto
taskcluster/ci/build/linux.yml
testing/mozharness/configs/builds/releng_sub_linux_configs/64_lto_tc_and_debug.py
testing/mozharness/mozharness/mozilla/building/buildbase.py
new file mode 100644
--- /dev/null
+++ b/browser/config/mozconfigs/linux64/debug-lto
@@ -0,0 +1,21 @@
+# Use at least -O1 for optimization to avoid stack space
+# exhaustions caused by Clang function inlining.
+ac_add_options --enable-debug
+ac_add_options --enable-optimize="-O1"
+
+. $topsrcdir/build/mozconfig.stylo
+
+. $topsrcdir/build/unix/mozconfig.lto
+
+ac_add_options --disable-elf-hack
+
+# Enable Telemetry
+export MOZ_TELEMETRY_REPORTING=1
+
+# Package js shell.
+export MOZ_PACKAGE_JSSHELL=1
+
+# Need this to prevent name conflicts with the normal nightly build packages
+export MOZ_PKG_SPECIAL=lto
+
+. "$topsrcdir/build/mozconfig.common.override"
new file mode 100644
--- /dev/null
+++ b/build/unix/mozconfig.lto
@@ -0,0 +1,24 @@
+MOZ_AUTOMATION_L10N_CHECK=0
+
+. "$topsrcdir/build/mozconfig.common"
+
+# Use Clang as specified in manifest
+export CC="$topsrcdir/clang/bin/clang -fgnu89-inline"
+export CXX="$topsrcdir/clang/bin/clang++"
+export LLVM_SYMBOLIZER="$topsrcdir/clang/bin/llvm-symbolizer"
+
+# Use a newer binutils, from the tooltool gcc package, if it's there
+if [ -e "$topsrcdir/gcc/bin/ld" ]; then
+    export CC="$CC -B $topsrcdir/gcc/bin"
+    export CXX="$CXX -B $topsrcdir/gcc/bin"
+fi
+
+# Mandatory options that were copied from ASan builds
+export MOZ_DEBUG_SYMBOLS=1
+ac_add_options --enable-debug-symbols
+ac_add_options --disable-install-strip
+ac_add_options --disable-jemalloc
+ac_add_options --disable-crashreporter
+ac_add_options --disable-profiling
+
+. "$topsrcdir/build/unix/mozconfig.stdcxx"
--- a/taskcluster/ci/build/linux.yml
+++ b/taskcluster/ci/build/linux.yml
@@ -585,16 +585,46 @@ linux64-asan/debug:
         tooltool-downloads: public
         need-xvfb: true
     toolchains:
         - linux64-clang-6-pre
         - linux64-gcc
         - linux64-rust
         - linux64-sccache
 
+linux64-lto/debug:
+    description: "Linux64 Debug LTO"
+    index:
+        product: firefox
+        job-name: linux64-lto-debug
+    treeherder:
+        platform: linux64/lto
+        symbol: Bd
+    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
+    worker:
+        env:
+            PERFHERDER_EXTRA_OPTIONS: "debug lto"
+        max-run-time: 36000
+    run:
+        using: mozharness
+        actions: [get-secrets build check-test update]
+        config:
+            - builds/releng_base_firefox.py
+            - builds/releng_base_linux_64_builds.py
+        script: "mozharness/scripts/fx_desktop_build.py"
+        secrets: true
+        custom-build-variant-cfg: lto-tc-and-debug
+        tooltool-downloads: public
+        need-xvfb: true
+    toolchains:
+        - linux64-clang-6-lto-pre
+        - linux64-gcc
+        - linux64-rust
+        - linux64-sccache
+
 linux64-nightly/opt:
     description: "Linux64 Nightly"
     attributes:
         nightly: true
     shipping-phase: build
     shipping-product: firefox
     index:
         product: firefox
new file mode 100644
--- /dev/null
+++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_lto_tc_and_debug.py
@@ -0,0 +1,31 @@
+import os
+
+config = {
+    'default_actions': [
+        'clobber',
+        'build',
+        'check-test',
+        # 'update',
+    ],
+    'stage_platform': 'linux64-lto-debug',
+    'debug_build': True,
+    'enable_signing': False,
+    #### 64 bit build specific #####
+    'env': {
+        'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'),
+        'DISPLAY': ':2',
+        'HG_SHARE_BASE_DIR': '/builds/hg-shared',
+        'MOZ_OBJDIR': '%(abs_obj_dir)s',
+        'TINDERBOX_OUTPUT': '1',
+        'TOOLTOOL_CACHE': '/builds/tooltool_cache',
+        'TOOLTOOL_HOME': '/builds',
+        'MOZ_CRASHREPORTER_NO_REPORT': '1',
+        'LC_ALL': 'C',
+        ## 64 bit specific
+        'PATH': '/usr/local/bin:/usr/lib64/ccache:/bin:\
+/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/tools/git/bin:/tools/python27/bin:\
+/tools/python27-mercurial/bin:/home/cltbld/bin',
+    },
+    'mozconfig_variant': 'debug-lto',
+    #######################
+}
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -414,16 +414,17 @@ class BuildOptionParser(object):
         'cross-debug-artifact': 'builds/releng_sub_%s_configs/%s_cross_debug_artifact.py',
         'cross-noopt-debug': 'builds/releng_sub_%s_configs/%s_cross_noopt_debug.py',
         'cross-fuzzing-asan': 'builds/releng_sub_%s_configs/%s_cross_fuzzing_asan.py',
         'cross-artifact': 'builds/releng_sub_%s_configs/%s_cross_artifact.py',
         'debug': 'builds/releng_sub_%s_configs/%s_debug.py',
         'fuzzing-debug': 'builds/releng_sub_%s_configs/%s_fuzzing_debug.py',
         'asan-and-debug': 'builds/releng_sub_%s_configs/%s_asan_and_debug.py',
         'asan-tc-and-debug': 'builds/releng_sub_%s_configs/%s_asan_tc_and_debug.py',
+        'lto-tc-and-debug': 'builds/releng_sub_%s_configs/%s_lto_tc_and_debug.py',
         'stat-and-debug': 'builds/releng_sub_%s_configs/%s_stat_and_debug.py',
         'code-coverage': 'builds/releng_sub_%s_configs/%s_code_coverage.py',
         'source': 'builds/releng_sub_%s_configs/%s_source.py',
         'noopt-debug': 'builds/releng_sub_%s_configs/%s_noopt_debug.py',
         'api-16-gradle-dependencies': 'builds/releng_sub_%s_configs/%s_api_16_gradle_dependencies.py',
         'api-16': 'builds/releng_sub_%s_configs/%s_api_16.py',
         'api-16-artifact': 'builds/releng_sub_%s_configs/%s_api_16_artifact.py',
         'api-16-debug': 'builds/releng_sub_%s_configs/%s_api_16_debug.py',