Hi Timur, I myself find the name "Win32" pretty confusing and easy to misuse (especially for someone who assumes that windows == msvc). After all mingw and cygwin is also win32. Maybe we should rename it into isTargetMSVC or something like this? On Wed, Mar 27, 2013 at 6:26 AM, Timur Iskhodzhanov <timurrrr at google.com> wrote:> Anton, > > What do you think? > > 2013/3/20 Eric Christopher <echristo at gmail.com>: >> >> >> >> On Wed, Mar 20, 2013 at 5:21 PM, Timur Iskhodzhanov <timurrrr at google.com> >> wrote: >>> >>> 2013/3/20 Timur Iskhodzhanov <timurrrr at google.com>: >>> > Anton, >>> > >>> > [+Eric, Nick, >>> > the e-mail thread context has been broken a few times, so you should >>> > probably look at the llvmdev archives. >>> > It all starts here: >>> > http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-October/053961.html ] >>> > >>> > So I've decided to make a new attempt to fix this issue. >>> > >>> > We've discussed my patches with Eric and came up with the following >>> > idea: >>> > a) IsTargetWindows should be true for all the targets that execute on >>> > the Windows kernel, including Cygwin, MinGW and MSVC ABIs. >>> > >>> > However, "Windows 32-bit ABI" usually implies "MSVC 32-bit ABI", so >>> > it's Cygwin and MinGW (that are similar more similar to Itanium ABI >>> > than to MSVC ABI) that should be exceptions from the general Win32 >>> > handling code. >>> > >>> > That is, >>> > b) We should add a IsTargetWin32 which is true if the MSVC 32-bit ABI >>> > is used and false for Cygwin+MinGW. >>> FTR, there's already such a method but it is (mis?)used only in >>> lib/Target/X86/X86FrameLowering.cpp for segmented stacks. >>> Are segmented stacks actually used with MSVC or is it just the >>> conditions there should use isTargetMingw() && !is64Bit() instead? > > Attached is a patch that makes the proposed change to isTargetWin32 > and also fixes all the previous uses of isTargetWin32. > Can you please review it? > > -- > Thanks, > Timur > >> cc'ing graydon about segmented stacks because I know rust uses them. >> >> -eric >> > > _______________________________________________ > cfe-dev mailing list > cfe-dev at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev >-- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Hi Anton,>From my perspective Win32 is the windows ABI and mingw and cygwin are theirown ABIs especially as we're not targeting the MSVC abi, it's just the windows abi? -eric On Wed, Mar 27, 2013 at 1:32 PM, Anton Korobeynikov <asl at math.spbu.ru>wrote:> Hi Timur, > > I myself find the name "Win32" pretty confusing and easy to misuse > (especially for someone who assumes that windows == msvc). After all > mingw and cygwin is also win32. Maybe we should rename it into > isTargetMSVC or something like this? > > On Wed, Mar 27, 2013 at 6:26 AM, Timur Iskhodzhanov <timurrrr at google.com> > wrote: > > Anton, > > > > What do you think? > > > > 2013/3/20 Eric Christopher <echristo at gmail.com>: > >> > >> > >> > >> On Wed, Mar 20, 2013 at 5:21 PM, Timur Iskhodzhanov < > timurrrr at google.com> > >> wrote: > >>> > >>> 2013/3/20 Timur Iskhodzhanov <timurrrr at google.com>: > >>> > Anton, > >>> > > >>> > [+Eric, Nick, > >>> > the e-mail thread context has been broken a few times, so you should > >>> > probably look at the llvmdev archives. > >>> > It all starts here: > >>> > http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-October/053961.html] > >>> > > >>> > So I've decided to make a new attempt to fix this issue. > >>> > > >>> > We've discussed my patches with Eric and came up with the following > >>> > idea: > >>> > a) IsTargetWindows should be true for all the targets that execute on > >>> > the Windows kernel, including Cygwin, MinGW and MSVC ABIs. > >>> > > >>> > However, "Windows 32-bit ABI" usually implies "MSVC 32-bit ABI", so > >>> > it's Cygwin and MinGW (that are similar more similar to Itanium ABI > >>> > than to MSVC ABI) that should be exceptions from the general Win32 > >>> > handling code. > >>> > > >>> > That is, > >>> > b) We should add a IsTargetWin32 which is true if the MSVC 32-bit ABI > >>> > is used and false for Cygwin+MinGW. > >>> FTR, there's already such a method but it is (mis?)used only in > >>> lib/Target/X86/X86FrameLowering.cpp for segmented stacks. > >>> Are segmented stacks actually used with MSVC or is it just the > >>> conditions there should use isTargetMingw() && !is64Bit() instead? > > > > Attached is a patch that makes the proposed change to isTargetWin32 > > and also fixes all the previous uses of isTargetWin32. > > Can you please review it? > > > > -- > > Thanks, > > Timur > > > >> cc'ing graydon about segmented stacks because I know rust uses them. > >> > >> -eric > >> > > > > _______________________________________________ > > cfe-dev mailing list > > cfe-dev at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev > > > > > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130327/dd824ba3/attachment.html>
Eric Christopher <echristo at google.com> writes:> From my perspective Win32 is the windows ABI and mingw and cygwin are > their own ABIs especially as we're not targeting the MSVC abi, it's > just the windows abi?MinGW and Cygwin must follow the Windows platform ABI for using the OS APIs. And they do. OTOH, there is no Windows C++ ABI. MSVC++, g++, Borland... all have their own C++ ABI.
Hi Eric,> From my perspective Win32 is the windows ABI and mingw and cygwin are their own ABIsNo. They are using Windows Platform ABI for almost everything (e.g. calling API, C runtime, etc.). At least mingw does. The differences are exactly in unspecified area (e.g. passing / returning structs by value). The only difference is C++, where mingw / cygwin follows Itanium ABI and MSVC - its own.> especially as we're not targeting the MSVC abi, it's just the windows > abi?It seems the proposal patch exactly tries to follow MSVC ABI to keep to compatibility :) So, just to summarize. Windows ABI / calling conventions are more or less documented and both mingw / cygwin and msvc follow it. The differences are in the undocumented area. Both for C and for C++. And here there is no "Windows ABI" here at all. Because every compiler (MSVC, gcc / clang, Borland) does its own stuff. This is why I said that the proposal naming is confusing. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University