From: Kai T. <kti...@go...> - 2009-03-15 13:43:46
|
2009/3/15 Shaun Barlow <sha...@gm...>: > Hi, > >> Ok, I found the issue. Your application calls __chkstk from kernel32, >> which is pretty false. Because the MS variant just probes the stack, >> but does not allocate it as the cygwin variant. There are two possible >> ways to solve this, a) Remove the export from kernel32.def in lib64, >> or rename the method in gcc/config/i386 defined in cygwin.asm and >> referenced in i386.md > > Thank you very much to Wolfgang for making the testcase, and Kai for > finding the problem :) > Applying Kai's solution a) Remove the export from kernel32.def in > lib64, to a local checkout > of the mingw-w64 crt has gotten rid of the segfaults I was > experiencing in my program > > In my opinion, solution a) would be the correct course because it > matches the behaviour of both > the mingw project's export library and Microsoft own export library > (referencing __chkstk in either > and then linking to kernel32 gives an unresolved symbol). Its naming > (double underscore prefix), would > also seem to indicate that it is not intended for outside use. > > It is obviously Kai's decision which route to take. > > Thanks and best regards, > Shaun > Yes, this issue is a bit annoying and is ported from mingw32. I disabled temporary the export symbol __chkstk in ntdll.def, kernel32.def, and ntoskernl.def. So always the variant of gcc is used and those kind of errors a prevented. But this means of course that vc generated libraries, which are using __chkstk will fail (as the do on 32-bits). I want to provide a change in 4.5 gcc to avoid this issue completely and allow the co-existance of gcc's and vc's stack checking routine for 64-bit and 32-bit by renaming the gcc's variant to __gnu_chkstk. Fix is on mingw-w64 trunk rev.678. Cheers, Kai -- | (\_/) This is Bunny. Copy and paste | (='.'=) Bunny into your signature to help | (")_(") him gain world domination |