[Resend]
From: Mark Mitchell
Sent: Saturday, 4 November 2006 9:28 a.m.
> 
> I recently tried to use a MinGW GCC (built from FSF sources) to link 
> with a .lib file that had been compiled with MSVC, and got link-time 
> errors about _chkstk.  After some searching, I understand what this 
> function is for (it's a stack-probing thing that MSVC generates when 
> allocating big stack frames), and that GCC has an equivalent 
> in libgcc 
> (called _alloca).  There also seems to be widespread belief 
> that in fact 
> the libgcc routine is compatible with _chkstk.  

That's what my experience indicates.

And, there 
> are lots of 
> people that have reported link failures involving _chkstk.
> 
> So, my (perhaps naive) question is: why don't we define _chkstk as an 
> alias for _alloca in MinGW, so that we can link with these 
> MSVC libraries?
> 

I have also run into converse problem -- using GCC-compiled static libs
in MSVC projects
and getting an undefined reference to libgcc's _alloca.

Now there is an _alloca exported from win32api libs, but it really is
alloca rather than
a helper function _alloca_probe/_chkstk, so libgcc's symbol does have an
unfortunate name.


I see no reason why we can't use more MSVC-compatible aliases.
 
Danny


> Thanks,
> 
> -- 
> Mark Mitchell

Reply via email to