[vlc-devel] [PATCH 7/7] contrib: add an option to generate PDB files
Steve Lhomme
robux4 at ycbcr.xyz
Tue May 14 16:16:34 CEST 2019
Only supported by contribs using libtool
Only output for programs and shared libraries (EXE and DLL), in .a archives the
symbols are in the the each .o files. They are aggregated when a .dll or .exe
is generated with them.
---
contrib/bootstrap | 6 ++++++
contrib/src/main.mak | 11 +++++++++--
extras/tools/libtool-2.4.6-pdb.patch | 9 ++++++---
3 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/contrib/bootstrap b/contrib/bootstrap
index 547fe3afd6..1540ffbf9b 100755
--- a/contrib/bootstrap
+++ b/contrib/bootstrap
@@ -36,6 +36,7 @@ usage()
echo " (USE AT YOUR OWN LEGAL RISKS)"
echo " --disable-optim disable optimization in libraries"
echo " --disable-debug disable generating debug information"
+ echo " --enable-pdb generate debug information in PDB format"
}
BUILD=
@@ -51,6 +52,7 @@ GNUV3="1"
AD_CLAUSES=
WITH_OPTIMIZATION="1"
HAVE_DEBUG="1"
+HAVE_PDB=
if test ! -f "../../contrib/src/main.mak"
then
@@ -89,6 +91,9 @@ do
--disable-debug)
HAVE_DEBUG=
;;
+ --enable-pdb)
+ HAVE_PDB=1
+ ;;
--enable-small)
ENABLE_SMALL=1
;;
@@ -271,6 +276,7 @@ test -z "$GNUV3" || add_make_enabled "GNUV3"
test -z "$AD_CLAUSES" || add_make_enabled "AD_CLAUSES"
test -z "$WITH_OPTIMIZATION" || add_make_enabled "WITH_OPTIMIZATION"
test -z "$HAVE_DEBUG" || add_make_enabled "HAVE_DEBUG"
+test -z "$HAVE_PDB" || add_make_enabled "HAVE_PDB"
test "`uname -o 2>/dev/null`" != "Msys" || add_make "CMAKE_GENERATOR := -G \"MSYS Makefiles\""
#
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 3868ea8fac..1bf24c8f4b 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -192,6 +192,11 @@ LDFLAGS := $(LDFLAGS) -L$(PREFIX)/lib $(EXTRA_LDFLAGS)
ifdef HAVE_DEBUG
CFLAGS := $(CFLAGS) -g
CXXFLAGS := $(CXXFLAGS) -g
+ifdef HAVE_PDB
+CFLAGS := $(CFLAGS) -gcodeview
+CXXFLAGS := $(CXXFLAGS) -gcodeview
+LIBTOOLFLAGS += --generate-pdb
+endif
endif
ifndef WITH_OPTIMIZATION
@@ -324,12 +329,14 @@ HOSTVARS := \
CPPFLAGS="$(CPPFLAGS)" \
CFLAGS="$(CFLAGS)" \
CXXFLAGS="$(CXXFLAGS)" \
- LDFLAGS="$(LDFLAGS)"
+ LDFLAGS="$(LDFLAGS)" \
+ LIBTOOLFLAGS="$(LIBTOOLFLAGS)"
HOSTVARS_PIC := $(HOSTTOOLS) \
CPPFLAGS="$(CPPFLAGS) $(PIC)" \
CFLAGS="$(CFLAGS) $(PIC)" \
CXXFLAGS="$(CXXFLAGS) $(PIC)" \
- LDFLAGS="$(LDFLAGS)"
+ LDFLAGS="$(LDFLAGS)" \
+ LIBTOOLFLAGS="$(LIBTOOLFLAGS)"
# Keep a version of HOSTVARS without the tools, since meson requires the
# tools variables to point to the native ones
diff --git a/extras/tools/libtool-2.4.6-pdb.patch b/extras/tools/libtool-2.4.6-pdb.patch
index 7fc151898e..73e4903696 100644
--- a/extras/tools/libtool-2.4.6-pdb.patch
+++ b/extras/tools/libtool-2.4.6-pdb.patch
@@ -1,5 +1,5 @@
--- libtool-2.4.6/build-aux/ltmain.sh.pdb 2019-03-08 10:49:36.502590300 +0100
-+++ libtool-2.4.6/build-aux/ltmain.sh 2019-03-15 13:04:15.840367900 +0100
++++ libtool-2.4.6/build-aux/ltmain.sh 2019-03-15 14:45:20.447123000 +0100
@@ -2036,6 +2036,7 @@ usage_message="Options:
--version print version information
-W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
@@ -26,7 +26,7 @@
--features) func_features ;;
--finish) set dummy --mode finish ${1+"$@"}; shift ;;
-@@ -4344,6 +4349,15 @@ func_mode_install ()
+@@ -4344,6 +4349,18 @@ func_mode_install ()
done
fi
@@ -36,13 +36,16 @@
+ *.dll)
+ pdbname=${dlname%.dll}.pdb
+ ;;
++ *.exe)
++ pdbname=${dlname%.exe}.pdb
++ ;;
+ esac
+ fi
+
# Do each command in the postinstall commands.
lib=$destdir/$realname
func_execute_cmds "$postinstall_cmds" 'exit $?'
-@@ -7484,6 +7498,16 @@ func_mode_link ()
+@@ -7484,6 +7501,16 @@ func_mode_link ()
*) linkmode=prog ;; # Anything else should be a program.
esac
--
2.17.1
More information about the vlc-devel
mailing list