summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Ostrovsky <david@ostrovsky.org>2012-11-03 21:06:49 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-11-23 23:42:39 +0000
commit47cf2c9441d2d73c8626ba42dcbad0331274cf43 (patch)
tree135ba482bc179330638e6fd688bb8113f2b33ca2
parent80086a82883239cad5a6e667c8ff174623e190a2 (diff)
restore --enable-symbols option
Currently there are 4 different debug options: --enable-dbgutil (the recommended one) --enable-debug --enable-selective-debuginfo --enable-symbols (for advanced users only) In this table the properties of each option is shown: ---------------------------------------- options\properties | O | S | D | T | U | ---------------------------------------- production-code | x | - | - | - | - | ---------------------------------------- --enable-symbols | x | x | - | - | - | ---------------------------------------- --enable-debug | - | x | x | x | - | ---------------------------------------- --enable-dbgutil | - | x | x | x | x | ---------------------------------------- where O: optimization S: debug symbols D: debug STL T: trace facility U: additional debug utility (object counting) Note: --enable-selective-debuginfo has the same properties as --enable-debug Change-Id: Ib8a28c6162f47526d6bb33f81f53835cd11894b2
-rw-r--r--config_host.mk.in1
-rw-r--r--configure.ac39
-rw-r--r--solenv/gbuild/gbuild.help.txt2
-rw-r--r--solenv/gbuild/gbuild.mk8
-rw-r--r--solenv/gbuild/platform/IOS_ARM_GCC.mk7
-rw-r--r--solenv/gbuild/platform/WNT_INTEL_GCC.mk6
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk5
-rw-r--r--solenv/gbuild/platform/macosx.mk7
-rw-r--r--solenv/gbuild/platform/solaris.mk5
-rw-r--r--solenv/gbuild/platform/unxgcc.mk9
10 files changed, 82 insertions, 7 deletions
diff --git a/config_host.mk.in b/config_host.mk.in
index 52d98506a27b..fdb3c334cd1d 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -176,6 +176,7 @@ export ENABLE_SCRIPTING_BEANSHELL=@ENABLE_SCRIPTING_BEANSHELL@
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_SYSTRAY_GTK=@ENABLE_SYSTRAY_GTK@
export ENABLE_TELEPATHY=@ENABLE_TELEPATHY@
export ENABLE_ZENITY=@ENABLE_ZENITY@
diff --git a/configure.ac b/configure.ac
index b9c4d16cde01..add46ca0c8be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -757,12 +757,6 @@ AC_ARG_ENABLE(assert-always-abort,
[make assert() abort even in release code.]),
,)
-AC_ARG_ENABLE(debug,
- AS_HELP_STRING([--enable-debug],
- [Include debugging information, disable compiler optimization and inlining plus
- extra debugging code like assertions. Extra large build! (enables -g compiler flag
- and dmake debug=true).]))
-
AC_ARG_ENABLE(dbgutil,
AS_HELP_STRING([--enable-dbgutil],
[Provide debugging support from --enable-debug and include additional debugging
@@ -771,6 +765,12 @@ AC_ARG_ENABLE(dbgutil,
Note that this makes the build ABI incompatible, it is not possible to mix object
files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
+AC_ARG_ENABLE(debug,
+ AS_HELP_STRING([--enable-debug],
+ [Include debugging information, disable compiler optimization and inlining plus
+ extra debugging code like assertions. Extra large build! (enables -g compiler flag
+ and dmake debug=true).]))
+
AC_ARG_ENABLE(selective-debuginfo,
AS_HELP_STRING([--enable-selective-debuginfo],
[If --enable-debug or --enable-dbgutil is used, build debugging information
@@ -780,6 +780,12 @@ AC_ARG_ENABLE(selective-debuginfo,
more general, and disabling takes precedence).
Example: --enable-selective-debuginfo="all -sw/ -Library_sc".]))
+AC_ARG_ENABLE(symbols,
+ AS_HELP_STRING([--enable-symbols],
+ [Include debugging symbols in output while preserve optimization.
+ This enables -g compiler flag for GCC or equivalent,
+ without changing anything else compared to productive code.]))
+
AC_ARG_ENABLE(compiler-plugins,
AS_HELP_STRING([--enable-compiler-plugins],
[Enable compiler plugins that will perform additional checks during
@@ -3351,6 +3357,27 @@ if test -n "$ENABLE_DEBUG"; then
fi
AC_SUBST(ENABLE_DEBUGINFO_FOR)
+dnl Check for enable symbols option
+dnl ===================================================================
+AC_MSG_CHECKING([whether to include symbols while preserve optimization])
+if test -n "$enable_symbols" -a "$enable_symbols" != "no"; then
+ ENABLE_SYMBOLS="TRUE"
+ if test -n "$ENABLE_DBGUTIL"; then
+ AC_MSG_ERROR([--enable-dbgutil cannot be used with --enable-symbols])
+ elif test -n "$ENABLE_DEBUG"; then
+ AC_MSG_ERROR([--enable-debug cannot be used with --enable-symbols])
+ fi
+ AC_MSG_RESULT([yes])
+else
+ if test -n "$enable_symbols" -a "$enable_symbols" = "no"; then
+ ENABLE_SYMBOLS="FALSE"
+ else
+ ENABLE_SYMBOLS=
+ fi
+ AC_MSG_RESULT([no])
+fi
+AC_SUBST(ENABLE_SYMBOLS)
+
dnl Check for explicit C/CXX/OBJC/OBJCXX/LDFLAGS. We by default use the ones specified
dnl by our build system, but explicit override is possible.
AC_MSG_CHECKING(for explicit CFLAGS)
diff --git a/solenv/gbuild/gbuild.help.txt b/solenv/gbuild/gbuild.help.txt
index 0b1e9ca924f7..83b4550d9b93 100644
--- a/solenv/gbuild/gbuild.help.txt
+++ b/solenv/gbuild/gbuild.help.txt
@@ -49,6 +49,8 @@ AVAILABLE TARGETS
INTERACTIVE VARIABLES:
DEBUG / debug If not empty, build as with --enable-debug.
+ ENABLE_SYMBOLS / enable_symbols
+ If not empty, build as with --enable-symbols.
DBGLEVEL / dbglevel
If not empty, force the debug level to the specified value. The
debug level is passed to the source code through OSL_DEBUG_LEVEL
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 5fd7b308ce04..1d1e304c578e 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -124,6 +124,14 @@ ENABLE_DEBUGINFO_FOR := all
endif
endif
+ifeq ($(or $(ENABLE_SYMBOLS),$(enable_symbols)),FALSE)
+gb_SYMBOL := $(false)
+else
+ifneq ($(strip $(ENABLE_SYMBOLS)$(enable_symbols)),)
+gb_SYMBOL := $(true)
+endif
+endif
+
ifneq ($(nodep),)
gb_FULLDEPS := $(false)
else
diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk
index 5ef325b896f8..bd617e4a31dd 100644
--- a/solenv/gbuild/platform/IOS_ARM_GCC.mk
+++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk
@@ -132,6 +132,13 @@ gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS)
gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS)
gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS)
+ifeq ($(gb_SYMBOL),$(true))
+gb_LinkTarget_CFLAGS += $(gb_DEBUG_CFLAGS)
+gb_LinkTarget_CXXFLAGS += $(gb_DEBUG_CFLAGS)
+gb_LinkTarget_OBJCXXFLAGS += $(gb_DEBUG_CFLAGS)
+gb_LinkTarget_OBJCFLAGS += $(gb_DEBUG_CFLAGS)
+endif
+
define gb_LinkTarget__get_liblinkflags
$(patsubst lib%.a,-l%,$(foreach lib,$(filter-out $(gb_Library_UNOLIBS_OOO),$(1)),$(call gb_Library_get_filename,$(lib)))) \
$(foreach lib,$(filter $(gb_Library_UNOLIBS_OOO),$(1)),$(SOLARVER)/$(INPATH)/lib/$(lib)$(gb_Library_UNOEXT))
diff --git a/solenv/gbuild/platform/WNT_INTEL_GCC.mk b/solenv/gbuild/platform/WNT_INTEL_GCC.mk
index f1e7d28a942c..123a7967f2f2 100644
--- a/solenv/gbuild/platform/WNT_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/WNT_INTEL_GCC.mk
@@ -111,13 +111,17 @@ gb_STDLIBS := \
-lmingw32 \
-lmingwex \
+gb_DEBUG_CFLAGS := -g -fno-inline
# LinkTarget class
gb_LinkTarget_CFLAGS := $(gb_CFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS)
-gb_DEBUG_CFLAGS := -g -fno-inline
+ifeq ($(gb_SYMBOL),$(true))
+gb_LinkTarget_CXXFLAGS += $(GGDB2)
+gb_LinkTarget_CFLAGS += $(GGDB2)
+endif
gb_LinkTarget_INCLUDE +=\
$(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index dc2c9833f5e4..aca825cba84e 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -217,6 +217,11 @@ gb_CFLAGS+=-Zi
gb_CXXFLAGS+=-Zi
endif
+ifeq ($(gb_SYMBOL),$(true))
+gb_CFLAGS+=$(gb_DEBUG_CFLAGS)
+gb_CXXFLAGS+=$(gb_DEBUG_CFLAGS)
+endif
+
gb_COMPILEROPTFLAGS := -Ob1 -Oxs -Oy-
gb_COMPILERNOOPTFLAGS := -Od
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index f6a75b6d8c96..2515b4546ef8 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -165,6 +165,13 @@ gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS)
gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS)
gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS)
+ifeq ($(gb_SYMBOL),$(true))
+gb_LinkTarget_CFLAGS += $(gb_DEBUG_CFLAGS)
+gb_LinkTarget_CXXFLAGS += $(gb_DEBUG_CFLAGS)
+gb_LinkTarget_OBJCFLAGS += $(gb_DEBUG_CFLAGS)
+gb_LinkTarget_OBJCXXFLAGS += $(gb_DEBUG_CFLAGS)
+endif
+
define gb_LinkTarget__get_layer
$(if $(filter Executable,$(1)),\
$$(call gb_Executable_get_layer,$(2)),\
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index 52c7a0f49b09..2768fc50d867 100644
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -179,6 +179,11 @@ gb_LinkTarget__RPATHS := \
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
+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
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 87e57a8a556e..dbd00a1744c4 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -161,7 +161,11 @@ endif
gb_COMPILERNOOPTFLAGS := -O0
+ifeq ($(gb_SYMBOL),$(true))
+gb_LINKERSTRIPDEBUGFLAGS :=
+else
gb_LINKERSTRIPDEBUGFLAGS := -Wl,-S
+endif
# LinkTarget class
@@ -180,6 +184,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