From 114ea61e5b5bd53b97f03407b73d3fae4a8359cf Mon Sep 17 00:00:00 2001 From: Norisz Fay Date: Thu, 18 May 2023 00:20:02 +0300 Subject: [PATCH] Backed out changeset b13e72246d35 (bug 1831935) for causing android reftest and mochitest failures CLOSED TREE --- old-configure.in | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/old-configure.in b/old-configure.in index 3089005b0f9a..a35a2e6b5a6a 100644 --- a/old-configure.in +++ b/old-configure.in @@ -380,7 +380,24 @@ case "$target" in if test -z "$CLANG_CC"; then MOZ_OPTIMIZE_FLAGS="-freorder-blocks -fno-reorder-functions -Os" else - MOZ_OPTIMIZE_FLAGS="-O2" + # 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. + 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 ;;