[Libreoffice-commits] core.git: solenv/gbuild

Michael Stahl mstahl at redhat.com
Thu Dec 1 16:50:39 UTC 2016


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

New commits:
commit 6982598524491ee087e69c149eaa958af91b1999
Author: Michael Stahl <mstahl at redhat.com>
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 2541312maxresident)k
    
    "make check", incremental
    7368.19user 153.98system 15:30.06elapsed 808%CPU (0avgtext+0avgdata 510200maxresident)k
    
    "make CppunitTest_sc_functions_test"
    272.13user 0.65system 4:33.47elapsed 99%CPU (0avgtext+0avgdata 258884maxresident)k
    
    With -Og:
    
    "make check"
    46076.01user 3170.91system 1:16:19elapsed 1075%CPU (0avgtext+0avgdata 2613716maxresident)k
    
    "make check", incremental
    5478.33user 157.07system 11:50.42elapsed 793%CPU (0avgtext+0avgdata 454980maxresident)k
    
    "make CppunitTest_sc_functions_test"
    188.48user 0.62system 3:09.59elapsed 99%CPU (0avgtext+0avgdata 259096maxresident)k
    
    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 -Og
           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-on: https://gerrit.libreoffice.org/31334
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 6b697fc..2512533 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -186,7 +186,9 @@ ifeq ($(HAVE_GCC_FNO_DEFAULT_INLINE),TRUE)
 FNO_DEFAULT_INLINE=-fno-default-inline
 endif
 
-gb_DEBUG_CFLAGS := $(FINLINE_LIMIT0) $(FNO_INLINE)
+# note: this overrides -O0 from the gb_COMPILERNOOPTFLAGS with -Og if
+# available, so that the former remains no-optimization for when that is needed
+gb_DEBUG_CFLAGS := $(if $(HAVE_GCC_OG),-Og) $(FINLINE_LIMIT0) $(FNO_INLINE)
 gb_DEBUG_CXXFLAGS := $(FNO_DEFAULT_INLINE)
 
 


More information about the Libreoffice-commits mailing list