summaryrefslogtreecommitdiff
path: root/solenv/gbuild
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 /solenv/gbuild
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)
Diffstat (limited to 'solenv/gbuild')
-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
4 files changed, 25 insertions, 42 deletions
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