Den 2010-09-05 23:29 skrev Ralf Wildenhues: > * Peter Rosin wrote on Sun, Sep 05, 2010 at 10:02:11PM CEST: >> Subject: [PATCH 6/7] Convert file name to toolchain format when invoking $NM. >> >> * libltdl/config/ltmain.m4sh (func_generate_dlsyms) >> (func_win32_libid, func_cygming_gnu_implib_p) >> (func_cygming_ms_implib_p): When using the name lister to find >> symbols in files, convert the file names to a format appropriate >> for the tool. > > You're gonna hate me for this, I already know, but: does this patch fix > testsuite failures, are all code paths covered? If not, we need to > improve the test suite. If yes, please mention them in the log, thanks.
I have been looking into this quite a bit, no hatred yet though :-) The patch touches 7 $NM invocations, from the top: func_generate_dlsyms -------------------- 1. Not covered, you'd need to link a program with -dlopen self, but also with a non-libtool object (.o) and/or an non-libtooled old archive (.a). Neither appears to happen in the testsuite. I don't know why the code isn't exporting symbols from libtool objects (.lo). mdemo and stresstest both use object.lo, so they do not trigger this code path, but almost. So, a previous testsuite deficiency that should not hold back this patch. 2. Covered by (at least) mdemo-make.test 3. Covered by (at least) mdemo-static-make.test 4. Probably covered by mdemo too, but you would need a setup that needs func_to_tool_file on something that's not a Windows $host, which I don't have access to. func_win32_libid ---------------- 5. Covered by (at least) mdemo-static-make.test func_cygming_gnu_implib_p ------------------------- 6. Dead code. Needs the sharedlib_from_linklib -> sharedlib_from_linklib_cmd typo fix. So, a previous testsuite deficiency that should not hold back this patch. func_cygming_gnu_implib_p and func_cygming_ms_implib_p ------------------------------------------------------ 7. Dead code. Needs the sharedlib_from_linklib -> sharedlib_from_linklib_cmd typo fix. So, a previous testsuite deficiency that should not hold back this patch. Here's an update of the patch to make use of the new lazy argument to func_to_tool_file and documenting the testsuite exposure in ChangeLog. I hope I don't have to verify 4. Cheers, Peter >From 7db93c02180c1206b203ddc7247c234c404a2efd Mon Sep 17 00:00:00 2001 From: Peter Rosin <p...@lysator.liu.se> Date: Fri, 10 Sep 2010 15:04:17 +0200 Subject: [PATCH] Convert file name to toolchain format when invoking $NM. * libltdl/config/ltmain.m4sh (func_generate_dlsyms) (func_win32_libid, func_cygming_gnu_implib_p) (func_cygming_ms_implib_p): When using the name lister to find symbols in files, convert the file names to a format appropriate for the tool. Fixes testsuite issues in mdemo-static-make.test and mdemo-make.test when doing a cross from Cygwin/Wine to MinGW using MinGW native tools (a.k.a. a "faked" cross). Signed-off-by: Peter Rosin <p...@lysator.liu.se> --- ChangeLog | 11 +++++++++++ libltdl/config/ltmain.m4sh | 23 +++++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d4876b..564589d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2010-09-10 Peter Rosin <p...@lysator.liu.se> + + Convert file name to toolchain format when invoking $NM. + * libltdl/config/ltmain.m4sh (func_generate_dlsyms) + (func_win32_libid, func_cygming_gnu_implib_p) + (func_cygming_ms_implib_p): When using the name lister to find + symbols in files, convert the file names to a format appropriate + for the tool. Fixes testsuite issues in mdemo-static-make.test + and mdemo-make.test when doing a cross from Cygwin/Wine to MinGW + using MinGW native tools (a.k.a. a "faked" cross). + 2010-09-09 Peter Rosin <p...@lysator.liu.se> Fix dependency tracking for MSYS/MinGW. diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index b2d0f88..2b829d3 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -2505,8 +2505,9 @@ extern \"C\" { # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do - func_verbose "extracting global C symbols from \`$progfile'" - $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then @@ -2581,20 +2582,23 @@ extern \"C\" { func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe | + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac @@ -2756,7 +2760,8 @@ 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 - win32_nmres=`eval $NM -f posix -A $1 | + 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 /{ @@ -2868,7 +2873,8 @@ func_cygming_dll_for_implib_fallback_core () func_cygming_gnu_implib_p () { $opt_debug - func_cygming_gnu_implib_tmp=`$NM $1 | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + 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" } @@ -2879,7 +2885,8 @@ func_cygming_gnu_implib_p () func_cygming_ms_implib_p () { $opt_debug - func_cygming_ms_implib_tmp=`$NM $1 | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + 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" } -- 1.7.1