Subject: bug#15968: Wrong default value of OBJDUMP causes hard to diagnose problems during cross compilation for mingw

From: Tomasz Gajewski <[email-masked]>
Date: Sun, 24 Nov 2013 22:43:35 +0100

I have tried to compile on linux a project (in this case freetds but
some time ago had same problem with some other which I can't remember
right now) targetting mingw with shared libraries enabled.

During build libtool generated a following message and refused to build
dlls.

*** Warning: linker path does not have real file for library -lodbccp32.
*** 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 libodbccp32 and none of the candidates passed a file format test
*** using a file magic. Last file checked: <path>/libodbccp32.a

Message is quite nice but it has a problem, that libodbccp32.a is a
proper import archive but libtool is not correctly detecting this
fact. I have spent few hours (previously) to find out that libtool
checks that this file is an archive library and then tries to check if
objects in this archive are objects being parts of import
libraries. This second check was performed using OBJDUMP which by
default is objdump which in case of cross compilation does not recognize
such import libraries properly.

Passing OBJDUMP=i686-pc-mingw32-objdump option to configure allowed to
bypass this problem, but I think that it should be addressed in libtool
itself somehow.

The best solution, at least from my perspective as a user, would be to
change libtool to properly select proper objdump utility in case of
cross compilation, because libtool itself needs this utility to work
properly for internal operation.

If that first solution cannot be done because of some technical problem
a message should be changed at least to contain information that when
targetting mingw platform proper 'objdump' utility must be passed to
make this test work reliably.

Regards
Tomasz Gajewski