[Scummvm-git-logs] scummvm master -> f0fe48d2f7d75deebf6b609f64c14b38b94a9afc

sev- sev at scummvm.org
Sat Aug 18 13:33:07 CEST 2018


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ffff953685 BUILD: Use split-dwarf debug symbol files by default, when available
f0fe48d2f7 BUILD: List all used environmental variables in configure help


Commit: ffff95368531b7a9be392c3eec1f7f054fc01c86
    https://github.com/scummvm/scummvm/commit/ffff95368531b7a9be392c3eec1f7f054fc01c86
Author: Colin Snover (github.com at zetafleet.com)
Date: 2018-08-18T13:33:03+02:00

Commit Message:
BUILD: Use split-dwarf debug symbol files by default, when available

This should improve linker time as well as reduce the size of the
built binaries (though this does not affect runtime memory usage
since the debug segments are not loaded into memory except by a
debugger) whilst still giving debug information.

Changed paths:
    Makefile.common
    configure
    rules.mk


diff --git a/Makefile.common b/Makefile.common
index fa377a0..b08c464 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -8,6 +8,9 @@
 
 all: $(EXECUTABLE) plugins
 
+ifdef SPLIT_DWARF
+all: $(EXECUTABLE).dwp
+endif
 
 ######################################################################
 # Module settings
@@ -70,6 +73,7 @@ QUIET_AR      = @echo '   ' AR '     ' $@;
 QUIET_RANLIB  = @echo '   ' RANLIB ' ' $@;
 QUIET_PLUGIN  = @echo '   ' PLUGIN ' ' $@;
 QUIET_LINK    = @echo '   ' LINK '   ' $@;
+QUIET_DWP     = @echo '   ' DWP '    ' $@;
 QUIET_WINDRES = @echo '   ' WINDRES '' $@;
 QUIET         = @
 endif
@@ -80,12 +84,20 @@ endif
 $(EXECUTABLE): $(OBJS)
 	$(QUIET_LINK)$(LD) $(LDFLAGS) $(PRE_OBJS_FLAGS) $+ $(POST_OBJS_FLAGS) $(LIBS) -o $@
 
+ifdef SPLIT_DWARF
+$(EXECUTABLE).dwp: $(EXECUTABLE)
+	$(QUIET_DWP)$(DWP) -e $(EXECUTABLE)
+endif
+
 distclean: clean clean-devtools
 	$(RM) config.h config.mk config.log engines/engines.mk engines/plugins_table.h
 
 clean:
 	$(RM_REC) $(DEPDIRS)
 	$(RM) $(OBJS) $(EXECUTABLE)
+ifdef SPLIT_DWARF
+	$(RM) $(EXECUTABLE).dwp
+endif
 
 
 #
diff --git a/configure b/configure
index ac3331c..e7522c3 100755
--- a/configure
+++ b/configure
@@ -35,6 +35,7 @@ SAVED_ASFLAGS=$ASFLAGS
 SAVED_CPPFLAGS=$CPPFLAGS
 SAVED_CXX=$CXX
 SAVED_CXXFLAGS=$CXXFLAGS
+SAVED_DWP=$DWP
 SAVED_LD=$LD
 SAVED_LDFLAGS=$LDFLAGS
 SAVED_PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR
@@ -202,6 +203,7 @@ _ranlib=ranlib
 _strip=strip
 _ar="ar cru"
 _as="as"
+_dwp=dwp
 _windres=windres
 _stagingpath="staging"
 _win32path="c:/scummvm"
@@ -294,7 +296,7 @@ cc_check_no_clean() {
 }
 
 cc_check_clean() {
-	rm -rf $TMPC $TMPO $TMPO.o $TMPO.dSYM $TMPO$HOSTEXEEXT "$@"
+	rm -rf $TMPC $TMPO $TMPO.o $TMPO.dwo $TMPO.dSYM $TMPO$HOSTEXEEXT "$@"
 }
 
 cc_check() {
@@ -1130,7 +1132,7 @@ cat >> $TMPLOG <<EOF
 Invocation command line was:
 $0 $@
 Saved environment variables:
-AR="$SAVED_AR" AS="$SAVED_AS" ASFLAGS="$SAVED_ASFLAGS" CPPFLAGS="$SAVED_CPPFLAGS" CXX="$SAVED_CXX" CXXFLAGS="$SAVED_CXXFLAGS" LD="$SAVED_LD" LDFLAGS="$SAVED_LDFLAGS" PKG_CONFIG_LIBDIR="$SAVED_PKG_CONFIG_LIBDIR" RANLIB="$SAVED_RANLIB" SDL_CONFIG="$SAVED_SDL_CONFIG" STRIP="$SAVED_STRIP" WINDRES="$SAVED_WINDRES" WINDRESFLAGS="$SAVED_WINDRESFLAGS"
+AR="$SAVED_AR" AS="$SAVED_AS" ASFLAGS="$SAVED_ASFLAGS" CPPFLAGS="$SAVED_CPPFLAGS" CXX="$SAVED_CXX" CXXFLAGS="$SAVED_CXXFLAGS" DWP="$SAVED_DWP" LD="$SAVED_LD" LDFLAGS="$SAVED_LDFLAGS" PKG_CONFIG_LIBDIR="$SAVED_PKG_CONFIG_LIBDIR" RANLIB="$SAVED_RANLIB" SDL_CONFIG="$SAVED_SDL_CONFIG" STRIP="$SAVED_STRIP" WINDRES="$SAVED_WINDRES" WINDRESFLAGS="$SAVED_WINDRESFLAGS"
 EOF
 
 
@@ -1694,13 +1696,10 @@ else
 	_strip=$_host_alias-strip
 	_ar="$_host_alias-ar cru"
 	_as="$_host_alias-as"
+	_dwp=$_host_alias-dwp
 	_windres=$_host_alias-windres
 fi
 
-#
-# Determine extra build flags for debug and/or release builds
-#
-
 case $_host in
 caanoo | gp2x | gp2xwiz | openpandora | ps2 | psp2)
 	if test "$_debug_build" = auto; then
@@ -1715,26 +1714,6 @@ caanoo | gp2x | gp2xwiz | openpandora | ps2 | psp2)
 	;;
 esac
 
-if test "$_debug_build" != no; then
-	# debug mode not explicitly disabled -> compile with debug information
-	case $_host_os in
-	amigaos*)
-		# AmigaOS debugger uses plain stabs, with no gdb extensions.
-		append_var CXXFLAGS "-gstabs"
-	;;
-	*)
-		# Use the system default format for debug info.
-		append_var CXXFLAGS "-g"
-	esac
-fi
-
-if test "$_release_build" = yes; then
-	# Add a define, which indicates we are doing
-	# an build for a release version.
-	append_var DEFINES "-DRELEASE_BUILD"
-fi
-
-
 #
 # Determine extension used for executables
 #
@@ -1923,6 +1902,10 @@ if test -n "$AS"; then
 	_as=$AS
 fi
 
+if test -n "$DWP"; then
+	_dwp=$DWP
+fi
+
 if test -n "$WINDRES"; then
 	_windres=$WINDRES
 fi
@@ -2098,6 +2081,44 @@ if test "$_use_cxx11" = "yes" ; then
 fi
 echo $_use_cxx11
 
+#
+# Determine extra build flags for debug and/or release builds
+#
+if test "$_debug_build" != no; then
+	# debug mode not explicitly disabled -> compile with debug information
+	echo_n "Checking best debug mode... "
+
+	debug_mode=-g
+	test "$_host_os" = amigaos && debug_mode=-gstabs
+	append_var CXXFLAGS "$debug_mode"
+	echo_n -- "$debug_mode"
+
+	echo "int main() { return 0; }" > $TMPC
+	if `which $_dwp >/dev/null 2>&1` && cc_check_no_clean $debug_mode -gsplit-dwarf && `$_dwp -e $TMPO -o /dev/null >/dev/null 2>&1`; then
+		append_var CXXFLAGS "-gsplit-dwarf"
+		add_line_to_config_mk "SPLIT_DWARF = 1"
+		echo_n -- " + split DWARF"
+		if cc_check_no_clean $debug_mode -gsplit-dwarf -fuse-ld=gold -Wl,--gdb-index; then
+			append_var LDFLAGS "-fuse-ld=gold"
+			append_var LDFLAGS "-Wl,--gdb-index"
+			echo_n -- " + Gold"
+		fi
+	fi
+
+	if cc_check_no_clean $debug_mode -fvar-tracking-assignments; then
+		append_var CXXFLAGS "-fvar-tracking-assignments"
+		echo_n -- " + var tracking"
+	fi
+	cc_check_clean
+	echo ""
+fi
+
+if test "$_release_build" = yes; then
+	# Add a define, which indicates we are doing
+	# an build for a release version.
+	append_var DEFINES "-DRELEASE_BUILD"
+fi
+
 # By default, we add -pedantic to the CXXFLAGS to catch some potentially
 # non-portable constructs, like use of GNU extensions.
 # However, some platforms use GNU extensions in system header files, so
@@ -5418,6 +5439,7 @@ STRIP := $_strip
 AR := $_ar
 AS := $_as
 ASFLAGS := $ASFLAGS
+DWP := $_dwp
 WINDRES := $_windres
 WINDRESFLAGS := $WINDRESFLAGS
 STAGINGPATH=$_stagingpath
@@ -5467,6 +5489,7 @@ SAVED_ASFLAGS           := $SAVED_ASFLAGS
 SAVED_CPPFLAGS          := $SAVED_CPPFLAGS
 SAVED_CXX               := $SAVED_CXX
 SAVED_CXXFLAGS          := $SAVED_CXXFLAGS
+SAVED_DWP               := $SAVED_DWP
 SAVED_LD                := $SAVED_LD
 SAVED_LDFLAGS           := $SAVED_LDFLAGS
 SAVED_PKG_CONFIG_LIBDIR := $SAVED_PKG_CONFIG_LIBDIR
diff --git a/rules.mk b/rules.mk
index 0963a46..1324874 100644
--- a/rules.mk
+++ b/rules.mk
@@ -55,6 +55,13 @@ PLUGIN:=
 # Add to "plugins" target
 plugins: $(PLUGIN-$(MODULE))
 
+ifdef SPLIT_DWARF
+$(PLUGIN-$(MODULE)).dwp: $(PLUGIN-$(MODULE))
+	$(QUIET_DWP)$(DWP) -e $(PLUGIN-$(MODULE))
+
+plugins: $(PLUGIN-$(MODULE)).dwp
+endif
+
 # Add to the PLUGINS variable
 PLUGINS += $(PLUGIN-$(MODULE))
 


Commit: f0fe48d2f7d75deebf6b609f64c14b38b94a9afc
    https://github.com/scummvm/scummvm/commit/f0fe48d2f7d75deebf6b609f64c14b38b94a9afc
Author: Colin Snover (github.com at zetafleet.com)
Date: 2018-08-18T13:33:03+02:00

Commit Message:
BUILD: List all used environmental variables in configure help

Changed paths:
    configure


diff --git a/configure b/configure
index e7522c3..dfad09d 100755
--- a/configure
+++ b/configure
@@ -1106,6 +1106,7 @@ Some influential environment variables:
                      headers in a nonstandard directory <include dir>
   CXX                C++ compiler command
   CXXFLAGS           C++ compiler flags
+  DWP                DWARF packing utility command
   LD                 linker command
   LDFLAGS            linker flags, e.g. -L<lib dir> if you have libraries in a
                      nonstandard directory <lib dir>





More information about the Scummvm-git-logs mailing list