public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Old Wolf <ow2@outlook.co.nz>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Cannot use Cygwin64 with MSVC 64-bit DLL
Date: Sun, 17 May 2020 21:03:33 +0000	[thread overview]
Message-ID: <SYBPR01MB36418FFAC8D8A0AF8EBE6E8BCCBB0@SYBPR01MB3641.ausprd01.prod.outlook.com> (raw)

Hi all

I am ultimately trying to use Cygwin 64-bit to port a Solaris server application which uses the Informix Client SDK.  However, the Win64 version of that product comes as a binary-only distribution of DLLs built by MSVC .

I have managed to reproduce the problem in a simple test case.  I made a full writeup here: https://stackoverflow.com/questions/61812131/

In brief, linking a 64-bit DLL created by MSVC with early binding to any program built with /usr/bin/gcc  (or /usr/bin/g++) produces a runtime error "The procedure entry point __cxa_atexit could not be located in the dynamic link library F:\temp\mre.exe"​ .  (Also, if the executable is launched from the Cygwin shell no output appears; I see this error popup by launching from command prompt).

However the testcase does work correctly if I use late binding (i.e. LoadLibrary and GetProcAddress).  But this is a considerable nuisance in comparison to early binding (i.e. linking against the DLL's import library).  It also works correctly under MSYS2 , and native-target mingw-w64.  Only Cygwin64 early-binding exhibits the problem.

I don't have the option of trying to rebuild the import library as suggested in comments to my SO question, as the Informix DLL is stripped .  I would like to use Cygwin as opposed to MSYS2 because the application uses SYSV IPC which is supported by Cygwin. So I need to either resolve this problem, create my own "import library" with late binding thunks for every function, or rewrite the SYSV IPC stuff to WinAPI stuff and use MSYS2 instead. Hoping the first of those three options turns out to be possible!

Regards,
M.M.

             reply	other threads:[~2020-05-17 21:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-17 21:03 Old Wolf [this message]
2020-05-18  6:03 ` Marco Atzeri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SYBPR01MB36418FFAC8D8A0AF8EBE6E8BCCBB0@SYBPR01MB3641.ausprd01.prod.outlook.com \
    --to=ow2@outlook.co.nz \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).