This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Libtool".
The branch, master has been updated via 0dd94ed521e52ca901e845b39bbc33f16174a325 (commit) via 2fc9d079d637ba1abd1d1e1ab7fe5c1a59b8f785 (commit) from 6c51572ae0748629da0144ed5b640a3e7abc35d3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0dd94ed521e52ca901e845b39bbc33f16174a325 Author: Peter Rosin <p...@lysator.liu.se> Date: Fri Oct 19 17:19:50 2012 +0200 libtool: parse "dumpbin -headers" to get symbols exported from implibs * m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS) [MSVC]: Extract symbols imported from DLLs by import libraries in the Microsoft dumpbin wrapper. (LT_PATH_NM): Add -headers option if dumpbin is the located name lister to feed the above new code. * NEWS: Update. Signed-off-by: Peter Rosin <p...@lysator.liu.se> commit 2fc9d079d637ba1abd1d1e1ab7fe5c1a59b8f785 Author: Peter Rosin <p...@lysator.liu.se> Date: Fri Oct 19 11:51:12 2012 +0200 libtool: make func_win32_libid work when the name lister is MS dumpbin * m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD) [MSVC]: Use func_win32_libid as file_magic_cmd when the name lister is MS dumpbin. (_LT_CMD_GLOBAL_SYMBOLS): Export the new veriable nm_interface to the libtool script. * build-aux/ltmain.in (func_cygming_gnu_implib_p) (func_cygming_ms_implib_p): Move up to before... (func_win32_libid): ...which now uses them to determine if the object is an import library when the nm_interface is "MS dumpbin". * NEWS: Update. Signed-off-by: Peter Rosin <p...@lysator.liu.se> ----------------------------------------------------------------------- Summary of changes: NEWS | 7 +++- build-aux/ltmain.in | 71 ++++++++++++++++++++++++++++++--------------------- m4/libtool.m4 | 12 ++++++--- 3 files changed, 55 insertions(+), 35 deletions(-) diff --git a/NEWS b/NEWS index ad1d8f9..d0107a9 100644 --- a/NEWS +++ b/NEWS @@ -55,8 +55,11 @@ NEWS - list of user-visible changes between releases of GNU Libtool (e.g. the ability to parse `var+=append') as $CONFIG_SHELL, libtool will now correctly fallback to using only vanilla shell features instead of failing with a parse at startup. - - Fix a bug in the wrapper for using Microsoft dumpbin as name lister - which could lead to broken symbol listings in some corner cases. + - Correctly recognize import libraries when Microsoft dumpbin is used + as the name lister and extend the dumpbin wrapper to find symbols + in import libraries using the -headers option of dumpbin. Also fix a + bug in the dumpbin wrapper which could lead to broken symbol listings + in some corner cases. ** Important incompatible changes: diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index bcfc04c..ed4a4b1 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -2904,6 +2904,32 @@ static const void *lt_preloaded_setup() { fi } +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + # func_win32_libid arg # return the library type of file 'arg' # @@ -2925,9 +2951,20 @@ func_win32_libid () # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' 1,100{ / I /{ s|.*|import| @@ -2935,6 +2972,8 @@ func_win32_libid () q } }'` + ;; + esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; @@ -3033,32 +3072,6 @@ func_cygming_dll_for_implib_fallback_core () $SED -e '/^\./d;/^.\./d;q' } -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified diff --git a/m4/libtool.m4 b/m4/libtool.m4 index d02bd25..c85a85f 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -3187,8 +3187,7 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else @@ -3427,9 +3426,9 @@ else # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) - DUMPBIN="$DUMPBIN -symbols" + DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: @@ -3683,6 +3682,9 @@ for ac_symprfx in "" "_"; do " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"D\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ @@ -3835,6 +3837,8 @@ _LT_DECL([global_symbol_to_c_name_address], _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], + [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS hooks/post-receive -- GNU Libtool