solenv/gbuild/platform/ |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 6982598524491ee087e69c149eaa958af91b1999
Author: Michael Stahl <>
Date:   Mon Nov 28 17:22:16 2016 +0100

    gbuild: replace -O0 with -Og for GCC --enable-debug/dbgutil builds
    With Fedora 25 GCC 6.2.1 and my usual config (except without
    --with-package-format since that is slowest now) on commit
    086631af59636cd9a6a45b747a1bc59b4b547794 i get with CCACHE_DISABLE=1:
    With -O0:
    "make check"
    44490.70user 3127.01system 1:15:23elapsed 1052%CPU (0avgtext+0avgdata 
    "make check", incremental
    7368.19user 153.98system 15:30.06elapsed 808%CPU (0avgtext+0avgdata 
    "make CppunitTest_sc_functions_test"
    272.13user 0.65system 4:33.47elapsed 99%CPU (0avgtext+0avgdata 
    With -Og:
    "make check"
    46076.01user 3170.91system 1:16:19elapsed 1075%CPU (0avgtext+0avgdata 
    "make check", incremental
    5478.33user 157.07system 11:50.42elapsed 793%CPU (0avgtext+0avgdata 
    "make CppunitTest_sc_functions_test"
    188.48user 0.62system 3:09.59elapsed 99%CPU (0avgtext+0avgdata 
    So we now have so many tests that the time taken by GCC doing optimization
    is brought back via the tests finishing faster, particularly if we
    assume a non-negligible ccache hit rate for developers in practice.
    Add this to gb_DEBUG_CFLAGS instead of gb_COMPILERNOOPTFLAGS because
    presumably the bridges code that uses gb_COMPILERNOOPTFLAGS really wants
    -O0; the gb_DEBUG_CFLAGS is added later so -Og overrides -O0.
    It is an open question how well debugging in gdb actually works with
    -Og, some experimentation is needed; "man gcc" claims:
           If you are not using some other optimization option, consider using 
           with -g.  With no -O option at all, some compiler passes that collect
           information useful for debugging do not run at all, so that -Og may
           result in a better debugging experience.
    Change-Id: I103499f398b69397cf5aa9993a242680966ce999
    Reviewed-by: Norbert Thiebaud <>
    Tested-by: Jenkins <>
    Reviewed-by: Michael Stahl <>

diff --git a/solenv/gbuild/platform/ 
index 6b697fc..2512533 100644
--- a/solenv/gbuild/platform/
+++ b/solenv/gbuild/platform/
@@ -186,7 +186,9 @@ ifeq ($(HAVE_GCC_FNO_DEFAULT_INLINE),TRUE)
+# note: this overrides -O0 from the gb_COMPILERNOOPTFLAGS with -Og if
+# available, so that the former remains no-optimization for when that is needed
Libreoffice-commits mailing list

Reply via email to