summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-05-07 20:58:44 +0200
committerMichael Stahl <mstahl@redhat.com>2012-05-08 11:30:25 +0200
commitc8fa9bd8849f0503b3803465e8ce119581e11e33 (patch)
tree610b39465070109f7b6c6515349ed0f651e9a105
parentae17a1966d58faaa7350a85f7e91f16ee3fd1fb5 (diff)
dis-entangle --enable-symbols and --enable-debug:
OOo used to use debug level this way: 0 is default for product build 1 for --enable-dbgutil 2 for environment variable debug=t, regardless of dbgutil setting in LO these have now morphed into: 0 is default for product build 1 for environment variable debug=t 2 for --enable-dbgutil (at some intermediate stage in the past) 1 for --enable-dbgutil (today) This has caused a lot of confusion and some things were not converted properly, including a check in LinkTarget.mk. Developers should use --enable-debug to get useful information, including full debug info and assertions. --enable-symbols is not intended for developers, but for people who need their builds to be able to produce useful stack traces; --enable-symbols is for example set unconditionally in the Fedora RPM spec, and for this purpose disabling of inlining is not wanted. It is unlikely that somebody wants symbols for only part of the build, and consequently a different mechanism is used to set the corresponding flags: they are set into global gb_LinkTarget_C{,XX}FLAGS. So move the selective symbol feature back to --enable-debug. (this substantially reverts db8df57acd601ed084bd0122683e1bd066a4f143)
-rw-r--r--config_host.mk.in2
-rw-r--r--configure.in48
-rw-r--r--solenv/gbuild/LinkTarget.mk27
-rw-r--r--solenv/gbuild/Module.mk4
-rw-r--r--solenv/gbuild/gbuild.mk31
-rw-r--r--solenv/gbuild/platform/unxgcc.mk5
6 files changed, 54 insertions, 63 deletions
diff --git a/config_host.mk.in b/config_host.mk.in
index 65affa921ab7..d4a5ea6b2f31 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -99,6 +99,7 @@ export DYNAMIC_CRT=@DYNAMIC_CRT@
export ENABLE_CAIRO_CANVAS=@ENABLE_CAIRO_CANVAS@
export ENABLE_CRASHDUMP=@ENABLE_CRASHDUMP@
export ENABLE_DBUS=@ENABLE_DBUS@
+export ENABLE_DEBUG_FOR=@ENABLE_DEBUG_FOR@
export ENABLE_DIRECTX=@ENABLE_DIRECTX@
export ENABLE_EVOAB2=@ENABLE_EVOAB2@
export ENABLE_GCONF=@ENABLE_GCONF@
@@ -135,7 +136,6 @@ export ENABLE_SCRIPTING_JAVASCRIPT=@ENABLE_SCRIPTING_JAVASCRIPT@
export ENABLE_SCRIPTING_PYTHON=@ENABLE_SCRIPTING_PYTHON@
export ENABLE_SILENT_MSI=@ENABLE_SILENT_MSI@
export ENABLE_SYMBOLS=@ENABLE_SYMBOLS@
-export ENABLE_SYMBOLS_FOR=@ENABLE_SYMBOLS_FOR@
export ENABLE_SYSTRAY_GTK=@ENABLE_SYSTRAY_GTK@
export ENABLE_XMLSEC=@ENABLE_XMLSEC@
export ENABLE_ZENITY=@ENABLE_ZENITY@
diff --git a/configure.in b/configure.in
index 43a6544b1eae..750899b8fd99 100644
--- a/configure.in
+++ b/configure.in
@@ -610,12 +610,8 @@ AC_ARG_ENABLE(atl,
AC_ARG_ENABLE(symbols,
AS_HELP_STRING([--enable-symbols],
[Include debugging symbols in output. WARNING - a complete build needs
- a lot of space (roughly 10 GiB) and takes much longer (enables -g compiler flag).
- You can also use this switch as follows:
- --enable-symbols="all -sw/ -Library_sc" to enable symbols only for
- the specified gbuild-build targets (all means everything, - prepended
- means not to enable, / appended means everything in the directory,
- there is no ordering and removal disabling takes precedence).]),
+ a lot of space (roughly 10 GiB) and takes much longer (enables -g
+ compiler flag for GCC or equivalent).]),
,)
AC_ARG_ENABLE(werror,
@@ -626,15 +622,25 @@ AC_ARG_ENABLE(werror,
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
- [Include debugging symbols from --enable-symbols plus extra debugging
- code. Extra large build! (enables -g compiler flag and dmake debug=true)
+ [Include debugging symbols like with --enable-symbols, disable compiler
+ optimization and inlining plus extra debugging code like assertions.
+ Extra large build! (enables -g compiler flag and dmake debug=true)
If you need even more verbose output, build a module with
- "build -- debug=true dbglevel=2".]))
+ "build -- debug=true dbglevel=2".
+ You can also use this switch as follows:
+ --enable-debug="all -sw/ -Library_sc" to enable symbols only for
+ the specified gbuild-build targets (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).]))
AC_ARG_ENABLE(dbgutil,
AS_HELP_STRING([--enable-dbgutil],
[Include additional debugging utilities, such as assertions, object
- counting, etc. Larger build. Independent from --enable-debug]))
+ counting, etc. Larger build. Independent from --enable-debug.
+ Note that this option makes the build ABI incompatible:
+ It is not possible to mix object files or libraries from a
+ --enable-dgbutil and a --disalbe-dbgutil build.]))
AC_ARG_ENABLE(linkoo,
AS_HELP_STRING([--disable-linkoo],
@@ -3529,13 +3535,23 @@ dnl Set the ENABLE_DEBUG variable.
dnl ===================================================================
AC_MSG_CHECKING([whether to do a debug build])
if test -n "$enable_debug" && test "$enable_debug" != "no"; then
- ENABLE_DEBUG="TRUE"
+ if test "$enable_debug" = "y" || test "$enable_debug" = "yes"; then
+ ENABLE_DEBUG="TRUE"
+ ENABLE_DEBUG_FOR=all
+ AC_MSG_RESULT([yes])
+ else
+ ENABLE_DEBUG=""
+ ENABLE_DEBUG_FOR="$enable_debug"
+ AC_MSG_RESULT([for $enable_debug])
+ fi
AC_MSG_RESULT([yes])
else
ENABLE_DEBUG=""
+ ENABLE_DEBUG_FOR=""
AC_MSG_RESULT([no])
fi
AC_SUBST(ENABLE_DEBUG)
+AC_SUBST(ENABLE_DEBUG_FOR)
dnl Determine whether to use linkoo for the smoketest installation
@@ -3567,20 +3583,12 @@ dnl ===================================================================
AC_MSG_CHECKING([whether to include symbols])
if test -n "$enable_symbols" -a "$enable_symbols" != "no"; then
ENABLE_SYMBOLS="TRUE"
- if test "$enable_symbols" = "y" || test "$enable_symbols" = "yes"; then
- ENABLE_SYMBOLS_FOR=all
- AC_MSG_RESULT([yes])
- else
- ENABLE_SYMBOLS_FOR="$enable_symbols"
- AC_MSG_RESULT([for $enable_symbols])
- fi
+ AC_MSG_RESULT([yes])
else
ENABLE_SYMBOLS=
- ENABLE_SYMBOLS_FOR=
AC_MSG_RESULT([no])
fi
AC_SUBST(ENABLE_SYMBOLS)
-AC_SUBST(ENABLE_SYMBOLS_FOR)
if test "$enable_headless" = "yes"; then
# be sure to do not mess with uneeded stuff
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 5d256152a287..37949d2f601d 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -37,27 +37,22 @@
# LDFLAGS
# enable if: no "-TARGET" defined AND [module is enabled OR "TARGET" defined]
-gb_LinkTarget__symbols_enabled = \
- $(and $(if $(filter -$(1),$(ENABLE_SYMBOLS_FOR)),,$(true)),\
+gb_LinkTarget__debug_enabled = \
+ $(and $(if $(filter -$(1),$(ENABLE_DEBUG_FOR)),,$(true)),\
$(or $(gb_Module_CURRENTMODULE_DEBUG_ENABLED),\
- $(filter $(1),$(ENABLE_SYMBOLS_FOR))))
+ $(filter $(1),$(ENABLE_DEBUG_FOR))))
-# debug flags, if ENABLE_SYMBOLS is set and the LinkTarget is named
-# in the list of libraries of ENABLE_SYMBOLS_FOR
-ifeq ($(gb_SYMBOL),$(true))
-gb_LinkTarget__get_symbolscflags=$(if $(call gb_LinkTarget__symbols_enabled,$(1)),$(gb_DEBUG_CFLAGS))
-gb_LinkTarget__get_symbolscxxflags=$(if $(call gb_LinkTarget__symbols_enabled,$(1)),$(gb_DEBUG_CFLAGS) $(gb_DEBUG_CXXFLAGS))
-else
-gb_LinkTarget__get_symbolscflags=
-gb_LinkTarget__get_symbolscxxflags=
-endif
+# debug flags, if ENABLE_DEBUG is set and the LinkTarget is named
+# in the list of libraries of ENABLE_DEBUG_FOR
+gb_LinkTarget__get_debugcflags=$(if $(call gb_LinkTarget__debug_enabled,$(1)),$(gb_DEBUG_CFLAGS))
+gb_LinkTarget__get_debugcxxflags=$(if $(call gb_LinkTarget__debug_enabled,$(1)),$(gb_DEBUG_CFLAGS) $(gb_DEBUG_CXXFLAGS))
# generic cflags/cxxflags to use (optimization flags, debug flags)
# user supplied CFLAGS/CXXFLAGS override default debug/optimization flags
-gb_LinkTarget__get_cflags=$(if $(CFLAGS),$(CFLAGS),$(gb_COMPILEROPTFLAGS) $(call gb_LinkTarget__get_symbolscflags,$(1)))
-gb_LinkTarget__get_objcflags=$(if $(OBJCFLAGS),$(OBJCFLAGS),$(gb_COMPILEROPTFLAGS) $(call gb_LinkTarget__get_symbolscflags,$(1)))
-gb_LinkTarget__get_cxxflags=$(if $(CXXFLAGS),$(CXXFLAGS),$(gb_COMPILEROPTFLAGS) $(call gb_LinkTarget__get_symbolscxxflags,$(1)))
-gb_LinkTarget__get_objcxxflags=$(if $(OBJCXXFLAGS),$(OBJCXXFLAGS),$(gb_COMPILEROPTFLAGS) $(call gb_LinkTarget__get_symbolscxxflags,$(1)))
+gb_LinkTarget__get_cflags=$(if $(CFLAGS),$(CFLAGS),$(gb_COMPILEROPTFLAGS) $(call gb_LinkTarget__get_debugcflags,$(1)))
+gb_LinkTarget__get_objcflags=$(if $(OBJCFLAGS),$(OBJCFLAGS),$(gb_COMPILEROPTFLAGS) $(call gb_LinkTarget__get_debugcflags,$(1)))
+gb_LinkTarget__get_cxxflags=$(if $(CXXFLAGS),$(CXXFLAGS),$(gb_COMPILEROPTFLAGS) $(call gb_LinkTarget__get_debugcxxflags,$(1)))
+gb_LinkTarget__get_objcxxflags=$(if $(OBJCXXFLAGS),$(OBJCXXFLAGS),$(gb_COMPILEROPTFLAGS) $(call gb_LinkTarget__get_debugcxxflags,$(1)))
# Overview of dependencies and tasks of LinkTarget
#
diff --git a/solenv/gbuild/Module.mk b/solenv/gbuild/Module.mk
index 486a2fe7d2ac..e5f87f0f5cd4 100644
--- a/solenv/gbuild/Module.mk
+++ b/solenv/gbuild/Module.mk
@@ -180,8 +180,8 @@ showmodules :
# enable if: no "-MODULE/" defined AND ["all" defined OR "MODULE/" defined]
gb_Module__debug_enabled = \
- $(and $(if $(filter -$(1)/,$(ENABLE_SYMBOLS_FOR)),,$(true)),\
- $(filter all $(1)/,$(ENABLE_SYMBOLS_FOR)))
+ $(and $(if $(filter -$(1)/,$(ENABLE_DEBUG_FOR)),,$(true)),\
+ $(filter all $(1)/,$(ENABLE_DEBUG_FOR)))
define gb_Module_Module
gb_Module_ALLMODULES += $(1)
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 9d3ed3a37205..1457f3d1df84 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -79,19 +79,10 @@ else
gb_PRODUCT := $(false)
endif
-gb_SYMBOL := $(false)
-ifneq ($(strip $(ENABLE_SYMBOLS)),)
+ifneq ($(strip $(ENABLE_SYMBOLS)$(enable_symbols)),)
gb_SYMBOL := $(true)
-# make sure symbols are enabled if overriden using the command line
-ifeq ($(origin ENABLE_SYMBOLS),command line)
-ENABLE_SYMBOLS_FOR = all
-endif
-endif
-ifneq ($(strip $(enable_symbols)),)
-gb_SYMBOL := $(true)
-ifeq ($(origin enable_symbols),command line)
-ENABLE_SYMBOLS_FOR = all
-endif
+else
+gb_SYMBOL := $(false)
endif
gb_TIMELOG := 0
@@ -103,13 +94,13 @@ gb_DEBUGLEVEL := 0
ifneq ($(strip $(DEBUG)),)
gb_DEBUGLEVEL := 1
ifeq ($(origin DEBUG),command line)
-ENABLE_SYMBOLS_FOR = all
+ENABLE_DEBUG_FOR := all
endif
endif
ifneq ($(strip $(debug)),)
gb_DEBUGLEVEL := 1
ifeq ($(origin debug),command line)
-ENABLE_SYMBOLS_FOR = all
+ENABLE_DEBUG_FOR := all
endif
endif
ifeq ($(gb_PRODUCT),$(false))
@@ -119,13 +110,13 @@ endif
ifneq ($(strip $(DBGLEVEL)),)
gb_DEBUGLEVEL := $(strip $(DBGLEVEL))
ifeq ($(origin DBGLEVEL),command line)
-ENABLE_SYMBOLS_FOR = all
+ENABLE_DEBUG_FOR := all
endif
endif
ifneq ($(strip $(dbglevel)),)
gb_DEBUGLEVEL := $(strip $(dbglevel))
ifeq ($(origin dbglevel),command line)
-ENABLE_SYMBOLS_FOR = all
+ENABLE_DEBUG_FOR := all
endif
endif
@@ -133,14 +124,6 @@ ifneq ($(gb_DEBUGLEVEL),0)
gb_SYMBOL := $(true)
endif
-# if symbols are triggered by something else than --enable-symbols,
-# make sure they are actually enabled
-ifeq ($(gb_SYMBOL),$(true))
-ifeq ($(ENABLE_SYMBOLS_FOR),)
-ENABLE_SYMBOLS_FOR = all
-endif
-endif
-
ifneq ($(nodep),)
gb_FULLDEPS := $(false)
else
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 89665d60090a..2e793fd1f5d8 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -194,6 +194,11 @@ gb_LinkTarget__RPATHS := \
gb_LinkTarget_CFLAGS := $(gb_CFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS)
+ifeq ($(gb_SYMBOL),$(true))
+gb_LinkTarget_CXXFLAGS += $(GGDB2)
+gb_LinkTarget_CFLAGS += $(GGDB2)
+endif
+
# note that `cat $(extraobjectlist)` is needed to build with older gcc versions, e.g. 4.1.2 on SLED10
# we want to use @$(extraobjectlist) in the long run
define gb_LinkTarget__command_dynamiclink