diff --git a/build/moz.configure/warnings.configure b/build/moz.configure/warnings.configure index b9e94d99ba82..d9d08cf32e2f 100644 --- a/build/moz.configure/warnings.configure +++ b/build/moz.configure/warnings.configure @@ -98,8 +98,8 @@ check_and_add_gcc_warning('-Wno-error=array-bounds') # can't get rid of those PGO warnings check_and_add_gcc_warning('-Wno-error=coverage-mismatch', when='MOZ_PGO') -# false positives during PGO -check_and_add_gcc_warning('-Wno-error=free-nonheap-object', when='MOZ_PGO') +# false positives depending on optimizations +check_and_add_gcc_warning('-Wno-error=free-nonheap-object') # catches format/argument mismatches with printf check_and_add_gcc_warning('-Wformat') diff --git a/old-configure.in b/old-configure.in index 49bca5071c5f..0c4768b6f223 100644 --- a/old-configure.in +++ b/old-configure.in @@ -888,7 +888,11 @@ case "$target" in *-*linux*) if test "$GNU_CC" -o "$GNU_CXX"; then MOZ_PGO_OPTIMIZE_FLAGS="-O3" - MOZ_OPTIMIZE_FLAGS="-Os" + if test -n "$MOZ_DEBUG"; then + MOZ_OPTIMIZE_FLAGS="-Os" + else + MOZ_OPTIMIZE_FLAGS="-O2" + fi if test -z "$CLANG_CC"; then MOZ_OPTIMIZE_FLAGS="-freorder-blocks $MOZ_OPTIMIZE_FLAGS" fi