bug-libtool
[Top][All Lists]
Advanced

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

Re: libtool 2.2 - import library detection failure when cross compiling


From: Jakub Bogusz
Subject: Re: libtool 2.2 - import library detection failure when cross compiling to mingw32
Date: Fri, 14 Mar 2008 19:53:13 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

On Thu, Mar 13, 2008 at 07:02:31AM +0100, Ralf Wildenhues wrote:
> Hello Jakub,
> 
> Thanks for the bug report.
> 
> * Jakub Bogusz wrote on Wed, Mar 12, 2008 at 11:23:16PM CET:
> > 
> > I noticed that libtool sometimes rejects to create shared library using 
> > -l...
> > to link with some import libraries failing to recognize those import
> > libraries as such.
> > 
> > It happens if AC_CANONICAL_HOST is not issued before AC_PROG_LIBTOOL/LT_INIT
> > - because libtool macros AC_REQUIRE([AC_CANONICAL_HOST]) _after_ processing
> > LT_INIT options, and that's win32-dll LT_INIT option processing which
> > calls AC_CHECK_TOOL for objdump, which is used to recognize type of ar
> > archives.
> > 
> > When AC_CHECK_TOOL is issued before AC_CANONICAL_HOST, instead of finding
> > cross version of objdump it finds native (Linux/x86 in my case) objdump,
> > which can't recognize archive which contains PE objects.
> 
> Can you post a (preferably small) example that exposes this, plus the
> error output you see?  If the example is large, then post a link to it.

Original example was atk-1.22 package using cross gcc. Only static
library was built and libtool complained about missing library for
-lws2_32 and -lole32 with messages like:

*** Warning: linker path does not have real file for library -lws2_32.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libws2_32 and none of the candidates passed a file format test
*** using a file magic. Last file checked: .../lib/libws2_32.a


Reduced test:

#v+
AC_INIT([libtool-test], [0])

if test "$with_canonical" != ""; then
        AC_CANONICAL_HOST
fi

AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL

echo "NM: $NM"
echo "OBJDUMP: $OBJDUMP"
#v-

When called ./configure --host=i386-mingw32 --build=athlon-pld-linux
output ends with:
NM: /usr/bin/i386-mingw32-nm -B
OBJDUMP: objdump
         ^^^^^^^ i.e. native objdump, which doesn't recognize PE objects

./configure --host=i386-mingw32 --build=athlon-pld-linux --with-canonical
output ends with:
NM: /usr/bin/i386-mingw32-nm -B
OBJDUMP: i386-mingw32-objdump

Note that it requires cross i386-mingw32 binutils and gcc to complete.


-- 
Jakub Bogusz    http://qboosh.pl/




reply via email to

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