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 086631af 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/31334Reviewed-by:Norbert Thiebaud <nthiebaud@gmail.com> Tested-by:
Jenkins <ci@libreoffice.org> Reviewed-by:
Michael Stahl <mstahl@redhat.com>
Showing
Please
register
or
sign in
to comment