[vlc-devel] [PATCH 5/7] tools: add --generate-pdb option to libtool

Steve Lhomme robux4 at ycbcr.xyz
Tue May 14 16:16:32 CEST 2019


It will add -Wl,-pdb,<libname>.pdb for DLL, EXE and .a to linker outputs.

The PDB files are also copied next to the files during `make install`.
---
 extras/tools/libtool-2.4.6-pdb.patch | 73 ++++++++++++++++++++++++++++
 extras/tools/tools.mak               |  2 +-
 2 files changed, 74 insertions(+), 1 deletion(-)
 create mode 100644 extras/tools/libtool-2.4.6-pdb.patch

diff --git a/extras/tools/libtool-2.4.6-pdb.patch b/extras/tools/libtool-2.4.6-pdb.patch
new file mode 100644
index 0000000000..7fc151898e
--- /dev/null
+++ b/extras/tools/libtool-2.4.6-pdb.patch
@@ -0,0 +1,73 @@
+--- 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
+@@ -2036,6 +2036,7 @@ usage_message="Options:
+        --version            print version information
+    -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
+    -h, --help, --help-all   print short, long, or detailed help message
++       --generate-pdb       Generate PDB files alongside executables and libraries
+ "
+ 
+ # Additional text appended to 'usage_message' in response to '--help'.
+@@ -2266,6 +2267,7 @@ libtool_options_prep ()
+     opt_mode=
+     opt_preserve_dup_deps=false
+     opt_quiet=false
++    opt_generate_pdb=false
+ 
+     nonopt=
+     preserve_args=
+@@ -2330,6 +2332,9 @@ libtool_parse_options ()
+         --preserve-dup-deps)
+                         opt_preserve_dup_deps=: ;;
+ 
++        --generate-pdb)
++                        opt_generate_pdb=: ;;
++
+         --features)     func_features ;;
+ 
+         --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
+@@ -4344,6 +4349,15 @@ func_mode_install ()
+ 	    done
+ 	  fi
+ 
++	  pdbname=
++	  if $opt_generate_pdb; then
++	    case $dlname in
++	    *.dll)
++	      pdbname=${dlname%.dll}.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 ()
+     *) linkmode=prog ;; # Anything else should be a program.
+     esac
+ 
++    if $opt_generate_pdb; then
++      case $output in
++      *.$libext) ;;
++      *.lo | *.$objext) ;;
++      *.la)
++        func_append compiler_flags " ${wl}-pdb ${wl}${output_objdir}/${output%.la}.pdb"
++      ;;
++      esac
++    fi
++
+     specialdeplibs=
+ 
+     libs=
+--- libtool-2.4.6/m4/libtool.m4.pdb	2019-03-15 13:10:24.200619400 +0100
++++ libtool-2.4.6/m4/libtool.m4	2019-03-15 13:10:36.850516500 +0100
+@@ -2538,6 +2538,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+       test -d \$dldir || mkdir -p \$dldir~
+       $install_prog $dir/$dlname \$dldir/$dlname~
+       chmod a+x \$dldir/$dlname~
++      if test -n '\''$pdbname'\''; then
++        $install_prog $dir/$pdbname \$dldir/$pdbname;
++      fi~
+       if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+         eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+       fi'
diff --git a/extras/tools/tools.mak b/extras/tools/tools.mak
index 9f54826d0f..342da1c89d 100644
--- a/extras/tools/tools.mak
+++ b/extras/tools/tools.mak
@@ -128,7 +128,7 @@ libtool: libtool-$(LIBTOOL_VERSION).tar.gz
 	$(APPLY) libtool-2.4.6-bitcode.patch
 	$(APPLY) libtool-2.4.6-san.patch
 	$(APPLY) libtool-2.4.6-clang-libs.patch
-	$(APPLY) libtool-2.4.2-response-files.patch
+	$(APPLY) libtool-2.4.6-pdb.patch
 	$(MOVE)
 
 .buildlibtool: libtool .automake .help2man
-- 
2.17.1



More information about the vlc-devel mailing list