path: root/solenv/gbuild
diff options
authorLuboš Luňák <>2020-02-18 10:20:38 +0100
committerLuboš Luňák <>2020-02-19 10:27:43 +0100
commite957382700ed9237d4a7b374cd76bec466f5231c (patch)
tree71f94d798edd8fa64707caf41a2c8066d4ca95d9 /solenv/gbuild
parente62b9937ed33388055560ca0710990742b530aec (diff)
add --enable-optimized=debug
This will use -Og with GCC/Clang instead of -O0, which should make unittests run faster without (hopefully) breaking anything related to debugging. This is primarily meant to Jenkins builds, where debug info is rarely needed (backtraces for unittest crashes AFAICT). This can be also used to make LO itself run faster when developing, but I personally do not find it worth it (with Clang and full PCH this makes starmath build take about 70% longer, although presumably for non-PCH builds the relative increase will be smaller). Change-Id: I198d0759ebca94c90be662e02e0f1281a24d1d70 Reviewed-on: Reviewed-by: Michael Stahl <> Reviewed-by: Luboš Luňák <> Tested-by: Jenkins
Diffstat (limited to 'solenv/gbuild')
3 files changed, 7 insertions, 1 deletions
diff --git a/solenv/gbuild/ b/solenv/gbuild/
index 914c36d35cd2..9e14f599b690 100644
--- a/solenv/gbuild/
+++ b/solenv/gbuild/
@@ -44,7 +44,11 @@ gb_LinkTarget__symbols_enabled = \
$(filter $(1),$(ENABLE_SYMBOLS_FOR))))
# debug flags, if the LinkTarget is named in the list of libraries of ENABLE_SYMBOLS_FOR
-gb_LinkTarget__get_debugflags=$(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(call gb_LinkTarget__symbols_enabled,$(1)),$(gb_DEBUGINFO_FLAGS))
+gb_LinkTarget__get_debugflags= \
+$(if $(call gb_LinkTarget__symbols_enabled,$(1)),$(gb_DEBUGINFO_FLAGS))
# similar for LDFLAGS, use linker optimization flags in non-debug case,
# but moreover strip debug from libraries for which debuginfo is not wanted
diff --git a/solenv/gbuild/platform/ b/solenv/gbuild/platform/
index 530bc16e8da3..cc0eabc292f2 100644
--- a/solenv/gbuild/platform/
+++ b/solenv/gbuild/platform/
@@ -201,6 +201,7 @@ gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS)
# optimization level
gb_COMPILERNOOPTFLAGS := -O0 -fstrict-aliasing -fstrict-overflow
ifeq ($(OS),ANDROID)
diff --git a/solenv/gbuild/platform/ b/solenv/gbuild/platform/
index 11c1aa6d4b49..7409cffa1f40 100644
--- a/solenv/gbuild/platform/
+++ b/solenv/gbuild/platform/
@@ -265,6 +265,7 @@ gb_LINKER_DEBUGINFO_FLAGS :=
ifeq ($(gb_FULLDEPS),$(true))
gb_COMPILERDEPFLAGS := -showIncludes