This is the mail archive of the binutils@sourceware.cygnus.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]

Re: BFD for Visual C++


On Fri, Mar 10, 2000 at 10:58:16AM +0100, Siegl Kurt wrote:
>Hi,
>
>I have troubles generating a version of bfd which is usable under Microsoft
>Visual C++.
>Does anyone know how to configure the lib properly that this is possible?
>
>What I tried so far is generating a dll using the cygwin tool chain,
>configuring with
>--enable-shared.
>Afterwards I tried to generate a MSC export lib with:
>	lib /DEF:bfd.dll-def /OUT:bfd.lib 
>
>When using the DLL within a program compiled with the Cygnus compiler,
>everything works fine. With exactly the same Programm compiled under MSC
>it crashes deep in the NT DLL called by the cygwin DLL called by the bfd DLL
>executing a bfd_open call (So no chance to debug it).

I don't know why you think this is impossible to debug.  Are you sure that
you're looking at the correct thread?  If cygwin is involved, your program
is multithreaded, so you may need to issue a "thread 1" command in gdb
to get to your main thread.

>I get some warnings when generating the DLL. Are they of importance?
>
>*** Warning: This library needs some functionality provided by -lcygwin.
>*** 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.

Hmm.  I don't know how you could possibly create a non-shared libcygwin.a.
If you did, that may be one problem.  Cygwin won't work as a non-shared
library.

>*** Warning: This library needs some functionality provided by -lkernel32.
>*** 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.
>*** The inter-library dependencies that have been dropped here will be
>*** automatically added whenever a program is linked with this library
>*** or is declared to -dlopen it.

This is also true of the system DLL kernel32.dll.  Something is not
configured correctly.

>Is it possible to configure bfd for the Microsoft compilers native?
>Anyone done anything like that before?  I have to support a new
>architecture, so precompiled binaries will not help.

The object format produced by the GNU tools for Windows should be
compatible with the MSVC tools.

It might be best to check out the cygwin web page
http://sourceware.cygnus.com/cygwin/ and download the newest EGCS and
binutils from the references there.

Also, the cygwin mailing list, cygwin@sourceware.cygnus.com, might
provide more help with your problem.  You can subscribe to this mailing
list by sending email to cygwin-subscribe@sourceware.cygnus.com.

Chris Faylor
Cygwin Engineering Manager
Cynus Solutions, a Red Hat company

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