Linking errors when crosscompiling tests

Hans Leidekker hans at
Mon May 19 10:47:57 CDT 2003


When I run a 'make crosstest' using MingW I get errors like these:

undefined reference to `IID_IUnknown'
undefined reference to `IID_IUnknown'

What's happening is that this test references symbols that
reside in wine_uuid, which is added to the library search path
for the regular Wine build, but left out in the crosscompile
build. For good reasons, because wine_uuid is built as a Unix
archive, not as an import library, which is what MingW needs.

So I created an import library from the Unix archive:

 nm libwine_uuid.a | egrep -v "^$" | egrep -v "^*.o:$" | cut -d" " -f 3 \
 >> wine_uuid.def

 i386-mingw32-dlltool -l wine_uuid.lib -d ./wine_uuid.def

And I had a working executable. But this obviously is not the
way Wine does it. Wine generates .def files from .spec files. To
use Wine's build system I had to create a new dll -- uuid -- and
copy the sources over from libs/uuid. This gave me a Wine generated
import library.

Next I added uuid as an import library to the Makefile for
the oleaut32 test and removed wine_uuid from EXTRALIBS. Did
this solve my problem? No it didn't. Because, as it turns out,
winebuild does not support importing non-function entry points,
such as IID_IUnknown. After googling around a bit I have to 
conclude that this is quite a fundamental problem. If I
understand it correctly, it's because in this case PE style
linking can not be emulated using the ELF linker.

Then I decided to bypass linking and go with LoadLibraryA
and GetProcAddress, which are already used in the tests to find
the functions to be tested. This finally gave me a uniform build
system for regular and crosscompiled tests.

My question is, is this acceptable for integration into Wine?
The consequence would be that, to be consistent, all parts of
Wine that are now linked with wine_uuid would need to be
converted. Or is such consistency maybe considered less important
than getting crosscompiled tests going?


More information about the wine-devel mailing list