summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-04-04 16:39:49 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-04-11 12:20:55 +0200
commiteeeec33ada5923f1f534334b22c15d6e2c6f1d35 (patch)
treeb2514f295cea52bdbc1575c7dd7cf9e65caf2b86
parent4bbdab901eb3c7d32d28910fb830f4b0422eee91 (diff)
merge --enable-selective-debuginfo into --enable-symbols
This got broken again due to confusion about the interaction between the various debug/symbol/whatever variables, so let's try to clean it up once more. So gb_SYMBOLS or any other global flag is no more. For checking whether a build target should get symbols, use gb_LinkTarget__symbols_enabled, which is internally controlled by gb_ENABLE_SYMBOLS_FOR (and flags from configure, command line or wherever affect that). This commit breaks the debug/nodebug split for PCH files, but fixing that is a relatively separate and complex change, so it'll be done in another commit. Change-Id: I6060dd38684445bb761e664344fb530386481332 Reviewed-on: https://gerrit.libreoffice.org/70369 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--config_host.mk.in3
-rw-r--r--configure.ac52
-rw-r--r--solenv/gbuild/LinkTarget.mk33
-rw-r--r--solenv/gbuild/Module.mk8
-rw-r--r--solenv/gbuild/PrecompiledHeaders.mk9
-rw-r--r--solenv/gbuild/TargetLocations.mk6
-rw-r--r--solenv/gbuild/gbuild.mk42
-rw-r--r--solenv/gbuild/platform/com_GCC_class.mk2
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk5
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk2
10 files changed, 78 insertions, 84 deletions
diff --git a/config_host.mk.in b/config_host.mk.in
index ef174b790939..eccc3ef1924f 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -131,7 +131,6 @@ export ENABLE_DBGUTIL=@ENABLE_DBGUTIL@
export ENABLE_DBUS=@ENABLE_DBUS@
export ENABLE_DCONF=@ENABLE_DCONF@
export ENABLE_DEBUG=@ENABLE_DEBUG@
-export ENABLE_DEBUGINFO_FOR=@ENABLE_DEBUGINFO_FOR@
export ENABLE_EOT=@ENABLE_EOT@
export ENABLE_EVOAB2=@ENABLE_EVOAB2@
export ENABLE_FIREBIRD_SDBC=@ENABLE_FIREBIRD_SDBC@
@@ -179,7 +178,7 @@ export ENABLE_SCRIPTING_JAVASCRIPT=@ENABLE_SCRIPTING_JAVASCRIPT@
export ENABLE_SDREMOTE=@ENABLE_SDREMOTE@
export ENABLE_SDREMOTE_BLUETOOTH=@ENABLE_SDREMOTE_BLUETOOTH@
export ENABLE_SILENT_MSI=@ENABLE_SILENT_MSI@
-export ENABLE_SYMBOLS=@ENABLE_SYMBOLS@
+export ENABLE_SYMBOLS_FOR=@ENABLE_SYMBOLS_FOR@
export ENABLE_VALGRIND=@ENABLE_VALGRIND@
export ENABLE_VLC=@ENABLE_VLC@
export ENABLE_WERROR=@ENABLE_WERROR@
diff --git a/configure.ac b/configure.ac
index 5f4a6de14dcb..2d62af9981a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1145,20 +1145,15 @@ libo_FUZZ_ARG_ENABLE(sal-log,
AS_HELP_STRING([--enable-sal-log],
[Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
-AC_ARG_ENABLE(selective-debuginfo,
- AS_HELP_STRING([--enable-selective-debuginfo],
- [If --enable-debug or --enable-dbgutil is used, build debugging information
- (-g compiler flag) only for the specified gbuild build targets
- (where all means everything, - prepended means not to enable, / appended means
- everything in the directory; there is no ordering, more specific overrides
- more general, and disabling takes precedence).
- Example: --enable-selective-debuginfo="all -sw/ -Library_sc".]))
-
libo_FUZZ_ARG_ENABLE(symbols,
AS_HELP_STRING([--enable-symbols],
[Generate debug information.
By default, enabled for --enable-debug and --enable-dbgutil, disabled
- otherwise.]))
+ otherwise. It is possible to explicitly specify gbuild build targets
+ (where 'all' means everything, '-' prepended means to not enable, '/' appended means
+ everything in the directory; there is no ordering, more specific overrides
+ more general, and disabling takes precedence).
+ Example: --enable-symbols="all -sw/ -Library_sc".]))
libo_FUZZ_ARG_ENABLE(optimized,
AS_HELP_STRING([--disable-optimized],
@@ -3813,7 +3808,7 @@ AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
dnl Set the ENABLE_DEBUG variable.
dnl ===================================================================
if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
- AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-selective-debuginfo])
+ AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-symbols])
fi
if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
if test -z "$libo_fuzzed_enable_debug"; then
@@ -4048,27 +4043,6 @@ if test "$enable_sal_log" = yes; then
fi
AC_SUBST(ENABLE_SAL_LOG)
-dnl Selective debuginfo
-ENABLE_DEBUGINFO_FOR=
-if test -n "$ENABLE_DEBUG"; then
- AC_MSG_CHECKING([whether to use selective debuginfo])
- if test -n "$enable_selective_debuginfo" -a "$enable_selective_debuginfo" != "no"; then
- if test "$enable_selective_debuginfo" = "yes"; then
- AC_MSG_ERROR([--enable-selective-debuginfo requires a parameter])
- fi
- ENABLE_DEBUGINFO_FOR="$enable_selective_debuginfo"
- AC_MSG_RESULT([for "$enable_selective_debuginfo"])
- else
- ENABLE_DEBUGINFO_FOR=all
- AC_MSG_RESULT([no, for all])
- fi
-else
- if test -n "$enable_selective_debuginfo"; then
- AC_MSG_ERROR([--enable-selective-debuginfo must be used together with either --enable-debug or --enable-dbgutil])
- fi
-fi
-AC_SUBST(ENABLE_DEBUGINFO_FOR)
-
dnl Check for enable symbols option
dnl ===================================================================
AC_MSG_CHECKING([whether to generate debug information])
@@ -4079,14 +4053,18 @@ if test -z "$enable_symbols"; then
enable_symbols=no
fi
fi
-if test "$enable_symbols" != no; then
- ENABLE_SYMBOLS=TRUE
+if test "$enable_symbols" = yes; then
+ ENABLE_SYMBOLS_FOR=all
AC_MSG_RESULT([yes])
-else
- ENABLE_SYMBOLS=
+elif test "$enable_symbols" = no; then
+ ENABLE_SYMBOLS_FOR=
AC_MSG_RESULT([no])
+else
+ # Selective debuginfo.
+ ENABLE_SYMBOLS_FOR="$enable_symbols"
+ AC_MSG_RESULT([for "$enable_symbols"])
fi
-AC_SUBST(ENABLE_SYMBOLS)
+AC_SUBST(ENABLE_SYMBOLS_FOR)
if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
# Building on Android with full symbols: without enough memory the linker never finishes currently.
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 02df4afbba54..33579bf0e99f 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -36,21 +36,21 @@
# gb_LinkTarget_INCLUDE
# gb_YaccTarget__command(grammar-file, stem-for-message, source-target, include-target)
+# Detect whether symbols should be enabled for the given gbuild target.
# enable if: no "-TARGET" defined AND [module is enabled OR "TARGET" defined]
-gb_LinkTarget__debug_enabled = \
- $(and $(if $(filter -$(1),$(ENABLE_DEBUGINFO_FOR)),,$(true)),\
- $(or $(gb_Module_CURRENTMODULE_DEBUG_ENABLED),\
- $(filter $(1),$(ENABLE_DEBUGINFO_FOR))))
+gb_LinkTarget__symbols_enabled = \
+ $(and $(if $(filter -$(1),$(ENABLE_SYMBOLS_FOR)),,$(true)),\
+ $(or $(gb_Module_CURRENTMODULE_SYMBOLS_ENABLED),\
+ $(filter $(1),$(ENABLE_SYMBOLS_FOR))))
-# debug flags, if ENABLE_DEBUG is set and the LinkTarget is named
-# in the list of libraries of ENABLE_DEBUGINFO_FOR
-gb_LinkTarget__get_debugflags=$(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(filter $(true),$(gb_SYMBOL)),$(gb_DEBUGINFO_FLAGS))
+# 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))
# similar for LDFLAGS, use linker optimization flags in non-debug case,
# but moreover strip debug from libraries for which debuginfo is not wanted
# (some libraries reuse .o files from other libraries, notably unittests)
gb_LinkTarget__get_stripldflags=$(if $(strip $(CFLAGS)$(CXXFLAGS)$(OBJCFLAGS)$(OBJCXXFLAGS)$(LDFLAGS)),,$(gb_LINKERSTRIPDEBUGFLAGS))
-gb_LinkTarget__get_debugldflags=$(if $(call gb_LinkTarget__debug_enabled,$(1)),$(gb_DEBUGINFO_FLAGS),$(gb_LINKEROPTFLAGS) $(call gb_LinkTarget__get_stripldflags,$(1)))
+gb_LinkTarget__get_debugldflags=$(if $(call gb_LinkTarget__symbols_enabled,$(1)),$(gb_DEBUGINFO_FLAGS),$(gb_LINKEROPTFLAGS) $(call gb_LinkTarget__get_stripldflags,$(1)))
# generic cflags/cxxflags to use (optimization flags, debug flags)
# user supplied CFLAGS/CXXFLAGS override default debug/optimization flags
@@ -237,7 +237,7 @@ $(call gb_CObject_get_target,%) : $(call gb_CObject_get_source,$(SRCDIR),%) $(gb
else
$(call gb_CObject_get_target,%) : $(call gb_CObject_get_source,$(SRCDIR),%)
$(call gb_Output_announce,$*.c,$(true),$(if $(COMPILER_TEST),C? ,C ),3)
- $(call gb_CObject__command_pattern,$@,$(T_CFLAGS) $(T_CFLAGS_APPEND),$<,$(call gb_CObject_get_dep_target,$*),$(COMPILER_PLUGINS))
+ $(call gb_CObject__command_pattern,$@,$(T_CFLAGS) $(T_CFLAGS_APPEND),$<,$(call gb_CObject_get_dep_target,$*),$(COMPILER_PLUGINS),$(T_SYMBOLS))
endif
# Note: if the *Object_dep_target does not exist it will be created by
@@ -289,7 +289,7 @@ else
$(call gb_CxxObject_get_target,%) : $(call gb_CxxObject_get_source,$(SRCDIR),%)
$(call gb_Output_announce,$*.cxx,$(true),$(if $(COMPILER_TEST),CPT,CXX),3)
$(eval $(gb_CxxObject__set_pchflags))
- $(call gb_CObject__command_pattern,$@,$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) $(if $(COMPILER_TEST),$(gb_COMPILER_TEST_FLAGS)),$<,$(call gb_CxxObject_get_dep_target,$*),$(COMPILER_PLUGINS))
+ $(call gb_CObject__command_pattern,$@,$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) $(if $(COMPILER_TEST),$(gb_COMPILER_TEST_FLAGS)),$<,$(call gb_CxxObject_get_dep_target,$*),$(COMPILER_PLUGINS),$(T_SYMBOLS))
endif
ifeq ($(gb_FULLDEPS),$(true))
@@ -313,7 +313,7 @@ gb_GenCObject_get_source = $(WORKDIR)/$(1).c
$(call gb_GenCObject_get_target,%) : $(gb_FORCE_COMPILE_ALL_TARGET)
$(call gb_Output_announce,$*.c,$(true),C ,3)
test -f $(call gb_GenCObject_get_source,$*) || (echo "Missing generated source file $(call gb_GenCObject_get_source,$*)" && false)
- $(call gb_CObject__command_pattern,$@,$(T_CFLAGS) $(T_CFLAGS_APPEND),$(call gb_GenCObject_get_source,$*),$(call gb_GenCObject_get_dep_target,$*),$(COMPILER_PLUGINS))
+ $(call gb_CObject__command_pattern,$@,$(T_CFLAGS) $(T_CFLAGS_APPEND),$(call gb_GenCObject_get_source,$*),$(call gb_GenCObject_get_dep_target,$*),$(COMPILER_PLUGINS),$(T_SYMBOLS))
ifeq ($(gb_FULLDEPS),$(true))
$(dir $(call gb_GenCObject_get_dep_target,%)).dir :
@@ -336,7 +336,7 @@ $(call gb_GenCxxObject_get_target,%) : $(gb_FORCE_COMPILE_ALL_TARGET)
$(call gb_Output_announce,$(subst $(BUILDDIR)/,,$(GEN_CXX_SOURCE)),$(true),CXX,3)
test -f $(GEN_CXX_SOURCE) || (echo "Missing generated source file $(GEN_CXX_SOURCE)" && false)
$(eval $(gb_CxxObject__set_pchflags))
- $(call gb_CObject__command_pattern,$@,$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND),$(GEN_CXX_SOURCE),$(call gb_GenCxxObject_get_dep_target,$*),$(COMPILER_PLUGINS))
+ $(call gb_CObject__command_pattern,$@,$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND),$(GEN_CXX_SOURCE),$(call gb_GenCxxObject_get_dep_target,$*),$(COMPILER_PLUGINS),$(T_SYMBOLS))
ifeq ($(gb_FULLDEPS),$(true))
$(dir $(call gb_GenCxxObject_get_dep_target,%)).dir :
@@ -359,7 +359,7 @@ gb_GenCxxClrObject_get_source = $(WORKDIR)/$(1).$(gb_LinkTarget_CXX_SUFFIX_$(cal
$(call gb_GenCxxClrObject_get_target,%) : $(gb_FORCE_COMPILE_ALL_TARGET)
$(call gb_Output_announce,$(subst $(BUILDDIR)/,,$(GEN_CXXCLR_SOURCE)),$(true),CLR,3)
test -f $(GEN_CXXCLR_SOURCE) || (echo "Missing generated source file $(GEN_CXXCLR_SOURCE)" && false)
- $(call gb_CObject__command_pattern,$@,$(T_CXXCLRFLAGS) $(T_CXXCLRFLAGS_APPEND),$(GEN_CXXCLR_SOURCE),$(call gb_GenCxxClrObject_get_dep_target,$*),$(COMPILER_PLUGINS))
+ $(call gb_CObject__command_pattern,$@,$(T_CXXCLRFLAGS) $(T_CXXCLRFLAGS_APPEND),$(GEN_CXXCLR_SOURCE),$(call gb_GenCxxClrObject_get_dep_target,$*),$(COMPILER_PLUGINS),$(T_SYMBOLS))
ifeq ($(gb_FULLDEPS),$(true))
$(dir $(call gb_GenCxxClrObject_get_dep_target,%)).dir :
@@ -444,7 +444,7 @@ $(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDI
else
$(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDIR),%)
$(call gb_Output_announce,$*.mm,$(true),$(if $(COMPILER_TEST),O?X,OCX),3)
- $(call gb_CObject__command_pattern,$@,$(T_OBJCXXFLAGS) $(T_OBJCXXFLAGS_APPEND),$<,$(call gb_ObjCxxObject_get_dep_target,$*),$(COMPILER_PLUGINS))
+ $(call gb_CObject__command_pattern,$@,$(T_OBJCXXFLAGS) $(T_OBJCXXFLAGS_APPEND),$<,$(call gb_ObjCxxObject_get_dep_target,$*),$(COMPILER_PLUGINS),$(T_SYMBOLS))
endif
ifeq ($(gb_FULLDEPS),$(true))
@@ -471,7 +471,7 @@ $(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%
else
$(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%)
$(call gb_Output_announce,$*.m,$(true),$(if $(COMPILER_TEST),O?C,OCC),3)
- $(call gb_CObject__command_pattern,$@,$(T_OBJCFLAGS) $(T_OBJCFLAGS_APPEND),$<,$(call gb_ObjCObject_get_dep_target,$*),$(COMPILER_PLUGINS))
+ $(call gb_CObject__command_pattern,$@,$(T_OBJCFLAGS) $(T_OBJCFLAGS_APPEND),$<,$(call gb_ObjCObject_get_dep_target,$*),$(COMPILER_PLUGINS),$(T_SYMBOLS))
endif
ifeq ($(gb_FULLDEPS),$(true))
@@ -498,7 +498,7 @@ $(call gb_CxxClrObject_get_target,%) : $(call gb_CxxClrObject_get_source,$(SRCDI
else
$(call gb_CxxClrObject_get_target,%) : $(call gb_CxxClrObject_get_source,$(SRCDIR),%)
$(call gb_Output_announce,$*.cxx,$(true),$(if $(COMPILER_TEST),C?R,CLR),3)
- $(call gb_CObject__command_pattern,$@,$(T_CXXCLRFLAGS) $(T_CXXCLRFLAGS_APPEND),$<,$(call gb_CxxClrObject_get_dep_target,$*),$(COMPILER_PLUGINS))
+ $(call gb_CObject__command_pattern,$@,$(T_CXXCLRFLAGS) $(T_CXXCLRFLAGS_APPEND),$<,$(call gb_CxxClrObject_get_dep_target,$*),$(COMPILER_PLUGINS),$(T_SYMBOLS))
endif
ifeq ($(gb_FULLDEPS),$(true))
@@ -791,6 +791,7 @@ $(call gb_LinkTarget_get_target,$(1)) : PLUGIN_WARNINGS_AS_ERRORS :=
$(call gb_LinkTarget_get_target,$(1)) : EXTERNAL_CODE :=
$(call gb_LinkTarget_get_target,$(1)) : SOVERSIONSCRIPT :=
$(call gb_LinkTarget_get_target,$(1)) : COMPILER_TEST :=
+$(call gb_LinkTarget_get_target,$(1)) : T_SYMBOLS := $(if $(call gb_LinkTarget__symbols_enabled,$(2)),$(true),$(false))
ifeq ($(gb_FULLDEPS),$(true))
ifeq (depcache:,$(filter depcache,$(.FEATURES)):$(gb_PARTIAL_BUILD))
diff --git a/solenv/gbuild/Module.mk b/solenv/gbuild/Module.mk
index 52798fd40731..aa3b1cb19485 100644
--- a/solenv/gbuild/Module.mk
+++ b/solenv/gbuild/Module.mk
@@ -239,9 +239,9 @@ $(WORKDIR)/pot.done : $(foreach exec,cfgex helpex localize propex ulfex xrmex tr
&& touch $@)
# enable if: no "-MODULE/" defined AND ["all" defined OR "MODULE/" defined]
-gb_Module__debug_enabled = \
- $(and $(if $(filter -$(1)/,$(ENABLE_DEBUGINFO_FOR)),,$(true)),\
- $(filter all $(1)/,$(ENABLE_DEBUGINFO_FOR)))
+gb_Module__symbols_enabled = \
+ $(and $(if $(filter -$(1)/,$(gb_ENABLE_SYMBOLS_FOR)),,$(true)),\
+ $(filter all $(1)/,$(gb_ENABLE_SYMBOLS_FOR)))
define gb_Module_Module
gb_Module_ALLMODULES += $(1)
@@ -256,7 +256,7 @@ gb_Module_SUBSEQUENTCHECKTARGETSTACK := $(call gb_Module_get_subsequentcheck_tar
gb_Module_STAGINGCHECKTARGETSTACK := $(call gb_Module_get_stagingcheck_target,$(1)) $(gb_Module_STAGINGCHECKTARGETSTACK)
gb_Module_PERFCHECKTARGETSTACK := $(call gb_Module_get_perfcheck_target,$(1)) $(gb_Module_PERFCHECKTARGETSTACK)
gb_Module_CLEANTARGETSTACK := $(call gb_Module_get_clean_target,$(1)) $(gb_Module_CLEANTARGETSTACK)
-gb_Module_CURRENTMODULE_DEBUG_ENABLED := $(call gb_Module__debug_enabled,$(1))
+gb_Module_CURRENTMODULE_SYMBOLS_ENABLED := $(call gb_Module__symbols_enabled,$(1))
gb_Module_CURRENTMODULE_NAME := $(1)
$(call gb_Helper_make_userfriendly_targets,$(1),Module)
$(if $(filter-out libreoffice instsetoo_native android ios,$(1)),\
diff --git a/solenv/gbuild/PrecompiledHeaders.mk b/solenv/gbuild/PrecompiledHeaders.mk
index 37adf778f2e3..2da085512ec2 100644
--- a/solenv/gbuild/PrecompiledHeaders.mk
+++ b/solenv/gbuild/PrecompiledHeaders.mk
@@ -22,12 +22,9 @@
ifeq ($(gb_ENABLE_PCH),$(true))
-# gb_PrecompiledHeader_get_enableflags defined by platform
-ifneq ($(strip $(gb_DEBUGLEVEL)$(gb_SYMBOL)),0)
-gb_PrecompiledHeader_DEBUGDIR := debug
-else
-gb_PrecompiledHeader_DEBUGDIR := nodebug
-endif
+# Use different PCH file depending on whether we use debugging symbols.
+# TODO: This doesn't work because T_SYMBOLS is not expanded as/when necessary.
+gb_PrecompiledHeader__get_debugdir := $(if $(filter $(true),$(T_SYMBOLS)),debug,nodebug)
$(call gb_PrecompiledHeader_get_dep_target,%) :
$(call gb_Helper_abbreviate_dirs,\
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index a2e51cbd0447..5aa3125b8d2b 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -146,10 +146,10 @@ gb_Package_get_target_for_build = $(WORKDIR_FOR_BUILD)/Package/$(1).filelist
gb_PackageSet_get_target = $(WORKDIR)/PackageSet/$(1).filelist
gb_PackageInfo_get_target = $(WORKDIR)/PackageInfo
gb_Postprocess_get_target = $(WORKDIR)/Postprocess/$(1)
-gb_PrecompiledHeader_get_dep_target = $(WORKDIR)/Dep/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/$(1).hxx.gch.d
+gb_PrecompiledHeader_get_dep_target = $(WORKDIR)/Dep/PrecompiledHeader/$(call gb_PrecompiledHeader__get_debugdir)/$(1).hxx.gch.d
gb_PrecompiledHeader_get_dep_target_tmp = $(call gb_PrecompiledHeader_get_dep_target,$(1)).tmp
-gb_PrecompiledHeader_get_target = $(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/$(1).hxx.gch
-gb_PrecompiledHeader_get_timestamp = $(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/Timestamps/$(1)
+gb_PrecompiledHeader_get_target = $(WORKDIR)/PrecompiledHeader/$(call gb_PrecompiledHeader__get_debugdir)/$(1).hxx.gch
+gb_PrecompiledHeader_get_timestamp = $(WORKDIR)/PrecompiledHeader/$(call gb_PrecompiledHeader__get_debugdir)/Timestamps/$(1)
gb_PropertiesTranslateTarget_get_target = $(WORKDIR)/PropertiesTranslateTarget/$(1).properties
gb_Pyuno_get_final_target = $(WORKDIR)/Pyuno/$(1).final
gb_Pyuno_get_target = $(WORKDIR)/Pyuno/$(1).done
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index b56074b9ed44..6aa83c5903ed 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -82,20 +82,33 @@ else
gb_ENABLE_DBGUTIL := $(false)
endif
+gb_ENABLE_SYMBOLS_FOR := $(ENABLE_SYMBOLS_FOR)
+
+# ENABLE_SYMBOLS (presumably from the command line)
+ifneq ($(strip $(ENABLE_SYMBOLS)),)
+gb_ENABLE_SYMBOLS_FOR := $(ENABLE_SYMBOLS)
+endif
+ifneq ($(strip $(enable_symbols)),)
+gb_ENABLE_SYMBOLS_FOR := $(enable_symbols)
+endif
+
+# note: ENABLE_BREAKPAD turns on symbols
+ifneq ($(strip $(ENABLE_BREAKPAD)),)
+gb_ENABLE_SYMBOLS_FOR := all
+endif
+
gb_DEBUGLEVEL := 0
ifneq ($(strip $(DEBUG)),)
gb_DEBUGLEVEL := 1
# make DEBUG=true should force -g
ifeq ($(origin DEBUG),command line)
-ENABLE_DEBUGINFO_FOR := all
-ENABLE_SYMBOLS := TRUE
+gb_ENABLE_SYMBOLS_FOR := all
endif
endif
ifneq ($(strip $(debug)),)
gb_DEBUGLEVEL := 1
ifeq ($(origin debug),command line)
-ENABLE_DEBUGINFO_FOR := all
-ENABLE_SYMBOLS := TRUE
+gb_ENABLE_SYMBOLS_FOR := all
endif
endif
ifeq ($(gb_ENABLE_DBGUTIL),$(true))
@@ -105,21 +118,28 @@ endif
ifneq ($(strip $(DBGLEVEL)),)
gb_DEBUGLEVEL := $(strip $(DBGLEVEL))
ifeq ($(origin DBGLEVEL),command line)
-ENABLE_DEBUGINFO_FOR := all
+gb_ENABLE_SYMBOLS_FOR := all
endif
endif
ifneq ($(strip $(dbglevel)),)
gb_DEBUGLEVEL := $(strip $(dbglevel))
ifeq ($(origin dbglevel),command line)
-ENABLE_DEBUGINFO_FOR := all
+gb_ENABLE_SYMBOLS_FOR := all
endif
endif
-# note: ENABLE_BREAKPAD turns on gb_SYMBOL
-ifneq ($(strip $(ENABLE_SYMBOLS)$(enable_symbols)$(ENABLE_BREAKPAD)),)
-gb_SYMBOL := $(true)
-else
-gb_SYMBOL := $(false)
+# handle special cases
+ifeq ($(gb_ENABLE_SYMBOLS_FOR),1)
+gb_ENABLE_SYMBOLS_FOR := all
+endif
+ifeq ($(gb_ENABLE_SYMBOLS_FOR),0)
+gb_ENABLE_SYMBOLS_FOR :=
+endif
+ifeq ($(gb_ENABLE_SYMBOLS_FOR),yes)
+gb_ENABLE_SYMBOLS_FOR := all
+endif
+ifeq ($(gb_ENABLE_SYMBOLS_FOR),no)
+gb_ENABLE_SYMBOLS_FOR :=
endif
ifneq ($(strip $(ENABLE_PCH)),)
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index 4b2786df1856..a5059152a0cb 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -52,7 +52,7 @@ endef
# CObject class
-# $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins)
+# $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins,symbols)
define gb_CObject__command_pattern
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 26ce2a51300b..30ebb82c7e39 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -34,7 +34,7 @@ endef
# CObject class
-# $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins)
+# $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins,symbols)
define gb_CObject__command_pattern
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && \
@@ -60,7 +60,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(filter YES,$(CXXOBJECT_X64)), -U_X86_ -D_AMD64_,) \
$(if $(filter YES,$(PE_X86)), -D_X86_ -U_AMD64_,) \
-c $(3) \
- -Fo$(1)) $(if $(filter $(true),$(gb_SYMBOL)),/link /DEBUG:FASTLINK) \
+ -Fo$(1)) $(if $(filter $(true),$(6)),/link /DEBUG:FASTLINK) \
$(if $(COMPILER_TEST),,$(call gb_create_deps,$(4),$(1),$(3)))
endef
@@ -222,7 +222,6 @@ endef
gb_Windows_PE_TARGETTYPEFLAGS := \
-release \
-opt:noref \
- $(if $(filter $(true),$(gb_SYMBOL)),-debug) \
$(if $(filter NO,$(LIBRARY_X64)), -safeseh) \
-nxcompat \
-dynamicbase \
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 300a047f352d..b522f3e76572 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -259,7 +259,7 @@ gb_DEBUGINFO_FLAGS := \
-FS \
-Zi \
-gb_LINKER_DEBUGINFO_FLAGS=
+gb_LINKER_DEBUGINFO_FLAGS := -debug
gb_COMPILEROPTFLAGS := -O2 -Oy-
gb_COMPILERNOOPTFLAGS := -Od