Bug 1520149 - Also disable the machine outliner on Android when LTO is enabled. r=dmajor
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 17 Jan 2019 13:18:37 +0000
changeset 454358 c28522aaf3918c5f556c65432f8bf14a65bff65a
parent 454357 6896f8bf818180ef3bdf042d707713a0aa410b9f
child 454359 33e42b897fb122df45448648f6a1d2e1a62ce083
push id35395
push userebalazs@mozilla.com
push dateFri, 18 Jan 2019 09:38:33 +0000
treeherdermozilla-central@88e2eb73aace [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor
bugs1520149
milestone66.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 1520149 - Also disable the machine outliner on Android when LTO is enabled. r=dmajor Differential Revision: https://phabricator.services.mozilla.com/D16790
old-configure.in
--- a/old-configure.in
+++ b/old-configure.in
@@ -653,21 +653,29 @@ case "$target" in
     if test -z "$CLANG_CC"; then
         MOZ_OPTIMIZE_FLAGS="-freorder-blocks -fno-reorder-functions -Os"
     else
         # From https://github.com/android-ndk/ndk/issues/133#issuecomment-308549264
         # -Oz is smaller than -Os on clang.
         MOZ_OPTIMIZE_FLAGS="-Oz"
         # Disable the outliner, which causes performance regressions, and is
         # enabled on some platforms at -Oz.
-        DISABLE_OUTLINER="-mno-outline"
-        _SAVE_CFLAGS=$CFLAGS
-        CFLAGS="$CFLAGS $DISABLE_OUTLINER"
-        AC_TRY_COMPILE(,,[MOZ_OPTIMIZE_FLAGS="$MOZ_OPTIMIZE_FLAGS $DISABLE_OUTLINER"])
-        CFLAGS="$_SAVE_CFLAGS"
+        if test -z "$MOZ_LTO"; then
+            DISABLE_OUTLINER="-mno-outline"
+            _SAVE_CFLAGS=$CFLAGS
+            CFLAGS="$CFLAGS $DISABLE_OUTLINER"
+            AC_TRY_COMPILE(,,[MOZ_OPTIMIZE_FLAGS="$MOZ_OPTIMIZE_FLAGS $DISABLE_OUTLINER"])
+            CFLAGS="$_SAVE_CFLAGS"
+        else
+            DISABLE_OUTLINER="-Wl,-plugin-opt=-enable-machine-outliner=never"
+            _SAVE_LDFLAGS=$LDFLAGS
+            LDFLAGS="$LDFLAGS $MOZ_LTO_LDFLAGS $DISABLE_OUTLINER"
+            AC_TRY_LINK(,,[MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS $DISABLE_OUTLINER"])
+            LDFLAGS="$_SAVE_LDFLAGS"
+        fi
     fi
     ;;
 
 *-*linux*)
     if test "$GNU_CC" -o "$GNU_CXX"; then
         MOZ_PGO_OPTIMIZE_FLAGS="-O3"
         if test -n "$MOZ_DEBUG"; then
             MOZ_OPTIMIZE_FLAGS="-Os"