gbuild: revert to -O0 instead of -Og for GCC --enable-debug/dbgutil builds

Unfortunately -Og doesn't work as well as advertised, variables are
optimized away too often.

See thread at
https://lists.freedesktop.org/archives/libreoffice/2017-April/077479.html

Change-Id: I5fc141ea9c7c6931aaf8220c7abf6b413326049e
This commit is contained in:
Michael Stahl
2017-04-10 11:38:31 +02:00
parent 6bd33bd263
commit fae4b8d798
3 changed files with 1 additions and 22 deletions

View File

@@ -242,7 +242,6 @@ export HAVE_GCC_FNO_ENFORCE_EH_SPECS=@HAVE_GCC_FNO_ENFORCE_EH_SPECS@
export HAVE_GCC_FNO_INLINE=@HAVE_GCC_FNO_INLINE@
export HAVE_GCC_FNO_SIZED_DEALLOCATION=@HAVE_GCC_FNO_SIZED_DEALLOCATION@
export HAVE_GCC_GGDB2=@HAVE_GCC_GGDB2@
export HAVE_GCC_OG=@HAVE_GCC_OG@
export HAVE_GNUMAKE_FILE_FUNC=@HAVE_GNUMAKE_FILE_FUNC@
export HAVE_LD_BSYMBOLIC_FUNCTIONS=@HAVE_LD_BSYMBOLIC_FUNCTIONS@
export HAVE_LD_HASH_STYLE=@HAVE_LD_HASH_STYLE@

View File

@@ -3750,7 +3750,6 @@ fi
HAVE_GCC_GGDB2=
HAVE_GCC_FINLINE_LIMIT=
HAVE_GCC_FNO_INLINE=
HAVE_GCC_OG=
if test "$GCC" = "yes"; then
AC_MSG_CHECKING([whether $CC supports -ggdb2])
if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
@@ -3801,22 +3800,6 @@ if test "$GCC" = "yes"; then
AC_MSG_RESULT([no])
fi
# clang as of version 4.0.0 (trunk 289424) doesn't do this very well (missing locals, bad param info in stack frame)
if test "$COM_IS_CLANG" != "TRUE"; then
AC_MSG_CHECKING([whether $CC supports -Og])
# Note that clang-3.1 reports a real error for this option
# so we do not need a special case for clang<=3.1 as above.
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Werror -Og"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_OG=TRUE ],[])
CFLAGS=$save_CFLAGS
if test "$HAVE_GCC_OG" = "TRUE"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
if test "$host_cpu" = "m68k"; then
AC_MSG_CHECKING([whether $CC supports -mlong-jump-table-offsets])
save_CFLAGS=$CFLAGS
@@ -3833,7 +3816,6 @@ fi
AC_SUBST(HAVE_GCC_GGDB2)
AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
AC_SUBST(HAVE_GCC_FNO_INLINE)
AC_SUBST(HAVE_GCC_OG)
dnl ===================================================================
dnl Test the gcc version

View File

@@ -186,9 +186,7 @@ ifeq ($(HAVE_GCC_FNO_DEFAULT_INLINE),TRUE)
FNO_DEFAULT_INLINE=-fno-default-inline
endif
# note: this overrides -O0 from the gb_COMPILERNOOPTFLAGS with -Og if
# available, so that the former remains no-optimization for when that is needed
gb_DEBUG_CFLAGS := $(if $(HAVE_GCC_OG),-Og) $(FINLINE_LIMIT0) $(FNO_INLINE)
gb_DEBUG_CFLAGS := $(FINLINE_LIMIT0) $(FNO_INLINE)
gb_DEBUG_CXXFLAGS := $(FNO_DEFAULT_INLINE)