delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/05/08/08:46:53

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <779F20BCCE5AD31186A50008C75D9979171720@silldn_mail1.sanwaint.com>
From: "Fifer, Eric" <EFifer AT sanwaint DOT com>
To: cygwin AT sourceware DOT cygnus DOT com
Subject: g++ COM problem with function pointers and -O2
Date: Mon, 8 May 2000 14:48:07 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)

I'm use Cygwin, Perl and the Win32::OLE Perl module to interact with
COM objects.  And, of course, the Win32::OLE DLL is compiled with
-fvtable-thunks.  For the most part everything works just fine
(and as of Cygwin 1.1.0, Perl 5.6.0 and Win32::OLE 0.12 build
right out the box).

However, the extra DCOM functions like CoCreateInstanceEx are
implemented in the Win32::OLE Perl module by dynamically looking up
functions, LoadLibrary("OLE32") GetProcAddress("CoCreateInstanceEx"),
and calling through the function pointers.  However, this fails
when Perl is compiled with -O2 or -O.  Note that the Win32::OLE module
is dynamically loaded into Perl and the problem is triggered
when the separate Perl DLL has been built with the optimizer.

There are a couple of work-arounds.  Things are fine if Perl
is built with just -g!  Also, If I change the function pointer
to just a normal function call, it works too.  The failure with
function pointers and -O2 manifests itself as a stack corruption.

I know there are some limitations with COM support, but this
seems particularly strange because it depends on whether the
optimizer is used by a separate DLL.

Any idea what's going on here?

Thanks,

Eric Fifer

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019