> -----Original Message-----
> From: NightStrike [mailto:nightstr...@gmail.com]
> Sent: Monday, March 21, 2011 6:09 AM
> To: Dock, Dion
> Cc: mingw-w64-public@lists.sourceforge.net
> Subject: Re: [Mingw-w64-public] undefined reference to __GSHandlerCheck
> 
> On Mon, Feb 28, 2011 at 7:16 PM, Dock, Dion <dion_d...@mentor.com>
> wrote:
> >> -----Original Message-----
> >> From: Jon [mailto:10wa...@gmail.com] On Behalf Of JonY
> >> Sent: Thursday, January 27, 2011 5:50 PM
> >> To: Dock, Dion
> >> Cc: mingw-w64-public@lists.sourceforge.net
> >> Subject: Re: [Mingw-w64-public] undefined reference to
> >> __GSHandlerCheck
> >>
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> On 1/28/2011 09:29, Dock, Dion wrote:
> >> > I've searched and searched for an answer but maybe my Google-fu is
> >> weak.
> >> >
> >> > We produce a library with VS 2005.  When I try to link it into a
> >> > test program using g++, I get lots of messages like
> >> >
> >> >     ...
> >> >
> >> C:\Views\dockd_headers\lip__mgls_nt\mgls_nt\src\release\mgls64.lib(./
> >> x6
> >> 4/release/lpclsdll.obj):(.text[?messageBox@@YAXPEAD@Z]+0xcb):
> >> undefined reference to `__security_check_cookie'
> >> >
> >> C:\Views\dockd_headers\lip__mgls_nt\mgls_nt\src\release\mgls64.lib(./
> >> x6
> >>
> 4/release/lpclsdll.obj):(.xdata[$unwind$?messageBox@@YAXPEAD@Z]+0xc)
> >> : undefined reference to `__GSHandlerCheck'
> >> >     ...
> >> >
> >> > If I recompile our library without the "Buffer Security Check"
> >> > option (/GS-),
> >> then ld.exe crashes after the compile:
> >> >
> >> >     C:\Temp>C:\mingw_64\bin\x86_64-w64-mingw32-g++.exe
> checkout.cpp
> >> C:\Views\dockd_headers\lip__mgls_nt\mgls_nt\src\release\mgls64.lib -I
> >> C:\Views\dockd_headers\lip__mgls_nt\mgls_nt\src\include
> >> >     checkout.cpp: In function 'int main()':
> >> >     checkout.cpp:12:47: warning: deprecated conversion from string
> >> constant to 'char *'
> >> >     collect2: ld returned 5 exit status
> >> >
> >> > Any thoughts on where `__GSHandlerCheck' and
> >> `__security_check_cookie' are defined?  There has to be a way to link
> >> with a Visual Studio created lib.
> >> >
> >> > thanks,
> >> > -Dion
> >>
> >> Hi,
> >>
> >> you should never link C++ libraries from different compilers together
> >> as they have different ABIs underneath, though C is usually fine. I'm
> >> surprised that it even worked.
> >>
> >> I don't know what __GSHandlerCheck and __security_check_cookie are,
> >> possibly found only in MSVC libraries.
> >
> > I tried recompiling the source as C code (not C++) with Visual Studio
> > and these problems still occurred.  They go away if I compile the source
> with gcc.
> >
> > I thought C compilers produced interchangeable code?
> 
> I'm guessing this is still an issue.  How much farther along are you?

I could get the problems to go away by linking with Microsoft's gshandler.obj 
and bufferoverlowu.lib but the latter might not be redistributable.  I'm going 
to compile the library and app with MinGW64.  Then there are no issues with 
these functions missing.

-Dion

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to