Kaydet (Commit) 47cf2c94 authored tarafından David Ostrovsky's avatar David Ostrovsky Kaydeden (comit) Michael Meeks

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
üst 80086a82
...@@ -176,6 +176,7 @@ export ENABLE_SCRIPTING_BEANSHELL=@ENABLE_SCRIPTING_BEANSHELL@ ...@@ -176,6 +176,7 @@ export ENABLE_SCRIPTING_BEANSHELL=@ENABLE_SCRIPTING_BEANSHELL@
export ENABLE_SCRIPTING_JAVASCRIPT=@ENABLE_SCRIPTING_JAVASCRIPT@ export ENABLE_SCRIPTING_JAVASCRIPT=@ENABLE_SCRIPTING_JAVASCRIPT@
export ENABLE_SCRIPTING_PYTHON=@ENABLE_SCRIPTING_PYTHON@ export ENABLE_SCRIPTING_PYTHON=@ENABLE_SCRIPTING_PYTHON@
export ENABLE_SILENT_MSI=@ENABLE_SILENT_MSI@ export ENABLE_SILENT_MSI=@ENABLE_SILENT_MSI@
export ENABLE_SYMBOLS=@ENABLE_SYMBOLS@
export ENABLE_SYSTRAY_GTK=@ENABLE_SYSTRAY_GTK@ export ENABLE_SYSTRAY_GTK=@ENABLE_SYSTRAY_GTK@
export ENABLE_TELEPATHY=@ENABLE_TELEPATHY@ export ENABLE_TELEPATHY=@ENABLE_TELEPATHY@
export ENABLE_ZENITY=@ENABLE_ZENITY@ export ENABLE_ZENITY=@ENABLE_ZENITY@
......
...@@ -757,12 +757,6 @@ AC_ARG_ENABLE(assert-always-abort, ...@@ -757,12 +757,6 @@ AC_ARG_ENABLE(assert-always-abort,
[make assert() abort even in release code.]), [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, AC_ARG_ENABLE(dbgutil,
AS_HELP_STRING([--enable-dbgutil], AS_HELP_STRING([--enable-dbgutil],
[Provide debugging support from --enable-debug and include additional debugging [Provide debugging support from --enable-debug and include additional debugging
...@@ -771,6 +765,12 @@ AC_ARG_ENABLE(dbgutil, ...@@ -771,6 +765,12 @@ AC_ARG_ENABLE(dbgutil,
Note that this makes the build ABI incompatible, it is not possible to mix object 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.])) 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, AC_ARG_ENABLE(selective-debuginfo,
AS_HELP_STRING([--enable-selective-debuginfo], AS_HELP_STRING([--enable-selective-debuginfo],
[If --enable-debug or --enable-dbgutil is used, build debugging information [If --enable-debug or --enable-dbgutil is used, build debugging information
...@@ -780,6 +780,12 @@ AC_ARG_ENABLE(selective-debuginfo, ...@@ -780,6 +780,12 @@ AC_ARG_ENABLE(selective-debuginfo,
more general, and disabling takes precedence). more general, and disabling takes precedence).
Example: --enable-selective-debuginfo="all -sw/ -Library_sc".])) 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, AC_ARG_ENABLE(compiler-plugins,
AS_HELP_STRING([--enable-compiler-plugins], AS_HELP_STRING([--enable-compiler-plugins],
[Enable compiler plugins that will perform additional checks during [Enable compiler plugins that will perform additional checks during
...@@ -3351,6 +3357,27 @@ if test -n "$ENABLE_DEBUG"; then ...@@ -3351,6 +3357,27 @@ if test -n "$ENABLE_DEBUG"; then
fi fi
AC_SUBST(ENABLE_DEBUGINFO_FOR) 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 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. dnl by our build system, but explicit override is possible.
AC_MSG_CHECKING(for explicit CFLAGS) AC_MSG_CHECKING(for explicit CFLAGS)
......
...@@ -49,6 +49,8 @@ AVAILABLE TARGETS ...@@ -49,6 +49,8 @@ AVAILABLE TARGETS
INTERACTIVE VARIABLES: INTERACTIVE VARIABLES:
DEBUG / debug If not empty, build as with --enable-debug. DEBUG / debug If not empty, build as with --enable-debug.
ENABLE_SYMBOLS / enable_symbols
If not empty, build as with --enable-symbols.
DBGLEVEL / dbglevel DBGLEVEL / dbglevel
If not empty, force the debug level to the specified value. The If not empty, force the debug level to the specified value. The
debug level is passed to the source code through OSL_DEBUG_LEVEL debug level is passed to the source code through OSL_DEBUG_LEVEL
......
...@@ -124,6 +124,14 @@ ENABLE_DEBUGINFO_FOR := all ...@@ -124,6 +124,14 @@ ENABLE_DEBUGINFO_FOR := all
endif endif
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),) ifneq ($(nodep),)
gb_FULLDEPS := $(false) gb_FULLDEPS := $(false)
else else
......
...@@ -132,6 +132,13 @@ gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) ...@@ -132,6 +132,13 @@ gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS)
gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS)
gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) 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 define gb_LinkTarget__get_liblinkflags
$(patsubst lib%.a,-l%,$(foreach lib,$(filter-out $(gb_Library_UNOLIBS_OOO),$(1)),$(call gb_Library_get_filename,$(lib)))) \ $(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)) $(foreach lib,$(filter $(gb_Library_UNOLIBS_OOO),$(1)),$(SOLARVER)/$(INPATH)/lib/$(lib)$(gb_Library_UNOEXT))
......
...@@ -111,13 +111,17 @@ gb_STDLIBS := \ ...@@ -111,13 +111,17 @@ gb_STDLIBS := \
-lmingw32 \ -lmingw32 \
-lmingwex \ -lmingwex \
gb_DEBUG_CFLAGS := -g -fno-inline
# LinkTarget class # LinkTarget class
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) gb_LinkTarget_CFLAGS := $(gb_CFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) 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 +=\ gb_LinkTarget_INCLUDE +=\
$(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \ $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \
......
...@@ -217,6 +217,11 @@ gb_CFLAGS+=-Zi ...@@ -217,6 +217,11 @@ gb_CFLAGS+=-Zi
gb_CXXFLAGS+=-Zi gb_CXXFLAGS+=-Zi
endif endif
ifeq ($(gb_SYMBOL),$(true))
gb_CFLAGS+=$(gb_DEBUG_CFLAGS)
gb_CXXFLAGS+=$(gb_DEBUG_CFLAGS)
endif
gb_COMPILEROPTFLAGS := -Ob1 -Oxs -Oy- gb_COMPILEROPTFLAGS := -Ob1 -Oxs -Oy-
gb_COMPILERNOOPTFLAGS := -Od gb_COMPILERNOOPTFLAGS := -Od
......
...@@ -165,6 +165,13 @@ gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) ...@@ -165,6 +165,13 @@ gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS)
gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS)
gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) 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 define gb_LinkTarget__get_layer
$(if $(filter Executable,$(1)),\ $(if $(filter Executable,$(1)),\
$$(call gb_Executable_get_layer,$(2)),\ $$(call gb_Executable_get_layer,$(2)),\
......
...@@ -179,6 +179,11 @@ gb_LinkTarget__RPATHS := \ ...@@ -179,6 +179,11 @@ gb_LinkTarget__RPATHS := \
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_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 # 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 # we want to use @$(extraobjectlist) in the long run
define gb_LinkTarget__command_dynamiclink define gb_LinkTarget__command_dynamiclink
......
...@@ -161,7 +161,11 @@ endif ...@@ -161,7 +161,11 @@ endif
gb_COMPILERNOOPTFLAGS := -O0 gb_COMPILERNOOPTFLAGS := -O0
ifeq ($(gb_SYMBOL),$(true))
gb_LINKERSTRIPDEBUGFLAGS :=
else
gb_LINKERSTRIPDEBUGFLAGS := -Wl,-S gb_LINKERSTRIPDEBUGFLAGS := -Wl,-S
endif
# LinkTarget class # LinkTarget class
...@@ -180,6 +184,11 @@ gb_LinkTarget__RPATHS := \ ...@@ -180,6 +184,11 @@ gb_LinkTarget__RPATHS := \
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) gb_LinkTarget_CFLAGS := $(gb_CFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) 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 # 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 # we want to use @$(extraobjectlist) in the long run
define gb_LinkTarget__command_dynamiclink define gb_LinkTarget__command_dynamiclink
......
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