This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

howto let dlltool to get libtool' impgen functionality?


(first message lost?)



Hi there,

I am currently stuck with a little problem around libtool (there was a
thread over there on the libtool-ml about yesterday) - which simply
goes about a crosscompiler project from linux to windows. While the
libtool crosscompiling support towards win32 is working fine for the
most part, it did fail in the specific instance where I started to
create a dll that is dependent on another dll in a parallel subdir,
i.e. a non-installed dll of another subproject. In order to support
that, I started to add the build-dir of that subproject with a
-Ldir option, so that liby.dll was linked with -L../x -lx (schematic).

The problem is now that there is no implib available - the libx is
found through the libpath, and the libtool-link is trying to build
an implib for it on the fly. Well, we are used to see some tricks
with objdump or a call to dlltool to handle the dll-specific stuff
with .def-files and implibs, but in this case there is some c-source
patched into libtool called impgen.c - that c-source gets compiled,
and the resulting binary is used to extract the symbol-list from the
dll-file (a .def file), creating an appropriate implib being local
to the liby-builddir. The final liby.dll link will then reference
it, and succeed.

While all this is quite clever, it fails during crosscompiling, as
in the current setup, the crosscompiler is errornously used to 
create the impgen-binary - obviously this functionality was tested
on native win-build systems. As it stands, it needs a native-cc
to succeed in this crosscompile - however, it would be the only
usage of such a native-build, for all other functionality in 
compiling dll-specialties, we have started to put the functions
into dlltool/dllwrap, and have that one as a requirement for
crosscompiling, and effectivly every crosscompiler gcc has its set
of binutils ready for the projects to be used.

So in fact, it would be best to have the impgen-binary to be
preinstalled in the crosscompiler-environment before any project
is crosscompiled. Given that the impgen.c-provided functionality
is very very close in its handling with what libtool --output-def 
is doing, it should better get merged into dlltool.c - currently
I started to use a wrapper around the original dlltool, and the
(now preinstalled) dlltool-impgen is trigged with "--export-def",
and I had good success with it. :-) The usage of an option that
looks similar to --output-def is intentional - the .def provided
by --output-def happens to be just longer than the --export-defs
that are listed by the impgen-routines.

Adding the routine-set in dlltool.c should be easy, and does not
hurt anyone, but may be someone has another idea on the topic,
may be someone does not want to have it in binutils for some
reasons, and anyway, just get me informed on the standard
procedure to get the change accepted for the next binutils release.

thanks in advance,
-- guido                                http://guidod.4t.com
31:GCS/E/S/P C++$++++ ULHS L++w- N++@  d(+-) s+a-  y++ 5++X-



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]