[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

func_win32_import_lib_p when file is missing

From: Peter Rosin
Subject: func_win32_import_lib_p when file is missing
Date: Sun, 07 Oct 2012 01:53:44 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1


After getting rid of the legacy testsuite (nice!), I'm
seeing a new failure with MSYS/MSVC in what used to be
the demo group, now

I think it's a real libtool bug this time, and not a
simple testsuite issue.

When I do the MSVC run, I also specify that I want to
use "dumpbin -symbols" instead of nm to dig out symbols.
This in turn triggers the below else branch in libtool.m4:

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
    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
    # Keep this pattern in sync with the one in func_win32_libid.
    lt_cv_deplibs_check_method='file_magic file format 
(pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
    lt_cv_file_magic_cmd='$OBJDUMP -f'

So, I end up with objdump as file magic command. Note that there
are some other ways to end up with objdump instead of func_win32_libid,
so this is not a problem confined to MSVC. fails for me since func_generate_dlsyms then doesn't
recognize an import library and puts the name of import library
instead of the name of the dll in the <whatevername>S.c file.
libltdl then of course doesn't find any symbols in the import
library, and I get this when I run the helldl program:

Welcome to *modular* GNU Hell!
found file: @PROGRAM@
found file: hello.dll.lib
did not find the `nothing' variable
did not find the `foo' function
did not find the `hello' function

Of course, stderr should have been empty and the last line of stdout
should have listed the dll and not the import lib, like this:
found file: hello-2.dll

Now the question. How is the below function supposed to work
when $file_magic_cmd is '$OBJDUMP -f' and not 'func_win32_libid'?
objdump doesn't output "import" for me, at least not for any
import lib I have given it. Chunk?

# func_win32_import_lib_p ARG
# True if ARG is an import lib, as indicated by $file_magic_cmd
func_win32_import_lib_p ()

    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
    *import*) : ;;
    *) false ;;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]