Kaydet (Commit) eeeec33a authored tarafından Luboš Luňák's avatar Luboš Luňák

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: 's avatarLuboš Luňák <l.lunak@collabora.com>
üst 4bbdab90
...@@ -131,7 +131,6 @@ export ENABLE_DBGUTIL=@ENABLE_DBGUTIL@ ...@@ -131,7 +131,6 @@ export ENABLE_DBGUTIL=@ENABLE_DBGUTIL@
export ENABLE_DBUS=@ENABLE_DBUS@ export ENABLE_DBUS=@ENABLE_DBUS@
export ENABLE_DCONF=@ENABLE_DCONF@ export ENABLE_DCONF=@ENABLE_DCONF@
export ENABLE_DEBUG=@ENABLE_DEBUG@ export ENABLE_DEBUG=@ENABLE_DEBUG@
export ENABLE_DEBUGINFO_FOR=@ENABLE_DEBUGINFO_FOR@
export ENABLE_EOT=@ENABLE_EOT@ export ENABLE_EOT=@ENABLE_EOT@
export ENABLE_EVOAB2=@ENABLE_EVOAB2@ export ENABLE_EVOAB2=@ENABLE_EVOAB2@
export ENABLE_FIREBIRD_SDBC=@ENABLE_FIREBIRD_SDBC@ export ENABLE_FIREBIRD_SDBC=@ENABLE_FIREBIRD_SDBC@
...@@ -179,7 +178,7 @@ export ENABLE_SCRIPTING_JAVASCRIPT=@ENABLE_SCRIPTING_JAVASCRIPT@ ...@@ -179,7 +178,7 @@ export ENABLE_SCRIPTING_JAVASCRIPT=@ENABLE_SCRIPTING_JAVASCRIPT@
export ENABLE_SDREMOTE=@ENABLE_SDREMOTE@ export ENABLE_SDREMOTE=@ENABLE_SDREMOTE@
export ENABLE_SDREMOTE_BLUETOOTH=@ENABLE_SDREMOTE_BLUETOOTH@ export ENABLE_SDREMOTE_BLUETOOTH=@ENABLE_SDREMOTE_BLUETOOTH@
export ENABLE_SILENT_MSI=@ENABLE_SILENT_MSI@ 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_VALGRIND=@ENABLE_VALGRIND@
export ENABLE_VLC=@ENABLE_VLC@ export ENABLE_VLC=@ENABLE_VLC@
export ENABLE_WERROR=@ENABLE_WERROR@ export ENABLE_WERROR=@ENABLE_WERROR@
......
...@@ -1145,20 +1145,15 @@ libo_FUZZ_ARG_ENABLE(sal-log, ...@@ -1145,20 +1145,15 @@ libo_FUZZ_ARG_ENABLE(sal-log,
AS_HELP_STRING([--enable-sal-log], AS_HELP_STRING([--enable-sal-log],
[Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.])) [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, libo_FUZZ_ARG_ENABLE(symbols,
AS_HELP_STRING([--enable-symbols], AS_HELP_STRING([--enable-symbols],
[Generate debug information. [Generate debug information.
By default, enabled for --enable-debug and --enable-dbgutil, disabled 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, libo_FUZZ_ARG_ENABLE(optimized,
AS_HELP_STRING([--disable-optimized], AS_HELP_STRING([--disable-optimized],
...@@ -3813,7 +3808,7 @@ AC_SUBST(MSVC_USE_DEBUG_RUNTIME) ...@@ -3813,7 +3808,7 @@ AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
dnl Set the ENABLE_DEBUG variable. dnl Set the ENABLE_DEBUG variable.
dnl =================================================================== dnl ===================================================================
if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then 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 fi
if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
if test -z "$libo_fuzzed_enable_debug"; then if test -z "$libo_fuzzed_enable_debug"; then
...@@ -4048,27 +4043,6 @@ if test "$enable_sal_log" = yes; then ...@@ -4048,27 +4043,6 @@ if test "$enable_sal_log" = yes; then
fi fi
AC_SUBST(ENABLE_SAL_LOG) 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 Check for enable symbols option
dnl =================================================================== dnl ===================================================================
AC_MSG_CHECKING([whether to generate debug information]) AC_MSG_CHECKING([whether to generate debug information])
...@@ -4079,14 +4053,18 @@ if test -z "$enable_symbols"; then ...@@ -4079,14 +4053,18 @@ if test -z "$enable_symbols"; then
enable_symbols=no enable_symbols=no
fi fi
fi fi
if test "$enable_symbols" != no; then if test "$enable_symbols" = yes; then
ENABLE_SYMBOLS=TRUE ENABLE_SYMBOLS_FOR=all
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
else elif test "$enable_symbols" = no; then
ENABLE_SYMBOLS= ENABLE_SYMBOLS_FOR=
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
else
# Selective debuginfo.
ENABLE_SYMBOLS_FOR="$enable_symbols"
AC_MSG_RESULT([for "$enable_symbols"])
fi 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 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. # Building on Android with full symbols: without enough memory the linker never finishes currently.
......
...@@ -36,21 +36,21 @@ ...@@ -36,21 +36,21 @@
# gb_LinkTarget_INCLUDE # gb_LinkTarget_INCLUDE
# gb_YaccTarget__command(grammar-file, stem-for-message, source-target, include-target) # 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] # enable if: no "-TARGET" defined AND [module is enabled OR "TARGET" defined]
gb_LinkTarget__debug_enabled = \ gb_LinkTarget__symbols_enabled = \
$(and $(if $(filter -$(1),$(ENABLE_DEBUGINFO_FOR)),,$(true)),\ $(and $(if $(filter -$(1),$(ENABLE_SYMBOLS_FOR)),,$(true)),\
$(or $(gb_Module_CURRENTMODULE_DEBUG_ENABLED),\ $(or $(gb_Module_CURRENTMODULE_SYMBOLS_ENABLED),\
$(filter $(1),$(ENABLE_DEBUGINFO_FOR)))) $(filter $(1),$(ENABLE_SYMBOLS_FOR))))
# debug flags, if ENABLE_DEBUG is set and the LinkTarget is named # debug flags, if the LinkTarget is named in the list of libraries of ENABLE_SYMBOLS_FOR
# in the list of libraries of ENABLE_DEBUGINFO_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 $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(filter $(true),$(gb_SYMBOL)),$(gb_DEBUGINFO_FLAGS))
# similar for LDFLAGS, use linker optimization flags in non-debug case, # similar for LDFLAGS, use linker optimization flags in non-debug case,
# but moreover strip debug from libraries for which debuginfo is not wanted # but moreover strip debug from libraries for which debuginfo is not wanted
# (some libraries reuse .o files from other libraries, notably unittests) # (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_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) # generic cflags/cxxflags to use (optimization flags, debug flags)
# user supplied CFLAGS/CXXFLAGS override default debug/optimization 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 ...@@ -237,7 +237,7 @@ $(call gb_CObject_get_target,%) : $(call gb_CObject_get_source,$(SRCDIR),%) $(gb
else else
$(call gb_CObject_get_target,%) : $(call gb_CObject_get_source,$(SRCDIR),%) $(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_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 endif
# Note: if the *Object_dep_target does not exist it will be created by # Note: if the *Object_dep_target does not exist it will be created by
...@@ -289,7 +289,7 @@ else ...@@ -289,7 +289,7 @@ else
$(call gb_CxxObject_get_target,%) : $(call gb_CxxObject_get_source,$(SRCDIR),%) $(call gb_CxxObject_get_target,%) : $(call gb_CxxObject_get_source,$(SRCDIR),%)
$(call gb_Output_announce,$*.cxx,$(true),$(if $(COMPILER_TEST),CPT,CXX),3) $(call gb_Output_announce,$*.cxx,$(true),$(if $(COMPILER_TEST),CPT,CXX),3)
$(eval $(gb_CxxObject__set_pchflags)) $(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 endif
ifeq ($(gb_FULLDEPS),$(true)) ifeq ($(gb_FULLDEPS),$(true))
...@@ -313,7 +313,7 @@ gb_GenCObject_get_source = $(WORKDIR)/$(1).c ...@@ -313,7 +313,7 @@ gb_GenCObject_get_source = $(WORKDIR)/$(1).c
$(call gb_GenCObject_get_target,%) : $(gb_FORCE_COMPILE_ALL_TARGET) $(call gb_GenCObject_get_target,%) : $(gb_FORCE_COMPILE_ALL_TARGET)
$(call gb_Output_announce,$*.c,$(true),C ,3) $(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) 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)) ifeq ($(gb_FULLDEPS),$(true))
$(dir $(call gb_GenCObject_get_dep_target,%)).dir : $(dir $(call gb_GenCObject_get_dep_target,%)).dir :
...@@ -336,7 +336,7 @@ $(call gb_GenCxxObject_get_target,%) : $(gb_FORCE_COMPILE_ALL_TARGET) ...@@ -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) $(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) test -f $(GEN_CXX_SOURCE) || (echo "Missing generated source file $(GEN_CXX_SOURCE)" && false)
$(eval $(gb_CxxObject__set_pchflags)) $(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)) ifeq ($(gb_FULLDEPS),$(true))
$(dir $(call gb_GenCxxObject_get_dep_target,%)).dir : $(dir $(call gb_GenCxxObject_get_dep_target,%)).dir :
...@@ -359,7 +359,7 @@ gb_GenCxxClrObject_get_source = $(WORKDIR)/$(1).$(gb_LinkTarget_CXX_SUFFIX_$(cal ...@@ -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_GenCxxClrObject_get_target,%) : $(gb_FORCE_COMPILE_ALL_TARGET)
$(call gb_Output_announce,$(subst $(BUILDDIR)/,,$(GEN_CXXCLR_SOURCE)),$(true),CLR,3) $(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) 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)) ifeq ($(gb_FULLDEPS),$(true))
$(dir $(call gb_GenCxxClrObject_get_dep_target,%)).dir : $(dir $(call gb_GenCxxClrObject_get_dep_target,%)).dir :
...@@ -444,7 +444,7 @@ $(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDI ...@@ -444,7 +444,7 @@ $(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDI
else else
$(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDIR),%) $(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_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 endif
ifeq ($(gb_FULLDEPS),$(true)) ifeq ($(gb_FULLDEPS),$(true))
...@@ -471,7 +471,7 @@ $(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),% ...@@ -471,7 +471,7 @@ $(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%
else else
$(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%) $(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_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 endif
ifeq ($(gb_FULLDEPS),$(true)) ifeq ($(gb_FULLDEPS),$(true))
...@@ -498,7 +498,7 @@ $(call gb_CxxClrObject_get_target,%) : $(call gb_CxxClrObject_get_source,$(SRCDI ...@@ -498,7 +498,7 @@ $(call gb_CxxClrObject_get_target,%) : $(call gb_CxxClrObject_get_source,$(SRCDI
else else
$(call gb_CxxClrObject_get_target,%) : $(call gb_CxxClrObject_get_source,$(SRCDIR),%) $(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_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 endif
ifeq ($(gb_FULLDEPS),$(true)) ifeq ($(gb_FULLDEPS),$(true))
...@@ -791,6 +791,7 @@ $(call gb_LinkTarget_get_target,$(1)) : PLUGIN_WARNINGS_AS_ERRORS := ...@@ -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)) : EXTERNAL_CODE :=
$(call gb_LinkTarget_get_target,$(1)) : SOVERSIONSCRIPT := $(call gb_LinkTarget_get_target,$(1)) : SOVERSIONSCRIPT :=
$(call gb_LinkTarget_get_target,$(1)) : COMPILER_TEST := $(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 ($(gb_FULLDEPS),$(true))
ifeq (depcache:,$(filter depcache,$(.FEATURES)):$(gb_PARTIAL_BUILD)) ifeq (depcache:,$(filter depcache,$(.FEATURES)):$(gb_PARTIAL_BUILD))
......
...@@ -239,9 +239,9 @@ $(WORKDIR)/pot.done : $(foreach exec,cfgex helpex localize propex ulfex xrmex tr ...@@ -239,9 +239,9 @@ $(WORKDIR)/pot.done : $(foreach exec,cfgex helpex localize propex ulfex xrmex tr
&& touch $@) && touch $@)
# enable if: no "-MODULE/" defined AND ["all" defined OR "MODULE/" defined] # enable if: no "-MODULE/" defined AND ["all" defined OR "MODULE/" defined]
gb_Module__debug_enabled = \ gb_Module__symbols_enabled = \
$(and $(if $(filter -$(1)/,$(ENABLE_DEBUGINFO_FOR)),,$(true)),\ $(and $(if $(filter -$(1)/,$(gb_ENABLE_SYMBOLS_FOR)),,$(true)),\
$(filter all $(1)/,$(ENABLE_DEBUGINFO_FOR))) $(filter all $(1)/,$(gb_ENABLE_SYMBOLS_FOR)))
define gb_Module_Module define gb_Module_Module
gb_Module_ALLMODULES += $(1) gb_Module_ALLMODULES += $(1)
...@@ -256,7 +256,7 @@ gb_Module_SUBSEQUENTCHECKTARGETSTACK := $(call gb_Module_get_subsequentcheck_tar ...@@ -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_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_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_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) gb_Module_CURRENTMODULE_NAME := $(1)
$(call gb_Helper_make_userfriendly_targets,$(1),Module) $(call gb_Helper_make_userfriendly_targets,$(1),Module)
$(if $(filter-out libreoffice instsetoo_native android ios,$(1)),\ $(if $(filter-out libreoffice instsetoo_native android ios,$(1)),\
......
...@@ -22,12 +22,9 @@ ...@@ -22,12 +22,9 @@
ifeq ($(gb_ENABLE_PCH),$(true)) ifeq ($(gb_ENABLE_PCH),$(true))
# gb_PrecompiledHeader_get_enableflags defined by platform # Use different PCH file depending on whether we use debugging symbols.
ifneq ($(strip $(gb_DEBUGLEVEL)$(gb_SYMBOL)),0) # TODO: This doesn't work because T_SYMBOLS is not expanded as/when necessary.
gb_PrecompiledHeader_DEBUGDIR := debug gb_PrecompiledHeader__get_debugdir := $(if $(filter $(true),$(T_SYMBOLS)),debug,nodebug)
else
gb_PrecompiledHeader_DEBUGDIR := nodebug
endif
$(call gb_PrecompiledHeader_get_dep_target,%) : $(call gb_PrecompiledHeader_get_dep_target,%) :
$(call gb_Helper_abbreviate_dirs,\ $(call gb_Helper_abbreviate_dirs,\
......
...@@ -146,10 +146,10 @@ gb_Package_get_target_for_build = $(WORKDIR_FOR_BUILD)/Package/$(1).filelist ...@@ -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_PackageSet_get_target = $(WORKDIR)/PackageSet/$(1).filelist
gb_PackageInfo_get_target = $(WORKDIR)/PackageInfo gb_PackageInfo_get_target = $(WORKDIR)/PackageInfo
gb_Postprocess_get_target = $(WORKDIR)/Postprocess/$(1) 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_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_target = $(WORKDIR)/PrecompiledHeader/$(call gb_PrecompiledHeader__get_debugdir)/$(1).hxx.gch
gb_PrecompiledHeader_get_timestamp = $(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/Timestamps/$(1) gb_PrecompiledHeader_get_timestamp = $(WORKDIR)/PrecompiledHeader/$(call gb_PrecompiledHeader__get_debugdir)/Timestamps/$(1)
gb_PropertiesTranslateTarget_get_target = $(WORKDIR)/PropertiesTranslateTarget/$(1).properties gb_PropertiesTranslateTarget_get_target = $(WORKDIR)/PropertiesTranslateTarget/$(1).properties
gb_Pyuno_get_final_target = $(WORKDIR)/Pyuno/$(1).final gb_Pyuno_get_final_target = $(WORKDIR)/Pyuno/$(1).final
gb_Pyuno_get_target = $(WORKDIR)/Pyuno/$(1).done gb_Pyuno_get_target = $(WORKDIR)/Pyuno/$(1).done
......
...@@ -82,20 +82,33 @@ else ...@@ -82,20 +82,33 @@ else
gb_ENABLE_DBGUTIL := $(false) gb_ENABLE_DBGUTIL := $(false)
endif 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 gb_DEBUGLEVEL := 0
ifneq ($(strip $(DEBUG)),) ifneq ($(strip $(DEBUG)),)
gb_DEBUGLEVEL := 1 gb_DEBUGLEVEL := 1
# make DEBUG=true should force -g # make DEBUG=true should force -g
ifeq ($(origin DEBUG),command line) ifeq ($(origin DEBUG),command line)
ENABLE_DEBUGINFO_FOR := all gb_ENABLE_SYMBOLS_FOR := all
ENABLE_SYMBOLS := TRUE
endif endif
endif endif
ifneq ($(strip $(debug)),) ifneq ($(strip $(debug)),)
gb_DEBUGLEVEL := 1 gb_DEBUGLEVEL := 1
ifeq ($(origin debug),command line) ifeq ($(origin debug),command line)
ENABLE_DEBUGINFO_FOR := all gb_ENABLE_SYMBOLS_FOR := all
ENABLE_SYMBOLS := TRUE
endif endif
endif endif
ifeq ($(gb_ENABLE_DBGUTIL),$(true)) ifeq ($(gb_ENABLE_DBGUTIL),$(true))
...@@ -105,21 +118,28 @@ endif ...@@ -105,21 +118,28 @@ endif
ifneq ($(strip $(DBGLEVEL)),) ifneq ($(strip $(DBGLEVEL)),)
gb_DEBUGLEVEL := $(strip $(DBGLEVEL)) gb_DEBUGLEVEL := $(strip $(DBGLEVEL))
ifeq ($(origin DBGLEVEL),command line) ifeq ($(origin DBGLEVEL),command line)
ENABLE_DEBUGINFO_FOR := all gb_ENABLE_SYMBOLS_FOR := all
endif endif
endif endif
ifneq ($(strip $(dbglevel)),) ifneq ($(strip $(dbglevel)),)
gb_DEBUGLEVEL := $(strip $(dbglevel)) gb_DEBUGLEVEL := $(strip $(dbglevel))
ifeq ($(origin dbglevel),command line) ifeq ($(origin dbglevel),command line)
ENABLE_DEBUGINFO_FOR := all gb_ENABLE_SYMBOLS_FOR := all
endif endif
endif endif
# note: ENABLE_BREAKPAD turns on gb_SYMBOL # handle special cases
ifneq ($(strip $(ENABLE_SYMBOLS)$(enable_symbols)$(ENABLE_BREAKPAD)),) ifeq ($(gb_ENABLE_SYMBOLS_FOR),1)
gb_SYMBOL := $(true) gb_ENABLE_SYMBOLS_FOR := all
else endif
gb_SYMBOL := $(false) 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 endif
ifneq ($(strip $(ENABLE_PCH)),) ifneq ($(strip $(ENABLE_PCH)),)
......
...@@ -52,7 +52,7 @@ endef ...@@ -52,7 +52,7 @@ endef
# CObject class # 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 define gb_CObject__command_pattern
$(call gb_Helper_abbreviate_dirs,\ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \ mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \
......
...@@ -34,7 +34,7 @@ endef ...@@ -34,7 +34,7 @@ endef
# CObject class # 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 define gb_CObject__command_pattern
$(call gb_Helper_abbreviate_dirs,\ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && \ mkdir -p $(dir $(1)) $(dir $(4)) && \
...@@ -60,7 +60,7 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -60,7 +60,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(filter YES,$(CXXOBJECT_X64)), -U_X86_ -D_AMD64_,) \ $(if $(filter YES,$(CXXOBJECT_X64)), -U_X86_ -D_AMD64_,) \
$(if $(filter YES,$(PE_X86)), -D_X86_ -U_AMD64_,) \ $(if $(filter YES,$(PE_X86)), -D_X86_ -U_AMD64_,) \
-c $(3) \ -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))) $(if $(COMPILER_TEST),,$(call gb_create_deps,$(4),$(1),$(3)))
endef endef
...@@ -222,7 +222,6 @@ endef ...@@ -222,7 +222,6 @@ endef
gb_Windows_PE_TARGETTYPEFLAGS := \ gb_Windows_PE_TARGETTYPEFLAGS := \
-release \ -release \
-opt:noref \ -opt:noref \
$(if $(filter $(true),$(gb_SYMBOL)),-debug) \
$(if $(filter NO,$(LIBRARY_X64)), -safeseh) \ $(if $(filter NO,$(LIBRARY_X64)), -safeseh) \
-nxcompat \ -nxcompat \
-dynamicbase \ -dynamicbase \
......
...@@ -259,7 +259,7 @@ gb_DEBUGINFO_FLAGS := \ ...@@ -259,7 +259,7 @@ gb_DEBUGINFO_FLAGS := \
-FS \ -FS \
-Zi \ -Zi \
gb_LINKER_DEBUGINFO_FLAGS= gb_LINKER_DEBUGINFO_FLAGS := -debug
gb_COMPILEROPTFLAGS := -O2 -Oy- gb_COMPILEROPTFLAGS := -O2 -Oy-
gb_COMPILERNOOPTFLAGS := -Od gb_COMPILERNOOPTFLAGS := -Od
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment