[Top][All Lists]

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

[Bug binutils/945] New: [PATCH] dlltool import library compatibility wit

From: vanveghel at home dot nl
Subject: [Bug binutils/945] New: [PATCH] dlltool import library compatibility with BCPP
Date: 12 May 2005 09:05:23 -0000

Through circumstances beyond my control *cough* I've recently had to write
some software in Borland C++ Builder 6 - now one of the libraries that I need
I've created with cygwin / MingW; however, converting the .LIB created by
dlltool for use with Borland (COFF2OMF) doesn't exactly work as it's supposed
to - specifically, COFF2OMF is mistaking the stub file that dlltool creates for
the actual DLL it has to load;

Let me say first, though, that this is probably more of an error on the side of
Borland than it is on that of dlltool, so I'm not expecting you to actually
incorporate this patch into the current codebase (or at least not in it's
current form) - but I thought I'd point it out here anyway and share my
experiences, so that others that run into the same problems can have some use
for it.

Having said that, I've added a simple option to dlltool to indicate it should
just use the dll_name variable as the stub filename, which seems to do the trick
just perfectly, albeit in a rather dirty way ;-) The option and it's description
should probably be changes aswell - I don't think it should mention Borland
specifically, and right now it's suggesting it will create a Borland compatible
library (OMF) ..

I'm creating the DLL, the .LIB and the BCPP .LIB (COFF2OMF) like so:

  g++ -c test.cpp
  dlltool --bcpp-implib --add-underscore --dllname test.dll \
          -e exports.o -l test.lib test.o
  g++ -mdll -mno-cygwin test.o exports.o -o test.dll
  coff2omf -q test.lib test_bcpp.lib

Which creates a .LIB that still works with at least GCC (I haven't tried it with
VC++) and of course now works with BCPP. Note that the --add-underscore is
needed by BCPP, so perhaps it should be impliclity enabled by the --bcpp-implib
option (though perhaps that behavior can be turned off in COFF2OMF)

The patch is against dlltool 2.15.94 (20041229), which is supplied with cygwin -
but ViewCVS reveals that the behavior hasn't seemed to have changed in later
versions (but then I haven't actually tried it, so I could be wrong - or maybe
I'm approaching the whole thing incorrectly to begin with ;-))

Anyway, this patch fixes my problems; I hope can be useful to others aswell.

Kind regards,

Jasper van Veghel

           Summary: [PATCH] dlltool import library compatibility with BCPP
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: vanveghel at home dot nl
                CC: bug-binutils at gnu dot org


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

reply via email to

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