diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-05-07 21:33:01 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-05-08 11:31:48 +0200 |
commit | a50812813de0594ac2aeb064ea4a95d66b8e4e42 (patch) | |
tree | 7d7acb6c2dfc0aeaa07f594f87a5cae3bff72e72 /solenv/gbuild | |
parent | c8fa9bd8849f0503b3803465e8ce119581e11e33 (diff) |
gbuild: tie optimization into selective --enable-debug:
Let --enable-debug determine whether optimization should be disabled,
which works also for debug=t due to the setup in gbuild.mk.
Also clean up uses of gb_COMPILEROPTFLAGS: this is now always set to
optimization settings, and gb_COMPILERNOOPTFLAGS used in debug case,
which should not make a difference because the only actual difference
was that on MSVC the debug OPTFLAGS were empty, but -Od is documented as
the default for this.
Diffstat (limited to 'solenv/gbuild')
-rw-r--r-- | solenv/gbuild/LinkTarget.mk | 12 | ||||
-rw-r--r-- | solenv/gbuild/platform/IOS_ARM_GCC.mk | 6 | ||||
-rw-r--r-- | solenv/gbuild/platform/WNT_INTEL_MSC.mk | 5 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_GCC_defs.mk | 4 | ||||
-rw-r--r-- | solenv/gbuild/platform/macosx.mk | 8 | ||||
-rw-r--r-- | solenv/gbuild/platform/solaris.mk | 3 | ||||
-rw-r--r-- | solenv/gbuild/platform/unxgcc.mk | 3 |
7 files changed, 12 insertions, 29 deletions
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 37949d2f601d..4e78ce5ae351 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -44,15 +44,15 @@ gb_LinkTarget__debug_enabled = \ # 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)) +gb_LinkTarget__get_debugcflags=$(if $(call gb_LinkTarget__debug_enabled,$(1)),$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUG_CFLAGS),$(gb_COMPILEROPTFLAGS)) +gb_LinkTarget__get_debugcxxflags=$(if $(call gb_LinkTarget__debug_enabled,$(1)),$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUG_CFLAGS) $(gb_DEBUG_CXXFLAGS),$(gb_COMPILEROPTFLAGS)) # 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_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))) +gb_LinkTarget__get_cflags=$(if $(CFLAGS),$(CFLAGS),$(call gb_LinkTarget__get_debugcflags,$(1))) +gb_LinkTarget__get_objcflags=$(if $(OBJCFLAGS),$(OBJCFLAGS),$(call gb_LinkTarget__get_debugcflags,$(1))) +gb_LinkTarget__get_cxxflags=$(if $(CXXFLAGS),$(CXXFLAGS),$(call gb_LinkTarget__get_debugcxxflags,$(1))) +gb_LinkTarget__get_objcxxflags=$(if $(OBJCXXFLAGS),$(OBJCXXFLAGS),$(call gb_LinkTarget__get_debugcxxflags,$(1))) # Overview of dependencies and tasks of LinkTarget # diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk index 6a91c07a558e..fbeddcafe35b 100644 --- a/solenv/gbuild/platform/IOS_ARM_GCC.mk +++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk @@ -127,10 +127,10 @@ endef # LinkTarget class -gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_COMPILEROPTFLAGS) +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) -gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) $(gb_COMPILEROPTFLAGS) -gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) $(gb_COMPILEROPTFLAGS) +gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) +gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) ifeq ($(gb_SYMBOL),$(true)) gb_LinkTarget_CFLAGS += -g diff --git a/solenv/gbuild/platform/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk index d2e562c081f3..31af24015169 100644 --- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk @@ -221,12 +221,7 @@ gb_CFLAGS+=-Zi gb_CXXFLAGS+=-Zi endif -ifneq ($(gb_DEBUGLEVEL),0) -gb_COMPILEROPTFLAGS := -else gb_COMPILEROPTFLAGS := -Ob1 -Oxs -Oy- -endif - gb_COMPILERNOOPTFLAGS := -Od ifeq ($(gb_FULLDEPS),$(true)) diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk index d84ab649e49d..6c2a4951e994 100644 --- a/solenv/gbuild/platform/com_GCC_defs.mk +++ b/solenv/gbuild/platform/com_GCC_defs.mk @@ -105,11 +105,7 @@ gb_LinkTarget_NOEXCEPTIONFLAGS := \ # optimization level -ifneq ($(gb_DEBUGLEVEL),0) -gb_COMPILEROPTFLAGS := -O0 -else gb_COMPILEROPTFLAGS := $(gb_COMPILERDEFAULTOPTFLAGS) -endif gb_COMPILERNOOPTFLAGS := -O0 # Clang does not know -ggdb2 or some other options diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk index 3650cf1c313f..9241cdac3a5d 100644 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -100,13 +100,7 @@ gb_LinkTarget_LDFLAGS := \ #man ld says: obsolete -Wl,-multiply_defined,suppress \ gb_DEBUG_CFLAGS := -g -ifneq ($(gb_DEBUGLEVEL),0) - -gb_COMPILEROPTFLAGS := -O0 -else gb_COMPILEROPTFLAGS := -O2 -endif - gb_COMPILERNOOPTFLAGS := -O0 # ObjCxxObject class @@ -168,7 +162,7 @@ endef gb_LinkTarget_CFLAGS := $(gb_CFLAGS) gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) -gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) $(gb_COMPILEROPTFLAGS) +gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) ifeq ($(gb_SYMBOL),$(true)) gb_LinkTarget_CFLAGS += -g diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index 04ec93eeb5e7..89a190bbad2f 100644 --- a/solenv/gbuild/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -168,15 +168,14 @@ gb_LinkTarget_LDFLAGS += \ endif ifneq ($(gb_DEBUGLEVEL),0) -gb_COMPILEROPTFLAGS := -O0 gb_LINKEROPTFLAGS := else -gb_COMPILEROPTFLAGS := $(gb_COMPILERDEFAULTOPTFLAGS) gb_LINKEROPTFLAGS := -Wl,-O1 endif gb_DEBUG_CFLAGS := -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline +gb_COMPILEROPTFLAGS := $(gb_COMPILERDEFAULTOPTFLAGS) gb_COMPILERNOOPTFLAGS := -O0 # LinkTarget class diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk index 2e793fd1f5d8..443b7e5b84c4 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -168,13 +168,12 @@ gb_LinkTarget_LDFLAGS += \ endif ifneq ($(gb_DEBUGLEVEL),0) -gb_COMPILEROPTFLAGS := -O0 gb_LINKEROPTFLAGS := else -gb_COMPILEROPTFLAGS := $(gb_COMPILERDEFAULTOPTFLAGS) gb_LINKEROPTFLAGS := -Wl,-O1 endif +gb_COMPILEROPTFLAGS := $(gb_COMPILERDEFAULTOPTFLAGS) gb_COMPILERNOOPTFLAGS := -O0 # LinkTarget class |